isort 手动 python 目录,然后无法推送到远程存储库

isort a python directory manually and then can't push to remote repository

我正在尝试将 isortblackflake8 添加到我的项目的 pre-commit 挂钩中,当我编辑一个文件时它工作正常。

我想要实现的是 isort 项目的一个目录 isort -rc . 并将更改推送到远程存储库但是它给了我 Everything up-to-date 但是当我检查 git status 它显示了所有修改。

谁能帮我弄清楚我做错了什么?下面是我 post 的屏幕截图和代码片段。谢谢!

•100% ➜ git 状态 在分支 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

因为 pre-commit 进行了更改,所以提交被取消(因为提交的内容不正确)

您需要查看所做的更改 (git status / git diff),如果工具所做的自动更改看起来正确,您将 git add -u 并重新-运行 你的 git commit 命令(^R + git commit 在这里可能会有帮助)

没有要推送的提交,因为提交已取消