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

Feature Request: ignore rules per file #48

Closed
roaldnefs opened this issue Oct 12, 2019 · 1 comment
Closed

Feature Request: ignore rules per file #48

roaldnefs opened this issue Oct 12, 2019 · 1 comment
Assignees
Labels

Comments

@roaldnefs
Copy link
Member

Preface

As @myii suggests on Slack, it would be useful to have to option to ignore rules per file:

Having the ability to ignore rules per file would be really useful. We're using that with yamllint.

So here's a sample configuration:

---
# Extend the `default` configuration provided by `yamllint`
extends: default

# Files to ignore completely
# 1. All YAML files under directory `node_modules/`, introduced during the Travis run
# 2. Any SLS files under directory `test/`, which are actually state files
# 3. Any YAML files under directory `.kitchen/`, introduced during local testing
ignore: |
  node_modules/
  test/**/states/**/*.sls
  .kitchen/

rules:
  commas:
    # Allow separation between commas to achieve tabular layout under `platforms`
    ignore: |
      ssf/defaults.yaml
      ssf/formulas.yaml

Description

Add to option to ignore rules per file (using the .salt-lint configuration file) like yamllint is doing.

@roaldnefs roaldnefs added Type: Enhancement New feature or request Hacktoberfest labels Oct 12, 2019
@roaldnefs roaldnefs self-assigned this Oct 12, 2019
@myii
Copy link
Contributor

myii commented Oct 12, 2019

@roaldnefs If the yamllint format doesn't suit you, have a look at how Flake8 does it as well.

myii pushed a commit to myii/salt-lint that referenced this issue Oct 22, 2019
Add configuration option to ignore rules per file, e.g.:

```yaml
---
rules:
  formatting:
    ignore: |
      first.sls
      second.sls
  210:
    ignore: |
      state/*.sls
      *.jinja
```

Fixes warpnet#48.

Signed-off-by: Roald Nefs <roald@warpnet.nl>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants