-
Notifications
You must be signed in to change notification settings - Fork 790
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Linting with Ruff #2033
Merged
+4,372
−2,659
Merged
Linting with Ruff #2033
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
a799194
install ruff
freddyheppell 5efd563
Ignore docstring in tests
freddyheppell 906a67b
Check auto fix
freddyheppell 65fc212
Ruff format
freddyheppell 40af1da
Unsafe D415 fix
freddyheppell 93c115a
Remove unneeded import version check
freddyheppell c6178b8
Remove additional unused import
freddyheppell 30fc335
Refix discarded changes during rebase
freddyheppell d8f74a1
Move ruff config into pyproject.toml
freddyheppell 6bccca5
Rerun ruff
freddyheppell f8a358f
Fix or ignore check failures
freddyheppell 4697666
Ruff format
freddyheppell 504e4d6
Initial workflow
freddyheppell 34a7f58
Fix format check command
freddyheppell 8a5fd25
Cache pip dependencies in workflow
freddyheppell aa40a02
Test format failure
freddyheppell 5bae749
Different method for allowing failure
freddyheppell 4b2d219
Revert "Test format failure"
freddyheppell 2e4f9f7
Test check failure
freddyheppell 596172c
Alternate always run method permitting cancellation
freddyheppell e7fe858
Revert "Test check failure"
freddyheppell 4ae8b3c
add to contributing
freddyheppell b6e5146
disable pip cache for now
freddyheppell File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -75,6 +75,7 @@ spacy = [ | |
test = [ | ||
"pytest>=5.4.3", | ||
"pytest-cov>=2.6.1", | ||
"ruff~=0.4.7", | ||
] | ||
use = [ | ||
"tensorflow", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
target-version = "py38" | ||
|
||
[lint] | ||
select = [ | ||
"E4", # Ruff Defaults | ||
"E7", | ||
"E9", | ||
"F", # End Ruff Defaults, | ||
"D" | ||
] | ||
|
||
ignore = [ | ||
"D100", # Missing docstring in public module | ||
"D104" # Missing docstring in public package | ||
] | ||
|
||
[lint.pydocstyle] | ||
convention = "google" |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a specific reason you used the ~= operator here? I can imagine using it likely makes dependency management more stable but I like using >= to quickly find out when new major/minor versions are released and things break 😅 That way, I do not have to make changes to support new releases and only change when something breaks (which people are more likely to communicate rather than when things work).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I ended up going with this version constraint because if, in a PR, someone were to install a newly released version, it may introduce new rules which reformat/start erroring on code unrelated to the PR.
Arguably the linter version can be kept constant forever, but it can be safely incremented in a separate PR every so often to avoid this.