-
-
Notifications
You must be signed in to change notification settings - Fork 29.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pre-commit hook stuck in a file formatting loop #45318
Comments
The pre-commit-config.yaml should include the following args for isort: - repo: https://github.com/PyCQA/isort
rev: 5.5.3
hooks:
- id: isort
args:
- --profile
- black https://pycqa.github.io/isort/docs/configuration/black_compatibility/ |
mduran80
added a commit
to mduran80/core
that referenced
this issue
Jan 19, 2021
The pre-commit hook gets stuck in a file formatting loop where black and isort modify each other results. According to the isort webpage, the option --profile black has to be used to enhance compatibility. This has been run successfully in my local and has solved the loop. See: home-assistant#45318 home-assistant#45314
21 tasks
cgarwood
pushed a commit
that referenced
this issue
Jan 20, 2021
…ck (#45321) The pre-commit hook gets stuck in a file formatting loop where black and isort modify each other results. According to the isort webpage, the option --profile black has to be used to enhance compatibility. This has been run successfully in my local and has solved the loop. See: #45318 #45314
This was referenced Jan 20, 2021
Closed
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
The problem
I am trying to upload a new integration for Daikin Madoka thermostats but the pre-commit hook is stuck in a loop where either "black" or "isort" always fail as both try to update the file and the exit code is interpreted as an error. I have tried to modify the imports or reduce them without any success.
Please find attached one of the files that fails. Run "black init.py" and then "isort __init__py" and again "black init.py". The files are always changed so the pre-commit hook fails.
This is the failing pull-request:
#45314
init.py.zip
I have disabled the isort job in my local environment, but it is run anyway when uploading to github.
Environment
Problem-relevant
configuration.yaml
Traceback/Error logs
Additional information
The text was updated successfully, but these errors were encountered: