chiyao
(Chi Yao)
October 9, 2021, 10:16am
1
Here is the log of git commit:
[INFO] Stashing unstaged files to /root/.cache/pre-commit/patch1633773739-48786.
pyupgrade................................................................Passed
black....................................................................Passed
codespell................................................................Passed
flake8...................................................................Passed
bandit...................................................................Passed
isort....................................................................Passed
Check JSON...............................................................Passed
Don't commit to branch...................................................Passed
yamllint.............................................(no files to check)Skipped
mypy.....................................................................Passed
gen_requirements_all.....................................................Passed
hassfest.................................................................Failed
- hook id: hassfest
- files were modified by this hook
Validating json... done in 0.00s
Validating codeowners... done in 0.00s
Validating config_flow... done in 0.46s
Validating dependencies... done in 21.49s
Validating manifest... done in 0.08s
Validating mqtt... done in 0.00s
Validating services... done in 9.48s
Validating ssdp... done in 0.00s
Validating translations... done in 4.37s
Validating zeroconf... done in 0.00s
Validating dhcp... done in 0.00s
Validating coverage... done in 2.07s
Validating mypy_config... done in 0.02s
Integrations: 1007
Invalid integrations: 0
[WARNING] Stashed changes conflicted with hook auto-fixes... Rolling back fixes...
[INFO] Restored changes from /root/.cache/pre-commit/patch1633773739-48786.
ludeeus
(Ludeeus)
October 13, 2021, 10:12am
3
Run hassfest python3 -m script.hassfest
chiyao
(Chi Yao)
October 25, 2021, 1:42am
4
Here is the output :
# python3 -m script.hassfest
Validating json... done in 0.00s
Validating codeowners... done in 0.02s
Validating config_flow... done in 1.31s
Validating dependencies... done in 36.01s
Validating manifest... done in 0.12s
Validating mqtt... done in 0.01s
Validating services... done in 25.04s
Validating ssdp... done in 0.01s
Validating translations... done in 11.54s
Validating zeroconf... done in 0.00s
Validating dhcp... done in 0.01s
Validating coverage... done in 3.69s
Validating mypy_config... done in 0.09s
Integrations: 1007
Invalid integrations: 0
chiyao
(Chi Yao)
October 27, 2021, 12:54am
5
@ludeeus Can you help me?
timsavage
(Tim Savage)
May 15, 2022, 4:46am
6
Just ran into this issue myself and here is what to do!
This occurs because the hassfest
script has modified a file that is not part of your current change-set. This is a little annoying as it’s really hard to tell what has changed when the output states everything is good.
Fortunately pre-commit
does have a way to help. Run the following command:
./script/run-in-env.sh pre-commit run --show-diff-on-failure
This will run the pre-commit commands but before pre-commit rolls back the GIT state a diff will be printed showing what was changed. In my case it was the CODEOWNERS
file. Add the additional file into your staged commit and the commit should pass successfully.
ihr
(Ignacio Hernandez-Ros)
February 12, 2023, 9:11am
7
I’m on the same page, I don’t know how to fix the don't commit to branch
issue. Any help will be appreciated!
ihr
(Ignacio Hernandez-Ros)
February 12, 2023, 9:30am
8
I don’t know exactly if what I did was “right”, but this is what I did:
I created a branch using git branch -c <my new branch name
I switched to my branch clicking on the “dev” name down left of vscode
I run git push origin HEAD
as suggested by a failed git push
I finally run git commit -m "my message"
to commit on my branch.
I’m not 100% sure what I did is correct, but I think I was able to save my work on a branch of HA core so I could do a PR later.
1 Like