This pre-commit hook uses nvuillam/npm-groovy-lint docker image for linting Jenkinsfile.
JenkinsfileLint requires the following to run:
- Please refer the list of available tags here
- create .pre-commit-config.yaml in your git project
- 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"
}
}
}
To contribute to JenkinsfileLint, fork this repo and raise a pull request.
GitHub @govindarajanv
pre-commit-shell is licensed under the MIT license.