Skip to content
jenkins-lint
On this page

jenkins-lint#

Catch Jenkinsfile mistakes and security problems before they reach your CI.

jenkins-lint checks Jenkinsfiles and shared library files offline, in milliseconds, with no Jenkins, Docker or JVM: Groovy syntax and Declarative Pipeline structure, with the wording of Jenkins's own validator, and security problems such as secrets and pull request titles interpolated into shell steps, with fixes. --remote also validates the files with your Jenkins, which knows its plugins. It is one small binary, for pre-commit, CI and the command line.

Note

Formerly jenkinsfilelint: see Migrating to 2.0.

Quick Start#

pip install jenkins-lint
jenkins-lint Jenkinsfile  # syntax, Declarative structure and security
jenkins-lint .            # every Jenkinsfile and shared library file here

That works as is: files are checked offline, and --remote also checks them with your own Jenkins. Then add the pre-commit hook (see Pre-commit hook) or keep using the CLI.

Security rules#

RuleSeverityConfidencePersonaFix
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