Skip to content

feat: allow specifying individual files and directories - #215

Merged
loeffel-io merged 2 commits into
masterfrom
feature/loeffel-io/187-lint-individual-files
Mar 24, 2024
Merged

feat: allow specifying individual files and directories#215
loeffel-io merged 2 commits into
masterfrom
feature/loeffel-io/187-lint-individual-files

Conversation

@loeffel-io

@loeffel-io loeffel-io commented Mar 24, 2024

Copy link
Copy Markdown
Owner

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

@loeffel-io loeffel-io self-assigned this Mar 24, 2024
@loeffel-io loeffel-io changed the title feat: allow specifing individual files feat: allow specifing individual files and directories Mar 24, 2024
@loeffel-io loeffel-io changed the title feat: allow specifing individual files and directories feat: allow specifying individual files and directories Mar 24, 2024
@loeffel-io
loeffel-io merged commit e1a93d0 into master Mar 24, 2024
@loeffel-io
loeffel-io deleted the feature/loeffel-io/187-lint-individual-files branch March 24, 2024 16:30
Comment thread cmd/ls_lint/main.go
for _, file := range args {
var fileInfo os.FileInfo
if fileInfo, err = os.Stat(fmt.Sprintf("%s/%s", *flagWorkdir, file)); err != nil {
log.Fatal(err)

@unrevised6419 unrevised6419 Apr 5, 2025

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FR: lint individual files ls-lint with lint-staged, the global code is executed

2 participants