pre-commit-ci / issues

public issues for https://pre-commit.ci
16 stars 3 forks source link

Conflicting hooks after automatic update #208

Closed fchabouis closed 3 months ago

fchabouis commented 3 months ago

Hello, On our repo, pre-commit-ci created a PR to update some of its hooks. However, reorder-python-importsand black seem to be in conflict. One hook changes some files, and the changes are immediately reverted by the next, causing the CI to fail.

❯ pre-commit run --all-files
trim trailing whitespace.................................................Passed
fix end of files.........................................................Passed
autoflake................................................................Passed
Reorder python imports...................................................Failed
- hook id: reorder-python-imports
- exit code: 1
- files were modified by this hook

Reordering imports in app/app/urls.py
Reordering imports in app/app/wsgi.py
Reordering imports in app/app/asgi.py
Reordering imports in app/app/settings.py

black....................................................................Failed
- hook id: black
- files were modified by this hook

reformatted app/app/asgi.py
reformatted app/app/wsgi.py
reformatted app/app/urls.py
reformatted app/app/settings.py

All done! ✨ 🍰 ✨
4 files reformatted, 216 files left unchanged.

reorder-python-imports seem to be removing an empty line between the leading comment and the first imports.

Capture d’écran 2024-03-19 à 10 44 19
asottile commented 3 months ago

yep, black decided to become incompatible on a whim. nothing that can be done here