Metadata-Version: 2.4
Name: jenkinsfilelint
Version: 1.7.2
Summary: A Jenkinsfile linter that validates Jenkinsfiles using Jenkins API, or offline without a Jenkins server
Author-email: Xianpeng Shen <xianpeng.shen@gmail.com>
License: MIT
Project-URL: Homepage, https://github.com/jenkinsci/jenkinsfilelint
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: requests
Requires-Dist: jenkinsfilelint-engine==0.3.1; (sys_platform == "linux" and (platform_machine == "x86_64" or platform_machine == "aarch64" or platform_machine == "i686" or platform_machine == "armv7l")) or (sys_platform == "darwin" and (platform_machine == "x86_64" or platform_machine == "arm64")) or (sys_platform == "win32" and (platform_machine == "AMD64" or platform_machine == "x86"))
Provides-Extra: dev
Requires-Dist: pre-commit; extra == "dev"
Requires-Dist: pytest>=7.0.0; extra == "dev"
Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
Dynamic: license-file

# Jenkinsfile Lint

[![CI](https://github.com/jenkinsci/jenkinsfilelint/actions/workflows/main.yml/badge.svg)](https://github.com/jenkinsci/jenkinsfilelint/actions/workflows/main.yml)
[![codecov](https://codecov.io/gh/jenkinsci/jenkinsfilelint/graph/badge.svg?token=nGrwXORFtI)](https://codecov.io/gh/jenkinsci/jenkinsfilelint)
[![PyPI version](https://img.shields.io/pypi/v/jenkinsfilelint)](https://pypi.org/project/jenkinsfilelint)

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`](https://www.jenkins.io/doc/book/pipeline/development/#linter))
when you configure one. It's primarily a [pre-commit](https://pre-commit.com/)
hook, but also works as a standalone CLI tool.

> 📖 Read the [official blog post](https://www.jenkins.io/blog/2026/06/08/jenkinsfilelint-pre-commit/) for the story behind this tool.

![demo](https://raw.githubusercontent.com/jenkinsci/jenkinsfilelint/main/demo.gif)

## Quick Start

```bash
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 [below](#pre-commit-hook)) or keep
using the [CLI](https://jenkinsci.github.io/jenkinsfilelint/usage/#cli).

## Pre-commit Hook

Add the hook to your `.pre-commit-config.yaml` and install. Once configured,
every commit that touches a Jenkinsfile is automatically validated.

```yaml
# .pre-commit-config.yaml
repos:
  - repo: https://github.com/jenkinsci/jenkinsfilelint
    rev: # use the latest version
    hooks:
      - id: jenkinsfilelint-offline
```

```bash
pip install pre-commit
pre-commit install
```

## Documentation

Everything else is on the [documentation site](https://jenkinsci.github.io/jenkinsfilelint/): [install](https://jenkinsci.github.io/jenkinsfilelint/install/), [usage](https://jenkinsci.github.io/jenkinsfilelint/usage/), [pre-commit](https://jenkinsci.github.io/jenkinsfilelint/pre-commit/), [configuration](https://jenkinsci.github.io/jenkinsfilelint/configuration/), [security](https://jenkinsci.github.io/jenkinsfilelint/security/), [how it works](https://jenkinsci.github.io/jenkinsfilelint/how-it-works/) and the [security audit](https://jenkinsci.github.io/jenkinsfilelint/audit/).

## Contributing

See [CONTRIBUTING.md](CONTRIBUTING.md).

## License

MIT — see [LICENSE](LICENSE).
