Skip to content
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

Rule: Exists #30

Closed
tobiastimm opened this issue Sep 15, 2020 · 12 comments · Fixed by #223
Closed

Rule: Exists #30

tobiastimm opened this issue Sep 15, 2020 · 12 comments · Fixed by #223
Assignees
Labels

Comments

@tobiastimm
Copy link

tobiastimm commented Sep 15, 2020

It would be cool if this would have a check to ensure that a directory/file exists!

@loeffel-io loeffel-io self-assigned this Sep 15, 2020
@loeffel-io loeffel-io mentioned this issue Sep 21, 2020
@loeffel-io
Copy link
Owner

How you would solve this in your config?

@loeffel-io loeffel-io mentioned this issue Dec 7, 2020
@tobiastimm
Copy link
Author

tobiastimm commented Dec 11, 2020

Would be cool to have something like

ls:
    packages/src:
        .dir: 
           name: /REGEX_PATTERN/
           exists: true

Pretty similar to how goss handles that

user:
  sshd:
    exists: true
    uid: 74
    gid: 74
    groups:
    - sshd
    home: /var/empty/sshd
    shell: /sbin/nologin

@loeffel-io
Copy link
Owner

Yeah, thats what i also thought about 👍

@piotrpalek
Copy link

piotrpalek commented Apr 7, 2022

just making sure, would this be the same thing as having "file structure validation", something like what: https://github.com/denisraslov/folderslint does?

edit: also would it be possible to mark a directory as "doesn't accept new files"? like I sometimes want to do migrations in projects and mark some path as "legacy", so that people don't add new files there, while I can't yet move all old files to some new place

@Asuza
Copy link

Asuza commented Jul 28, 2022

I was just wondering if this feature is still on the table? This is exactly what I need to ensure some yarn files don't accidentally get removed.

@loeffel-io
Copy link
Owner

still on the table - prs are welcome!

@arei
Copy link

arei commented Jun 23, 2023

+1

@ccoVeille
Copy link

For anyone interested. You can now use exists:1 as a rule. Please check the documentation

@loeffel-io
Copy link
Owner

@ccoVeille v2.3.0 is not released yet - there is one single piece that is missing

@ccoVeille
Copy link

Author opened the issue 4 years ago. I assumed he could wait a few more days/week.

But you are right, it's not yet available or documented

@loeffel-io
Copy link
Owner

As far i can tell this is one of the most challenging tasks for me - its beautiful how wildcard extensions, selected files and exists working together magically

@loeffel-io
Copy link
Owner

This feature is now available in the v2.3.0-beta.1 release.
Please test it and let me know if there are any issues ❤️

The upcoming v2.3.0 blog post: https://ls-lint.org/blog/announcements/v2.3.0.html
The docs: https://ls-lint.org/2.3/getting-started/introduction.html
The release notes: https://github.com/loeffel-io/ls-lint/releases/tag/v2.3.0-beta.1

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 a pull request may close this issue.

6 participants