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

Replace pycodestyle with ruff #17733

Closed
6 tasks done
jeremystretch opened this issue Oct 10, 2024 · 0 comments · Fixed by #17734
Closed
6 tasks done

Replace pycodestyle with ruff #17733

jeremystretch opened this issue Oct 10, 2024 · 0 comments · Fixed by #17734
Assignees
Labels
status: accepted This issue has been accepted for implementation type: housekeeping Changes to the application which do not directly impact the end user

Comments

@jeremystretch
Copy link
Member

jeremystretch commented Oct 10, 2024

Proposed Changes

Replace the pycodestyle linter with ruff, ignoring the following codes:

  • E501 - line too long
  • F403 - wildcard import
  • F405 - import via wildcard

ruff currently alerts on the codes listed below. These will need to be resolved prior to its implementation.

  • F541 - f-string without placeholders (78)
  • F841 - unused variable (25)
  • F821 - undefined name (24)
  • F811 - re-defined while unused (4)
  • F901 - raise NotImplemented (3)
  • E714 - "not is" test (1)

Justification

ruff is considerably faster than pycodestyle and implements a much larger set of rules. This will help catch common errors, such as those listed above.

@jeremystretch jeremystretch added status: accepted This issue has been accepted for implementation type: housekeeping Changes to the application which do not directly impact the end user labels Oct 10, 2024
@jeremystretch jeremystretch self-assigned this Oct 10, 2024
bctiemann pushed a commit that referenced this issue Oct 11, 2024
* Resolve F541 errors

* Resolve F841 errors

* Resolve F811 errors

* Resolve F901 errors

* Resolve E714 errors

* Ignore F821 errors for GraphQL mixins

* Replace pycodestyle with ruff

* Move ignores to ruff.toml
jeremystretch added a commit to alehaa/netbox that referenced this issue Oct 11, 2024
…box-community#17734)

* Resolve F541 errors

* Resolve F841 errors

* Resolve F811 errors

* Resolve F901 errors

* Resolve E714 errors

* Ignore F821 errors for GraphQL mixins

* Replace pycodestyle with ruff

* Move ignores to ruff.toml
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 10, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: accepted This issue has been accepted for implementation type: housekeeping Changes to the application which do not directly impact the end user
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant