git: pre-commit-hook: python + nodejs: How to configure

Viewed 141

I have project with python and reactjs.

Project_folder
--Django_project
--Reactjs_project
--.git

I want to use pre-commit hooks for git using flake8 and black for my python project.

In this case how to tell git to check pre-commit hook only for python project.

1 Answers

You could use one of the pre-commit configurations, like exclude, as seen for flake8.

In your case:

-   id: myProject
    exclude: ^Reactjs_project/

Replace 'myProject' by the id you have used for declaring pre-commit.

Related