I have the following structure for my project:
project/
├── backend
│ ├── api_v1
│ ├── api_v2
│ └── api_v3
└── frontend
Each of the API dirs, api_v1, api_v2, and api_v3, have python files.
I would like to run pre-commit for each of these directories only if there is a change in the code. For eg., I would like to run mypy -p api_v1 if there is a change in the directory api_v1. I'm aware of the keys files and types of the pre-commit, but I cannot figure out a way to run mypy as if it was running from the directory backend. Also, I cannot run mypy separately for api_v1, api_v2, or api_v3, when I have changes in more than 1 of these directories.
Is it not possible or am