pre-commit: use repo local - #204
Conversation
| # Autofixable return type annotations to help mypy check more code | ||
| - id: ruff-ANN2 | ||
| name: ruff-ANN2 | ||
| # --exit-zero: only fail when a fix is applied, | ||
| # not on leftover non-autofixable violations | ||
| entry: > | ||
| ruff check | ||
| --fix | ||
| --unsafe-fixes | ||
| --exit-zero | ||
| --select=ANN2 | ||
| --ignore=ANN202 | ||
| language: system | ||
| types_or: [python, pyi] | ||
| require_serial: true |
There was a problem hiding this comment.
I'm not sure I understand the relevance. Can you elaborate?
There was a problem hiding this comment.
Running pre-commit with this setup runs autofixes for adding simple annotations, without blocking the CI on Ruff for missing return type annotations that can't automatically be added.
But given your comment of
My goal was to eliminate the need to add
-> Noneto every unit test (because unit tests almost never return anything). It feels like noise to me. Automating the addition of that noise reduces the churn burden but not the cognitive burden of ignoring unhelpful annotations.
I understand it's not just about having to add return type annotations manually. So you probably wouldn't want this hook anyway.
That's the relevance to that comment.
| * :ref:`genindex` | ||
| * :ref:`modindex` | ||
| * :ref:`search` | ||
|
|
There was a problem hiding this comment.
This looks like editor noise. I prefer files that end in newlines (that's how my editor's configured to save files).
a0d7383 to
52b8731
Compare
52b8731 to
a89ec19
Compare
|
I think Claude did an ok job describing what this PR is trying to bring in 96265d3 , of course, those paragraphs should be updated and simplified if this gets merged. (non-local hooks still need a pin, but there's no more duplication) The two options for PR autofixes would be either:
|
Makes pre-commit tooling version desync a thing of the past. Whilst keeping
pre-commitas a useful offer and easily installable pre-commit hook- repo: localmeans that this can't be used for CI autofixes through pre-commit.ci, but none of your project use it anyway.And if you did want CI autofixes, I'd recommend
pre-commit-liteorautofix.cianyway, as to keep this version deduplication.