loeffel-io / ls-lint

An extremely fast directory and filename linter - Bring some structure to your project filesystem
https://ls-lint.org
MIT License
1.74k stars 32 forks source link

Exists Check on Glob (*) Directory Pattern #249

Open sdford opened 3 months ago

sdford commented 3 months ago

Hi @loeffel-io, I am testing out the exists feature in 2.3.0-beta.1 (Darwin arm64). I want to make sure there exists a directory bar/ under every subdirectory in foo/.

The following passes the linter successfully, where instead I would expect an error.

.ls-lint.yml:

---
ls:
  foo/*/bar:
    .dir: exists

Filesystem (foo/example/bar does not exist):

foo/
foo/example/
foo/example/baz/

The following returns an error (as expected):

.ls-lint.yml:

---
ls:
  foo/example/bar:
    .dir: exists

output:

foo/example/bar failed for `.dir` rules: exists:1-32767 (debug: 0)
loeffel-io commented 3 months ago

thank you for the report @sdford ❤️

I will check this