chore: add ruff-extra-rules linter/formatter - #410
alessio-locatelli merged 1 commit into
Conversation
e7a0575 to
a481f2d
Compare
JWCook
left a comment
There was a problem hiding this comment.
Interesting! So far I've just looked over your docs and didn't dive into the code, but ruff-extra-rules looks carefully thought out. I don't think I've seen semantic analysis in a linter before (redundant-assignment/TR5 rule). TR3 looks useful; that one has bitten me before.
For rule TR7, how does it identify which line is the relevant expression that a comment belongs to, if there are multiple expressions within the bracket?
No objections here; go ahead and merge this if you'd like.
|
Thanks for taking a look! Background on TR7: While working on several large codebases, I observed that enforcing the configured line-length limit caused Black and Ruff to automatically reformat inline comments associated with specific parameters by relocating them to the closing bracket. This significantly reduced code readability and necessitated manual inspection via On TR7: it's purely positional, no attempt to resolve which argument the comment describes.
The Yes, Glad TR3 and TR5 landed well — I'll go ahead and merge this, thanks for the review. |
Background: During code review, I've noticed that I repeat the same feedback for both coding agents and human developers. Some of these rules are either not yet implemented in linters or still under development, so I decided to fill this gap.
I'm flexible on the outcome:
If there will be a green light on this, I would like to submit an equivalent PR for https://github.com/requests-cache/requests-cache/