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

options: disable ignore pragma #748

Merged
merged 1 commit into from
Dec 21, 2021

Commits on Dec 16, 2021

  1. options: disable ignore pragma

    - Add new configuration option allowing to disable inline ignore pragmas
    - Add new rule DL1001 to allow warning on use of an inline ignore pragma
    
    Inline ignore pragmas `# hadolint ignore=DLxxxx` can cause trouble in
    organizations when it is not desirable that individual developers
    circumvent centralized CI checks. This configuration options allows
    (e.g. in such a CI pipeline) to just ignore the pragma and apply all
    rules as usual. The option can be enabled via command line
    `--disable-ignore-pragma`, environment variable
    `HADOLINT_DISABLE_IGNORE_PRAGMA=1`, or config file
    ```yaml
    disable-ignore-pragma=true
    ```
    
    Just to prevent any confusion about the ignored pragma, the rule DL1001
    can be used to fail the linting process regardless of how the dockerfile
    fares, if desired. By default DL1001 is ignored but can be enabled by
    setting its severity to the desired level (e.g. via command line option
    `--warning=DL1001`).
    
    Changes in the test suite:
    
    - Add tests for `disable-ignore-pragma` options
    - Add tests for rule DL1001
    - Remove pointless configuration test for content of default
      configuration
    - Change configuration tests to a more compact syntax relying on the
      default instance
    
    By changing the manual construction of configuration values to utilize
    the default instance, future changes to the configuration do not
    necessitate many error prone changes to the test suite. This imporves
    reliability and ease of use of the configuration test suite.
    
    fixes: hadolint#747
    m-ildefons committed Dec 16, 2021
    Configuration menu
    Copy the full SHA
    22c9d24 View commit details
    Browse the repository at this point in the history