skillfed

salt-lint

A command-line utility that checks for best practices in SaltStack.

salt-lint v0.9.2 504.7K downloads/30d#6,295 on PyPI160
Permissive license MIT Active released

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-lint

uv

uv add salt-lint

poetry

poetry add salt-lint

Installing 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

Development Status :: 5 - Production/StableEnvironment :: ConsoleIntended Audience :: DevelopersIntended Audience :: Information TechnologyIntended Audience :: System AdministratorsLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Software Development :: Bug TrackingTopic :: Software Development :: Quality AssuranceTopic :: Software Development :: TestingTopic :: Utilities

Tags

salt state file lintersaltstack sls checkersalt best practices validatorsls file quality checksaltstack code lintingsalt configuration lintsls syntax and style checker
saltstacklintingconfiguration-management

More Utilities packages