New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lint-staged stringifies my commands, changing their meaning (and breaking them) #539
Comments
I think I see what the problem is: lint-staged is not handling In npm, args can only be passed in by explicitly using
The However, it seems that lint-staged is assuming it works like this:
without requiring the |
Just an idea, but instead of adding |
Yeah thanks. That’s a good catch and we should fix it |
This is messing up trying to integrate |
I think no one noticed this
|
Please come up with a fix and submit a PR |
Tests are located in |
Does anyone want to take this one? |
now i think only about one solving. It split cmd string by && and || and then use something like reverse polsky notation(in case with |
We removed this handling in one of the breaking releases so it's now should be done explicitly AFAIK.
We're using https://github.com/mccormicka/string-argv to parse arguments. Probably it has an issue? We'd need a better test suite for all corner cases in order to fix it. Anyone a PR? |
Here is the appropriate test: https://github.com/okonet/lint-staged/blob/ac8cdf19b6c5cd1664a8ab428735e84d2e2fcd92/test/findBin.spec.js#L41-L55 |
Be aware of the fact we rely on this to be true:
|
I think there's something wrong with using |
We could try with execa's |
Can we verify and close this? |
According to #640 (comment), at least the command parsing has been improved somewhat. If @trusktr can verify that it now works, we can close this issue. |
I'll close this due to inactivity. @trusktr if it still doesn't work, let's reopen and investigate. |
For example, I have the following in package.json:
and it doesn't work because lint-staged converts into this:
As you can see there, some parts of the command are wrapped with
""
, which causes those parts to be treated as arguments rather than interpreted by the shell.It would be nice if you could fix this. I've already ran into in a few times, and as a result have to find some other way to write it.
The text was updated successfully, but these errors were encountered: