salt-lint
A command-line utility that checks for best practices in SaltStack.
What it is and what it does
salt-lint is a command-line linter for SaltStack state files (SLS format), designed to catch style violations, structural issues, and anti-patterns that could lead to runtime problems or maintenance headaches. It runs a set of numbered rules—covering indentation, quoting, Jinja templating, deprecated state options, and naming conventions—and reports violations with file location and severity. The tool depends on pyyaml for parsing YAML and pathspec for file filtering, making it a lightweight addition to a Salt development workflow.
You run it as a CLI tool against a directory or individual SLS files, and it outputs violations in a format suitable for CI/CD pipelines or editor integration. The project is modeled on ansible-lint and has been actively maintained since 2019, with support for modern Python versions (3.6–3.11) and regular rule additions to catch new categories of mistakes.
Use it for:
- Enforce consistent formatting and style across a team's SaltStack state files before deployment.
- Catch deprecated Salt state options and syntax errors early in development or CI/CD pipelines.
- Validate SLS file naming and structure to prevent runtime reference failures in Salt.
- Integrate into pre-commit hooks or CI workflows to block commits with linting violations.
- Identify common Jinja templating mistakes and missing spaces in variable interpolation.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
salt-lint checks Salt State files (SLS) for best practices and potential improvements, flagging style and behavior issues via command-line rules.
Yes. salt-lint is a stable, actively maintained tool with low install friction, no known vulnerabilities, and a permissive MIT license. It fills a clear need for SaltStack users who want automated quality checks on state files. Install it if you manage Salt configurations and want to catch style and logic issues before they reach production.
Install
salt-lint on PyPI
pip
pip install salt-lintuv
uv add salt-lintpoetry
poetry add salt-lintInstalling salt-lint
Before you install
Low install friction with only two runtime dependencies (pyyaml, pathspec). Actively maintained as of 2026-05-06 with stable production status.
License in practice
MIT license permits free use, modification, and distribution with minimal restrictions—suitable for both open-source and commercial projects.
Quickstart
pip install salt-lint
salt-lint /path/to/sls/files/
# Or check a single file:
salt-lint mystate.sls
Requires Python 3.6 or later; pyyaml and pathspec must be installed (handled automatically by pip).
Verify before relying
- Whether the rule set (e.g., rules 901–915 for deprecated states) remains current with recent Salt versions.
- Performance characteristics when linting large SLS file collections or deeply nested state definitions.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.6) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — pyyaml, pathspec |
| Maintenance | actively maintained — 1,282 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 504,744/month — #6,295 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: salt_lint-0.9.2-py3-none-any.whl
Keywords: salt, saltstack, lint, linter, checker
Tags
More Utilities packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
charset-normalizerDetects and normalizes text encoding from…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
PygmentsPygments is a syntax highlighter that colorizes…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
ansible-lintansible-lint checks Ansible playbooks and roles…
copyleft · top 5,000 on PyPI
saltSalt is an event-driven automation engine for…
permissive · top 15,000 on PyPI
gitlint-coreLints Git commit messages against configurable…
permissive · top 5,000 on PyPI
taploTaplo is a TOML v1.0.0 toolkit that provides…
permissive · top 15,000 on PyPI
ickIck is a polyglot tool for bundling best…
permissive · top 15,000 on PyPI
yamllintyamllint checks YAML files for syntax errors,…
copyleft · top 1,000 on PyPI
gitlintGitlint is a command-line tool that validates…
permissive · top 5,000 on PyPI
rstcheckValidates reStructuredText syntax and checks…
permissive · top 5,000 on PyPI
j2lintj2lint validates Jinja2 template syntax and…
permissive · top 15,000 on PyPI
dotenv-linterLints `.env` files for consistency violations…
permissive · top 15,000 on PyPI