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

Include *.sls files #826

Closed
fauust opened this issue Sep 13, 2018 · 3 comments
Closed

Include *.sls files #826

fauust opened this issue Sep 13, 2018 · 3 comments
Labels

Comments

@fauust
Copy link

fauust commented Sep 13, 2018

Hi,
is there a way to include other files extension?
I am thinking on saltstack sls files that also use yaml.

Is the following wrong?

- repo: https://github.com/adrienverge/yamllint.git
    sha: v1.11.1
    hooks:
      - id: yamllint
        files: \.(yaml|yml|sls)$
@asottile
Copy link
Member

saltstack files aren't quite yaml though you could lint them as such (they're jinja templated yaml)

yamllint uses types to select filenames. types and files are ANDed.

There was some discussion on identify about identifying .sls files as yaml, but instead we made a new type for them.

Note also that types: [yaml, salt] won't work (that'll never match anything) because types is also evaluated with AND. When types_or becomes a thing then that'll be possible with type filtering.

The answer to how you can do what you want is to override the base types:

    -   id: yamllint
        types: [file]
        files: \.(yaml|yml|sls)$

@fauust
Copy link
Author

fauust commented Sep 13, 2018

Excellent!
Thank you.

@asottile
Copy link
Member

Cheers! Thanks for the issue 🎉

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

No branches or pull requests

2 participants