Fix ignore behavior for --stdin-filepath#495
Merged
JohnnyMorganz merged 1 commit intoJohnnyMorganz:masterfrom Jul 21, 2022
Merged
Fix ignore behavior for --stdin-filepath#495JohnnyMorganz merged 1 commit intoJohnnyMorganz:masterfrom
JohnnyMorganz merged 1 commit intoJohnnyMorganz:masterfrom
Conversation
JohnnyMorganz
requested changes
Jul 20, 2022
0745ff2 to
31f4343
Compare
Codecov Report
@@ Coverage Diff @@
## master #495 +/- ##
=======================================
Coverage 97.66% 97.66%
=======================================
Files 14 14
Lines 5346 5346
=======================================
Hits 5221 5221
Misses 125 125 Continue to review full report at Codecov.
|
d862981 to
cc15dad
Compare
11a817b to
d394e5f
Compare
d394e5f to
c7abd06
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Current Behavior
When the
.styluaignorefile contains:And
styluais run like this:cat /home/user/lua-project/ignored_file.lua | stylua --search-parent-directories --stdin-filepath /home/user/lua-project/ignored_file.lua -StyLua still formats the code.
Expected Behavior
When
--stdin-filepathis provided, it should respect the.styluaignorerules even if the code is read from stdin.For reference, Prettier respects the ignore file when
--stdin-filepathis provided.Usecase
Editor plugins depend on this behavior. For example,
null-ls.vimis broken forstyluabecause of this bug... even if a file is ignored in.styluaignore, the file is unexpectedly formatted on save.