Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Cannot use isort with pre-commit hook #224

Closed
wjdp opened this issue Oct 13, 2021 · 2 comments
Closed

Cannot use isort with pre-commit hook #224

wjdp opened this issue Oct 13, 2021 · 2 comments

Comments

@wjdp
Copy link
Contributor

wjdp commented Oct 13, 2021

Using a pre-commit config of

repos:
  - repo: https://github.com/akaihola/darker
    rev: 1.3.1
    hooks:
      - id: darker
        args: [--isort]

Yields:

$ pre-commit run
[WARNING] Unstaged files detected.
[INFO] Stashing unstaged files to /home/will/.cache/pre-commit/patch1634135700.
darker...................................................................Failed
- hook id: darker
- exit code: 1

Please run `pip install darker[isort]` to use the `--isort` option.

[INFO] Restored changes from /home/will/.cache/pre-commit/patch1634135700.

It seems darker[isort] is not installed in the environment that pre-commit creates for darker, is there a way to make this work?

@wjdp
Copy link
Contributor Author

wjdp commented Oct 13, 2021

Whoops, found the fix:

repos:
  - repo: https://github.com/akaihola/darker
    rev: 1.3.1
    hooks:
      - id: darker
        args: [--isort]
        additional_dependencies:
          - black~=21.8b0
          - isort~=5.9

Hopefully this helps others!

@wjdp wjdp closed this as completed Oct 13, 2021
@akaihola
Copy link
Owner

Thanks @wjdp for pointing this out! Is there something to improve in the documentation to help others not hit the same problem?

Repository owner locked and limited conversation to collaborators Mar 2, 2022
@akaihola akaihola converted this issue into discussion #321 Mar 2, 2022

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants