-
Notifications
You must be signed in to change notification settings - Fork 1
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
Additional static analysis rules #261
Comments
I think if we want to adopt a new rule, this process would suffice:
We don't necessarily need to release actions (step 2) if there are just README+Changelog changes, so things can sit in development ( after step 1) for a time until there's a need for an actions release, or we want to tackle the rule changes prompted b a release. I think the challenge is making sure to come back to commented-out rules. 🤔 Could make use of a tracking issue with sub-tasks for each repo, but that is potentially likely to go out of date if everyone doesn't follow the process. |
Yeah, I like that. Adding as a commented-out rule would increase the likelihood of remembering to enable it for repos we're actively developing.
We could add an |
I don't see us doing that en masse for all of our repos, since fixing static analysis errors in all ~23 of our Python projects at once has proved to be a very time-consuming process. But we could make a habit of uncommenting additional rules (and fixing the resulting errors) in |
This issue is a place to suggest additional static analysis rules (e.g. for ruff or mypy) that we would find useful, that are not currently listed in our recommended ruff config or recommended mypy config.
I'm not sure the best way to proceed with adopting additional rules, since doing an actions release just to update the README feels a bit cumbersome. I also don't want to feel compelled to update the ruff config in all of our repos every time we add a new rule. Maybe just a bumpless merge into
develop
to update the README, and then incorporating the additional rules into individual repos as we see fit?Anyway, this issue can serve as a list of proposed rule additions for now. Anyone should feel free to edit this list to add more.
Ruff
unused arguments: https://docs.astral.sh/ruff/rules/#flake8-unused-arguments-arg
mutable default arguments:
swaths: list = [1, 2, 3]
Mypy
Other
except
statements; see Error handling for burst2safe--extent
option doesn't work as intended burst2safe#129unreachable-code
feature astral-sh/ruff#9463return None
astral-sh/ruff#6334The text was updated successfully, but these errors were encountered: