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

Document how to check multiple requirements with pre-commit hooks #1335

Closed
atugushev opened this issue Mar 1, 2021 · 3 comments · Fixed by #1387
Closed

Document how to check multiple requirements with pre-commit hooks #1335

atugushev opened this issue Mar 1, 2021 · 3 comments · Fixed by #1387
Assignees
Labels
docs Documentation related good first issue A good item for first time contributors to work on help wanted Request help from the community pre-commit Related to pre-commit hook

Comments

@atugushev
Copy link
Member

Thanks for the issue! You should use a separate hook for each input requirement file, for example:

repos:
-   repo: https://github.com/jazzband/pip-tools
    rev: 5.3.1
    hooks:
      - id: pip-compile
        name: pip-compile setup.py
        files: ^setup\.py$
      - id: pip-compile
        name: pip-compile requirements-dev.in
        args: [requirements-dev.in]
        files: ^requirements-dev\.(in|txt)$
      - id: pip-compile
        name: pip-compile requirements-lint.in
        args: [requirements-lint.in]
        files: ^requirements-lint\.(in|txt)$

Would it be possible to add this somewhere in the documentation? I wasn't familiar at all with how pre-commit really worked so it took some digging until I realized that even if the pattern matches for files we would still need to feed the names in individually for each requirements file for it to work as intended.

Originally posted by @seanytak in #1208 (comment)

@atugushev atugushev added docs Documentation related good first issue A good item for first time contributors to work on labels Mar 1, 2021
@atugushev atugushev changed the title Document how to check multiple requirements with pre-commit Document how to check multiple requirements with pre-commit hooks Mar 1, 2021
@atugushev atugushev added pre-commit Related to pre-commit hook help wanted Request help from the community labels Mar 1, 2021
@microcat49
Copy link
Contributor

Hey @atugushev,

Do you mind if I take this one?

@atugushev
Copy link
Member Author

Hello @microcat49,

Please, feel free to 👍🏻

@microcat49
Copy link
Contributor

Pull request #1387

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation related good first issue A good item for first time contributors to work on help wanted Request help from the community pre-commit Related to pre-commit hook
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants