You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using pretty-quick to just check the contents of the commit in a precommit hook and fail if there are any issues without formatting/staging anything. It works well and fast, but my problem is it checks the contents of the file as it exists in the filesystem. If I have some staged changes that are not formatted correctly, but also have the file formatted correctly as unstaged, the check succeeds as it reads the file from the filesystem, thus allowing to create a commit that will not pass validation on the CI.
The text was updated successfully, but these errors were encountered:
I have the opposite behavior: Valid staged changes are not accepted since apparently the working directory is checked instead of the index.
To summarize: I think the "--staged"-flag doesn't work currently and creates both, false-positives and false-negatives.
Edit: My false-negatives seem to be an issue with partial staging only. Ping me in case you need further details. Maybe only the documentation needs an update on how it interacts with partially staged files (or I repeatedly read it wrong).
If there is no intent to just format the staged content, I think it would help to be more explicit in the documentation (README.md) about partially staged files treatment. Now that I actually understood what is happening, I can see that this is described. But I also believe that my prior confusion is not unjustified.
Hi,
I'm using pretty-quick to just check the contents of the commit in a precommit hook and fail if there are any issues without formatting/staging anything. It works well and fast, but my problem is it checks the contents of the file as it exists in the filesystem. If I have some staged changes that are not formatted correctly, but also have the file formatted correctly as unstaged, the check succeeds as it reads the file from the filesystem, thus allowing to create a commit that will not pass validation on the CI.
The text was updated successfully, but these errors were encountered: