-
Notifications
You must be signed in to change notification settings - Fork 848
Update Ruff, replace pycln and simplify configs #2676
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
base: main
Are you sure you want to change the base?
Conversation
4346978 to
e231f97
Compare
| from . import ( | ||
| # https://github.com/astral-sh/ruff/issues/15705 | ||
| IDLEenvironment, # noqa: F401 # Injects fast_readline into the IDLE auto-indent extension |
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.
astral-sh/ruff#15705
This was also already affecting pycln
| # No such concerns for stdlib | ||
| "TC003", # typing-only-standard-library-import | ||
| # Lots of lazy or side-effect imports | ||
| "PLC0415", # import-outside-top-level |
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.
Added ignore for Ruff 0.12
ruff.toml
Outdated
| [lint.per-file-ignores] | ||
| # Explicit re-exports is fine in __init__.py, still a code smell elsewhere. | ||
| "__init__.py" = ["PLC0414"] | ||
| # TODO: Make adodbapi changes in their own PRs | ||
| "adodbapi/*" = ["C4", "YTT301", "UP031", "UP032"] |
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.
PLC0414 is now ignored in __init__.py by default
UP031 and UP032 are already ignored globally, so are redundant here.
YTT301 was already passing
C4 had 3 fairly minor and safe autofixes. (also solved by #233)
…e-Ruff-and-simplify-configs
…/Avasam/pywin32 into Update-Ruff-and-simplify-configs
…/Avasam/pywin32 into Update-Ruff-and-simplify-configs
| "*.pyw", # Will be included by default in Ruff eventually | ||
| "*.pys", # PythonScript (Windows Script Host) |
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.
Ruff will eventually autodiscover *.pyw files (currently undocumented astral-sh/ruff#21885 and preview-only)
.pys files are perfectly valid Python as well (I have absolutely no idea how someone runs them 😅, but they are valid)
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.
.pysfiles are perfectly valid Python as well (I have absolutely no idea how someone runs them 😅, but they are valid)
These are scripts for Python with a registered "windows scripting host" - ie, typically executed with cscript.exe.
pycln was very useful as a starting point before all modules with intended side-effect were properly identified. Using Ruff instead reduces tooling dependencies, configs, special pragma comment keywords and time spent on CI.
*.pywand*.pysfiles