Replace pycodestyle with ruff #10352

Closed
opened 2025-12-29 21:30:23 +01:00 by adam · 0 comments
Owner

Originally created by @jeremystretch on GitHub (Oct 10, 2024).

Originally assigned to: @jeremystretch on GitHub.

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.

Originally created by @jeremystretch on GitHub (Oct 10, 2024). Originally assigned to: @jeremystretch on GitHub. ### Proposed Changes Replace the `pycodestyle` linter with [`ruff`](https://docs.astral.sh/ruff/), ignoring the following codes: - [E501](https://docs.astral.sh/ruff/rules/line-too-long/) - line too long - [F403](https://docs.astral.sh/ruff/rules/undefined-local-with-import-star/) - wildcard import - [F405](https://docs.astral.sh/ruff/rules/undefined-local-with-import-star-usage/) - import via wildcard `ruff` currently alerts on the codes listed below. These will need to be resolved prior to its implementation. - [x] [F541](https://docs.astral.sh/ruff/rules/f-string-missing-placeholders/) - f-string without placeholders (78) - [x] [F841](https://docs.astral.sh/ruff/rules/unused-variable/) - unused variable (25) - [x] [F821](https://docs.astral.sh/ruff/rules/undefined-name/) - undefined name (24) - [x] [F811](https://docs.astral.sh/ruff/rules/redefined-while-unused/) - re-defined while unused (4) - [x] [F901](https://docs.astral.sh/ruff/rules/raise-not-implemented/) - `raise NotImplemented` (3) - [x] [E714](https://docs.astral.sh/ruff/rules/not-is-test/) - "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.
adam added the status: acceptedtype: housekeeping labels 2025-12-29 21:30:23 +01:00
adam closed this issue 2025-12-29 21:30:24 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#10352