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

Add parsing of ignore directives #67

Merged
merged 1 commit into from
Mar 30, 2023
Merged

Add parsing of ignore directives #67

merged 1 commit into from
Mar 30, 2023

Conversation

anderseknert
Copy link
Member

It is now possible to add an "ignore directive" above any line of Rego, to have Regal ignore the next line given that the
rule(s) named in the directive match that of the linter being executed. Example:

# regal ignore:prefer-snake-case,use-assignment-operator
default fooBar = "baz"

Note that this only works for the next line, and does not take into account concepts like packages, functions or rules. But this should be good enough for most use cases, I think.

Resolves #39

It is now possible to add an "ignore directive" above any
line of Rego, to have Regal ignore the next line given that the
rule(s) named in the directive match that of the linter being
executed. Example:

```rego
\# regal ignore:prefer-snake-case,use-assignment-operator
default fooBar = "baz"
```

Note that this only works for the next _line_, and does not take
into account concepts like packages, functions or rules. But this
should be good enough for most use cases, I think.

Resolves #39

Signed-off-by: Anders Eknert <anders@styra.com>
Copy link
Member

@charlieegan3 charlieegan3 left a comment

Choose a reason for hiding this comment

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

👏

@anderseknert anderseknert merged commit 70de700 into main Mar 30, 2023
@anderseknert anderseknert deleted the ignore-directive branch March 30, 2023 12:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ignore options
2 participants