Repository navigation
Ruff config - #14744
Ruff config#14744
Conversation
|
Thank you for your contribution to Astropy! 🌌 This checklist is meant to remind the package maintainers who will review this pull request of some common things to look for.
|
|
👋 Thank you for your draft pull request! Do you know that you can use |
3c2124a to
7375b37
Compare
|
First #14692, then this. |
mhvk
left a comment
There was a problem hiding this comment.
As noted in the issue, I'm not so sure this move is really needed, but if all agreed, then of course it is fine. PR itself is OK except for a strange unrelated change that seems to have slipped in.
eerovaher
left a comment
There was a problem hiding this comment.
Ruff documentation says that if it finds ruff.toml then it doesn't normally bother reading pyproject.toml, but if we add extend = "pyproject.toml" to our ruff.toml then we can keep the permanent settings there and write out only the TODO items here. Having the permanent and TODO settings in different files would make it very simple to distinguish between the two, for maintainers and for new contributors alike.
| "ANN", | ||
|
|
||
| # flake8-unused-arguments (ARG) | ||
| "ARG001", # unused-function-argument # 493 violations (2023-05-03) |
There was a problem hiding this comment.
I don't think writing out these numbers adds much value. Writing out the command to obtain these numbers would be much more useful.
| "ARG001", # unused-function-argument # 493 violations (2023-05-03) | |
| "ARG001", # unused-function-argument |
There was a problem hiding this comment.
The idea for this is to make it easy for maintainers / contributors to find an issue to work on -- essentially helpful triage. I don't think many / any people will run the command umpteen times before finding something suitable to work on.
There was a problem hiding this comment.
ruff --select="ALL" --statistics . gives much the same information but its output is guaranteed to be up to date with no maintenance burden. Furthermore, some of these rules affect many files and we should encourage addressing them one subpackage at a time. In such cases the numbers listed in the file are not useful at all, but the command can be easily modified, e.g. ruff --select="ALL" --statistics astropy/time
There was a problem hiding this comment.
Fine enough with me. I worry slightly that this is adding a step, reducing the odds someone volunteers to fix something. So far it's mostly been myself and @WilliamJamieson.
I like this. |
02385d4 to
c35d4ed
Compare
mhvk
left a comment
There was a problem hiding this comment.
This looks all good to me, thanks!
|
@eerovaher and @WilliamJamieson , please re-review. Thanks! |
eerovaher
left a comment
There was a problem hiding this comment.
This is almost ready to be merged, I only have one remark left.
- per-subpackage fix loc - Sort into permanent and TODO - label number of violation Signed-off-by: Nathaniel Starkman (@nstarman) <[email protected]> Co-authored-by: Eero Vaher <[email protected]> Signed-off-by: Nathaniel Starkman (@nstarman) <[email protected]>
Deleted this. Might as well just fix. Signed-off-by: Nathaniel Starkman (@nstarman) <[email protected]>
| unfixable = [ | ||
| "E711" # NoneComparison. Hard to fix b/c numpy has it's own None. | ||
| ] |
There was a problem hiding this comment.
Does this belong here or should it be in pyproject.toml?
There was a problem hiding this comment.
I would like to fix this eventually.
Or ask ruff if this can be detected with a sufficiently low false-positive rate.
|
Thanks, all! |
fixes #14736