The pre-commit job has never run its hooks — it invokes pre-commit run with nothing staged, so every hook skips and the job passes. That is fixed separately in #108; this issue is about the one hook that fix leaves switched off.
Running pre-commit run --all-files against main gives 37 pylint findings across 21 modules. Turning the hook on in the same pull request would have meant either fixing all of them blind or leaving CI red, so it is disabled there with a comment, and the work is recorded here.
Two separate questions:
-
Which pylint? The hook is configured language: system, so it runs whatever the [pre-commit] extra installs — currently pylint>=3, which resolves to 4.0.7. This codebase has never been through pylint 4, so some part of those 37 findings is a new major version's opinions rather than drift in the code. Pinning the hook to a known version would make the count mean something and stop it moving underfoot.
-
Eight of the findings look like real bugs. Most of the 37 are style — too-many-positional-arguments, an unnecessary elif — but these are possibly-used-before-assignment or used-before-assignment, which is pylint reporting a path where a name is read before every branch has bound it:
workflows/optimize.py (two findings)
workflows/bands.py
utils/parser/center.py
utils/pseudo/upf.py
utils/workflows/plot/distance.py (three findings)
Suggested order:
- pin the pylint version
- triage the eight above and fix/dismiss each
- clear the remaining style findings
- drop the
pylint exclusion from .pre-commit-config.yaml
The
pre-commitjob has never run its hooks — it invokespre-commit runwith nothing staged, so every hook skips and the job passes. That is fixed separately in #108; this issue is about the one hook that fix leaves switched off.Running
pre-commit run --all-filesagainstmaingives 37 pylint findings across 21 modules. Turning the hook on in the same pull request would have meant either fixing all of them blind or leaving CI red, so it is disabled there with a comment, and the work is recorded here.Two separate questions:
Which pylint? The hook is configured
language: system, so it runs whatever the[pre-commit]extra installs — currentlypylint>=3, which resolves to 4.0.7. This codebase has never been through pylint 4, so some part of those 37 findings is a new major version's opinions rather than drift in the code. Pinning the hook to a known version would make the count mean something and stop it moving underfoot.Eight of the findings look like real bugs. Most of the 37 are style —
too-many-positional-arguments, an unnecessaryelif— but these arepossibly-used-before-assignmentorused-before-assignment, which is pylint reporting a path where a name is read before every branch has bound it:workflows/optimize.py(two findings)workflows/bands.pyutils/parser/center.pyutils/pseudo/upf.pyutils/workflows/plot/distance.py(three findings)Suggested order:
pylintexclusion from.pre-commit-config.yaml