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

Ability to supply "Severity" levels for rules #174

Open
amthorn opened this issue Apr 10, 2021 · 0 comments
Open

Ability to supply "Severity" levels for rules #174

amthorn opened this issue Apr 10, 2021 · 0 comments

Comments

@amthorn
Copy link

amthorn commented Apr 10, 2021

Running in CI pipelines typically uses the exit code to determine if a step has failed. In some cases, some rules from dockerfilelint may be permissable by some projects. Thus, dockerfilelint should expose in it's RC file the ability to specify a severity level (Similar to eslint perhaps) instead of just a boolean "on/off". This way, variations of rules can be configured for individual use cases.

Perhaps something like:

rules:
  uppercase_commands: "ERROR"
  expose_port_valid: "WARNING"
  label_format: "INFO"
  base_image_tag: on

If issues are found of severity level INFO/WARNING, then this should keep the exit code at 0. However, if at least one issue is found that has a severity level of error, the exit code should be > 0.

The default severity level, if not provided or using the old "on/off" syntax, should be ERROR to maintain backward compatibility.

I've solved this issue in my fork here: https://github.com/amthorn/dockerfilelint/tree/specify_severity

I'll submit a PR as soon as #172 is reviewed/merged as there is a dependency on that PR. Here's the diff: amthorn/dockerfilelint@add_custom_rulesets...amthorn:specify_severity

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

No branches or pull requests

1 participant