4 ms·
This looks very interesting, but I have a question: how to deal with multiple independent projects in the same repo? Say I have projects A, B, and C, and I made
by maleldil 5y ago
This looks very interesting, but I have a question: how to deal with multiple independent projects in the same repo? Say I have projects A, B, and C, and I made a change to a file in C. How can I make mypy run inside C only? The command would be `mypy C` from the repo root, but how can I configure pre-commit to do that?
This question also applies to GitHub Actions, which is something I'd like to implement too.
- mwt 5y agoYou can point a hook towards a specific path, i.e. adding `files: ^C` to a hook will cause it to only run on the path of project/path C. There's also `exclude: ` to do to the opposite and other ways to customize each hook with granularity. https://pre-commit.com/#pre-commit-configyaml---hooks https://pre-commit.com/#pre-commit-configyaml---hooks
- maleldil 5y agoThis works, thanks. I had to set up one mypy hook for each project, however. Is there a better way?