Skip to content
Jenkinsfile Lint
On this page

Jenkinsfile Lint#

Catch Jenkinsfile syntax errors before they break your CI.

jenkinsfilelint checks your Declarative Pipeline syntax offline, with no Jenkins at all, or with your Jenkins's own validator (/pipeline-model-converter/validate) when you configure one. It's primarily a pre-commit hook, but also works as a standalone CLI tool.

đź“– Read the official blog post for the story behind this tool.

Quick Start#

pip install jenkinsfilelint
jenkinsfilelint Jenkinsfile
jenkinsfilelint .          # every Jenkinsfile in this directory
jenkinsfilelint --audit .  # and look for security problems

That works as is: with no Jenkins server configured, files are checked offline. Then add the pre-commit hook (see Pre-commit hook) or keep using the CLI.

Security audit rules#

RuleSeverityConfidencePersona
script-injectionA pull request title, branch name, webhook payload or build parameter interpolated by Groovy into a shell stephigh, mediumhighregular
secret-interpolationA secret interpolated by Groovy into a shell stephighhighregular
controller-executionSteps that run on the Jenkins controller: agent { label 'built-in' }, node('master')highhigh, mediumregular
unpinned-libraryA shared library loaded from a branch: @Library('lib@main') _mediummediumregular
unpinned-imageA container image without a tag, with latest, or without a digestmedium, lowhighregular, pedantic
unrestricted-inputAn input without submitter, which any user may approve (pedantic)mediumhighpedantic

Demo#

demo

Esc
↵ to open ↑↓ to move Esc to close
Keyboard shortcuts
Ctrl K /
Open search and commands
t
Toggle dark mode
[ ]
Previous / next page
j k
Previous / next heading
?
Show this help