-
Notifications
You must be signed in to change notification settings - Fork 1
Description
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
-
blanket
noqacomments: https://docs.astral.sh/ruff/rules/blanket-noqa/- not sure if this included in ruff's default rules, but we should add it if not
-
unused arguments: https://docs.astral.sh/ruff/rules/#flake8-unused-arguments-arg
- number of times encountered that was an actual mistake: 2
-
mutable default arguments:
- https://docs.astral.sh/ruff/rules/mutable-argument-default/
- https://docs.astral.sh/ruff/rules/mutable-class-default/
- at least a few occurrences in hyp3-isce2, e.g.
swaths: list = [1, 2, 3]
Mypy
- disallow ignore comments without error code: https://mypy.readthedocs.io/en/stable/error_code_list2.html#code-ignore-without-code
Other
- redundant
exceptstatements; see Error handling for burst2safe--extentoption doesn't work as intended burst2safe#129- feels like that would fall under "unreachable code", which ruff doesn't currently support:
- is there another linter that does?