For some files (mostly when trying to commit multiple files) I'm getting this message (from with VSCODE and from the command line)
> git -c user.useConfigOnly=true commit --quiet --allow-empty-message --file -
bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
[WARNING] Unstaged files detected.
[INFO] Stashing unstaged files to /home/dave/.cache/pre-commit/patch1731348310-81464.
ruff.....................................................................Passed
ruff-format..............................................................Failed
- hook id: ruff-format
- files were modified by this hook
warning: The top-level linter settings are deprecated in favour of their counterparts in the `lint` section. Please update the following options in `pyproject.toml`:
- 'mccabe' -> 'lint.mccabe'
1 file reformatted
[WARNING] Stashed changes conflicted with hook auto-fixes... Rolling back fixes...
[INFO] Restored changes from /home/dave/.cache/pre-commit/patch1731348310-81464.
I've tried changing pyproject.toml from [tool.ruff.mccabe]
to [tool.ruff.lint.mccabe]
but it doesn't help.
It's not entirely consistent. I can't work out why it happens for some groups of files (but not if committed singly). Latest example is after a 1 line change in authentication.py
from
if "authorization" in request.headers:
to
if request.headers.contains("authorization"):
Linux
python --version
)3.12
main branch
No response
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too