Skip to content

govindsme/JenkinsfileLint

Repository files navigation

Branch main release GitHub license GitHub tag (latest by date) Files

JenkinsfileLint

This pre-commit hook uses nvuillam/npm-groovy-lint docker image for linting Jenkinsfile.

Table of Contents

Requirements

JenkinsfileLint requires the following to run:

Installation

  1. Please refer the list of available tags here
  2. create .pre-commit-config.yaml in your git project
  3. pre-commit install

A sample .pre-commit-config.yaml may look like the following:

- repo: https://github.com/govindsme/JenkinsfileLint
    rev: v1.3.0                                        # tag
    hooks:
      - id: JenkinsfileLinter
        args: ['Jenkinsfile']                           # name of the Jenkinsfile

You may require to add .groovylintrc.json to have the required exclusion

{
    "extends": "recommended-jenkinsfile",
    "rules": {
        "ignoreVariableNames": "off",
        "VariableName": {
            "severity": "info"
        }
    }
}

Contributing

To contribute to JenkinsfileLint, fork this repo and raise a pull request.

Author

GitHub @govindarajanv

License

pre-commit-shell is licensed under the MIT license.