Skip to content
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
merged 23 commits into from
Jun 19, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
install ruff
freddyheppell committed Jun 13, 2024
commit a799194f1420cd6befda12abf40b5eb3d7fd9ea1
1 change: 1 addition & 0 deletions pyproject.toml
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",
Copy link
Owner

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).

Copy link
Contributor Author

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.

]
use = [
"tensorflow",
18 changes: 18 additions & 0 deletions ruff.toml
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"