Open VinceBroAmilia opened 3 days ago
Hello @VinceBroAmilia, I will investigate this as soon as I have some free time. Currently, my schedule is quite full. I believe this issue might be addressed by Husky, so I am treating it as a bug for the time being. Thank you for your feedback.
Thank you @alirezanet
Version
Seen on
v0.6.4
tov0.7.1
Details
So I am trying to run csharpier as a pre commit hook and support formatting files which have been renamed in git, I opted for using a custom variable that was inspired by the
${staged}
variable in the husky code.I noticed that the formatting changes only appear post commit, unstaged.
When I use this instead :
It adds the formatting to the commit as is expected with a pre commit hook.
Even when I set the variable to the exact same as in the code for the
${staged}
variable using--diff-filter=AM
it does not have the same behavior, it does not add the formatting changes to the commit.Wondering if this is expected behavior with custom variables or if this is a bug.
Steps to reproduce
Set task runner json with a variable in the csharpier task, with husky running it a pre-commit hook :
Take a
.cs
file, change the formatting so it triggers csharpier, add it, commit it. The formatting will not be included in the commit, but will be an unstaged change after the commit, not the case when using${staged}