bp / bp/resqpy

Enable a progressively larger subset of ruff rules for logical issues

Open
#924 0 comments 0 reactions 0 assignees View on GitHub
good first issue
Dominant language
Python
Stars
67
Forks
18
Avg merge
2h 26m
Merged PRs (30d)
1

Description

We could enable some linting rules for things that look like real bugs. A few high signal-to-noise ones could be:
- [ ] PLW0177 - we have a few checks with `== np.nan` that always evaluate to `False` and are thus pointless
- [ ] B006 - mutable default args, easy to fix
- [ ] B904 - better exception chaining
- [ ] PLW2910 - loop var overwritten, a bit suspicious, 10 hits

Others to investigate: PLE / RSE, FLY, PIE810.

Other rules which probably make sense only after enabling ruff format, but which are probably lower-priority:

- [ ] UP (pyupgrade), urles are largely auto-fixable (hurrah)
- [ ] SIM (simplify) - often useful
- [ ] RET - avoid returning None implicitly. Perhaps a longer-term goal, as lots of resqpy functions

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the repository's Ruff configuration and the reported checks for PLW0177, B006, B904, and PLW2910. Investigate the additional PLE, RSE, FLY, PIE810, UP, SIM, and RET rule groups only after assessing the high-signal candidates. Done means the selected rules are enabled and their reported issues are addressed without introducing unrelated lint changes.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
tooling
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.