feat: allow specifying individual files and directories - #215
Merged
Conversation
| for _, file := range args { | ||
| var fileInfo os.FileInfo | ||
| if fileInfo, err = os.Stat(fmt.Sprintf("%s/%s", *flagWorkdir, file)); err != nil { | ||
| log.Fatal(err) |
There was a problem hiding this comment.
Hey @loeffel-io, I have a question.
Don't we miss here exitCode = 1? 🤔 (I would try a fix, but no familiar with Go)
When using with lint-staged, ls-lint it seems to run, but lint-staged does not fail. (it fails if exit code is not 0)
✔ Backed up original state in git stash (b0ca25a)
✔ Running tasks for staged files...
✔ Applying modifications from tasks...
✔ Cleaning up temporary files...
→ echo TEST; ls-lint:
TEST; ls-lint /Users/luca/Projects/test-ls/src/CamelCase.ts
[main 2c30359] chore: test
6 files changed, 36 insertions(+), 3 deletions(-)
create mode 100644 .ls-lint.yml
create mode 100644 src/CamelCase.ts
Running ls-lint manually seems to work fine.
src/CamelCase.ts failed for `.*` rules: kebabcase
.ls-lint.yml
ls:
.d.ts: kebab-case
src:
.*: kebab-case
ignore:
- .git
- node_modules
- .next
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.
allow specifying individual files and directories
this mocks a filesystem to speed up the walk process
all specified files and directories must exists
close #187
close #135