adafruit / cookiecutter-adafruit-circuitpython

Cookiecutter template for Adafruit's CircuitPython libraries.
MIT License
22 stars 37 forks source link

Revise `ruff.toml`'s `extend select` #240

Open EGJ-Moorington opened 1 month ago

EGJ-Moorington commented 1 month ago

ruff.toml extends the selection of errors in extend-select, but some of those are part of the Ruff preview. I'm unsure if this is set up so that when the errors leave the preview they are enabled, or if the template should be modified so that Ruff is set to preview by default.

Rule F401 is commented in extend-select so that the try: import typing used by libraries doesn't get removed automatically by Ruff when running pre-commit. However, I believe both library makers and other users would benefit from having rule F401 uncommented. Library developers can add the comment # noqa: F401 to their import typing line so that it doesn't automatically get removed by Ruff.