Skip to content
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

"Files were modified by this hook" but no files is modified in git status #831

Closed
rdbisme opened this issue Sep 25, 2023 · 1 comment
Closed

Comments

@rdbisme
Copy link

rdbisme commented Sep 25, 2023

Hello,
I have configured nbQA with pre-commit.

  - repo: https://github.com/nbQA-dev/nbQA
    rev: 1.7.0
    hooks:
      - id: nbqa-black
        additional_dependencies: [jupytext, black] # optional, only if you're using Jupytext
      - id: nbqa-isort
        additional_dependencies: [jupytext, isort] # optional, only if you're using Jupytext 

when I run pre-commit run --all-files it tells me that some files have been modified (so it fails), but I can't find the files in the tree. git status returns a clean tree.

Any idea on how to debug?

check yaml...............................................................Passed
check json...........................................(no files to check)Skipped
trim trailing whitespace.................................................Passed
fix end of files.........................................................Passed
check for added large files..............................................Passed
debug statements (python)................................................Passed
nbqa-black...............................................................Failed
- hook id: nbqa-black
- files were modified by this hook

reformatted docs/runbooks/get_email.md
reformatted docs/runbooks/obtain_correlation_table.md
reformatted docs/runbooks/rebackfill.md

All done! ✨ 🍰 ✨
3 files reformatted, 6 files left unchanged.

nbqa-isort...............................................................Failed
- hook id: nbqa-isort
- files were modified by this hook

Fixing /home/rxxxxxx/git/internal-docs/docs/runbooks/get_email.md
Fixing /home/rxxxxxx/git/internal-docs/docs/runbooks/obtain_correlation_table.md
Fixing /home/rxxxxxx/git/internal-docs/docs/runbooks/rebackfill.md
@rdbisme
Copy link
Author

rdbisme commented Sep 25, 2023

Ok, the problem was conflicts between isort and black. Needed to add args: [--profile=black].

@rdbisme rdbisme closed this as completed Sep 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant