-
Hi! Thank you for this incredible tool. ✅ release or Git commit for the version of Darker you're using: 1.4.1 A friend and I are struggling to get the pre-commit hook working. We use pre-commit in two places:
We're seeing this error when we run
And here is our hook: - repo: https://github.com/jabracadabrah/darker
rev: 1.4.1 # version of darker
hooks:
# fail if black, pylint, flake8, isort, or pydocstyle find errors in the 'git --diff'
# between this branch and latest commit on 'trunk'; this is great because it does not require
# contributors to make changes to parts of the codebase they didn't change. Said otherwise:
# if you submit a PR, the build will only fail if the code *you* wrote/changed does not
# satisfy these quality check tools, but if there were already issues in the codebase before
# you got there, the build will still pass and your PR can go through.
- id: darker
args:
- --revision trunk
- --isort
- -L flake8
- -L pylint
- -L pydocstyle
- --verbose
additional_dependencies:
- isort~=5.9
- flake8~=4.0
- pylint~=2.12
- pydocstyle~=6.1 We're running this using GitHub Actions in this repo. Could it be that the This question may be an example of clinging to a particular solution when we should be focusing on the original problem. Is there a recommended way to use Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Got this resolved. The default entrypoint for the |
Beta Was this translation helpful? Give feedback.
-
Hi @phitoduck, thanks for your issue report and also thanks for taking the effort to post your solution! As documentation for
It's a bit unclear to me why that default mode of operation doesn't work for you. It would be nice to figure that out so we can make sure the defaults make sense and that the documentation is sufficient. I'd be grateful if you can point us to where the documentation might have misguided you. Be sure to check out the extensive discussion on this feature in #113. Maybe @rossbar, @tkolleh or @philipgian have insight into what's happening in your particular use case. But glad you got it sorted out! And thanks for your kind words – I should also acknowledge all the contributions from other people who have joined the effort for this tool along the way. You may want to look into using |
Beta Was this translation helpful? Give feedback.
Got this resolved. The default entrypoint for the
darker
pre-commit hook isdarker --revision :PRE-COMMIT:
. We just needed to override that in this file withdarker --revision trunk
. Simple as that :)