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
fix: --no-stash
flag implies --no-hide-partially-staged
#1294
Conversation
Thanks for the PR! I'll need to have a closer look, but could this commit message be reworded as a
|
--no-hide-partially-staged
flag, and imply it by --no-stash
flag--no-stash
flag implies --no-hide-partially-staged
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #1294 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 26 26
Lines 740 753 +13
Branches 198 208 +10
=========================================
+ Hits 740 753 +13
☔ View full report in Codecov by Sentry. |
The new non-cli code needs some test coverage. |
hidePartiallyStaged: | ||
cliOptions.hidePartiallyStaged == null ? !!cliOptions.stash : !!cliOptions.hidePartiallyStaged, // commander inverts `no-<x>` flags to `!x` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can the flag be null
or is only ever undefined
? It would be nice to use strict equality ===
if possible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, would this be equivalent to:
hidePartiallyStaged: | |
cliOptions.hidePartiallyStaged == null ? !!cliOptions.stash : !!cliOptions.hidePartiallyStaged, // commander inverts `no-<x>` flags to `!x` | |
hidePartiallyStaged: | |
cliOptions.hidePartiallyStaged ?? !!cliOptions.stash, // commander inverts `no-<x>` flags to `!x` |
Can you rebase this after merging #1303? |
Are for you número mega sena python |
I don't have permissions to update to this PR so I forked it locally: #1371 |
@iiroj Sorry for leaving this PR idle for so long, I think I missed the notifications of activity on it. |
No problem, and thanks for the fix @giladgd. Unfortunately the automatic release notes will "thank" me instead of you, because it apparently looks at the PR author instead of the commit author. Oh well, at least the commit is attributed to you. 👍 |
Changes
lint-staged
from hiding unstaged changes of partially staged files by using the new flag--no-hide-partially-staged
--no-stash
flag imply--no-hide-partially-staged
Description
Currently, when using the
--no-stash
flag,lint-staged
discards all the unstaged changes to partially staged files, which results in unknowingly losing unstaged changes permanently.Disabling that behavior by default will prevent that from happening without explicit consent.