[Feature request] Support for checking files instead of directories #947
Comments
@egonm12 hi, there was no plans to support analysing specific files, can you add more details why passing a folder doesn't work for you? |
@incendial Let's suppose I only commit 3 out of 4 files that have a change and that fourth file has some issues raised by DCM. In such a case, I only want to run DCM on the files that I am committing and not on the ones that are not part of the commit. In the current situation, the commit will fail on the pre-commit hook since you can not specify which files it should run on, and there is a chance that those files are in the same directory. Same thing works with
|
So you mean that the tool will select changed files to {staged_files} and then pass them to the DCM? |
@incendial exactly! |
@incendial everything seems to work as expected, nice! The only problem I am facing now is the verbose output. It prints all files that you are analyzing when you select entire directories now. For e.g. when I do run it on the
|
@egonm12 thanks, that's a
Happy to hear that! |
Available in 4.18.0 🚀 |
I am using Lefthook so I can run some pre-commit commands. I've also added a rule for DCM but I am unable to run it on individual files:
lefthook.yml
Output:
Is this something that will be supported in any future updates?
The text was updated successfully, but these errors were encountered: