我正在尝试将isort
,添加black
到flake8
我的项目的pre-commit
挂钩中,当我编辑一个文件时它可以正常工作。
我想要实现isort
的是项目的一个目录isort -rc .
并将更改推送到远程存储库,但它给了我Everything up-to-date
,但是当我检查git status
它时,它会显示所有修改。
有人可以帮助弄清楚我做错了什么吗?下面我发布屏幕截图和代码片段。谢谢!
•100% ➜ git status 在分支 2020-01-29-test-pre-commit 你的分支是最新的'origin/2020-01-29-test-pre-commit'。
Changes to be committed:
(use "git restore --staged <file>..." to unstage)
modified: athlete_report/algorithm/yazs/cc_calculation_copy.py
modified: athlete_report/algorithm/yazs/dto/session_event.py
modified: athlete_report/algorithm/yazs/formula/flow_processor.py
modified: athlete_report/algorithm/yazs/input/flow_input_processor.py
modified: athlete_report/algorithm/yazs/input/single_source_handler.py
modified: athlete_report/algorithm/yazs/input/two_sources_handler.py
modified: athlete_report/algorithm/yazs/vertical_jump/vert_jump.py
modified: athlete_report/algorithm/yazs/yazs_calculation.py
modified: athlete_report/pdf_generator/athlete_report_builder.py
(mbp37)
src on 2020-01-29-test-pre-commit [+] via mbp37
•100% ➜ git add .
(mbp37)
src on 2020-01-29-test-pre-commit [+] via mbp37
•100% ➜ git commit -am "add modifications to athlete report"
seed isort known_third_party.............................................Passed
isort....................................................................Failed
- hook id: isort
- files were modified by this hook
Fixing /Users/hzhang/Work/yana-motion-lab/report-engine/src/athlete_report/pdf_generator/athlete_report_builder.py
black....................................................................Failed
- hook id: black
- files were modified by this hook
reformatted /Users/hzhang/Work/yana-motion-lab/report-engine/src/athlete_report/pdf_generator/athlete_report_builder.py
All done! ✨ ✨
1 file reformatted, 8 files left unchanged.
Flake8...................................................................Passed
(mbp37)
src on 2020-01-29-test-pre-commit [+] via mbp37 took 3s
•100% ➜ git diff
(mbp37)
src on 2020-01-29-test-pre-commit [+] via mbp37
•100% ➜ git push
Everything up-to-date
(mbp37)
src on 2020-01-29-test-pre-commit [+] via mbp37 took 2s
•100% ➜ git diff