{"id":6866,"library":"salt-lint","title":"Salt-Lint","description":"Salt-lint is a command-line utility that checks Salt State files (SLS) for best practices and potential improvements in SaltStack environments. Heavily inspired by `ansible-lint`, it helps enforce coding standards and identify common pitfalls in Salt configurations. It is currently at version 0.9.2 and maintains an active release cadence, with multiple bugfix and feature releases per year.","status":"active","version":"0.9.2","language":"en","source_language":"en","source_url":"https://github.com/warpnet/salt-lint","tags":["saltstack","lint","static analysis","devops","configuration management"],"install":[{"cmd":"pip install salt-lint","lang":"bash","label":"Install via pip"}],"dependencies":[],"imports":[],"quickstart":{"code":"mkdir -p my_salt_states\necho 'my_package:\n  pkg.installed:\n    - name: vim\n    - version: latest\n    - onchanges:\n      - file: /etc/vimrc\n\nmy_service:\n  service.running:\n    - name: apache2\n    - enable: True\n    - watch:\n      - pkg: my_package' > my_salt_states/init.sls\nsalt-lint my_salt_states/init.sls","lang":"bash","description":"Salt-lint is primarily a command-line tool. Create a sample SaltStack state file (e.g., `my_salt_states/init.sls`) and then run `salt-lint` against it. The output will show any detected issues or warnings."},"warnings":[{"fix":"Upgrade your Python environment to version 3.6 or higher.","message":"Python 2.7 support was officially dropped in version 0.6.0. Users on older Python environments must upgrade to Python 3.6 or newer to use current versions of salt-lint.","severity":"breaking","affected_versions":">=0.6.0"},{"fix":"Review the changelog (e.g., on GitHub or ReadTheDocs) before upgrading to understand changes in linting rules. Consider pinning to minor versions if strict output stability is required.","message":"New linting rules are frequently added, and existing rules may be modified or removed, which can lead to changes in linting output and new errors appearing after an upgrade. For example, rule 218 was removed in v0.6.1, and rule 210 was reverted in v0.9.1.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Avoid using periods in Salt State file names, except for the file extension. Upgrade to v0.5.0 or newer to get automatic detection.","message":"SLS files with periods in their name (other than the `.sls` suffix) are not correctly referenced by Salt. Salt-lint introduced rule 214 in v0.5.0 to detect this naming convention.","severity":"gotcha","affected_versions":"<0.5.0"},{"fix":"Upgrade to salt-lint 0.8.0 or newer to resolve false positives related to Jinja variable spacing in nested braces.","message":"Earlier versions could produce false positives when detecting missing spaces in Jinja variables if the Jinja statement was nested in literal braces. This was fixed in version 0.8.0.","severity":"gotcha","affected_versions":"<0.8.0"},{"fix":"Ensure file modes are correctly quoted as strings, typically with a leading zero (e.g., `mode: '0755'`). Upgrade to v0.8.0 or newer for improved detection.","message":"Incorrect quotation or missing leading zeros in file modes (e.g., `mode: 755` instead of `mode: '0755'`) can lead to unintended permissions. Salt-lint fixed several false positives and improved detection for these in version 0.8.0.","severity":"gotcha","affected_versions":"<0.8.0"}],"env_vars":null,"last_verified":"2026-04-15T00:00:00.000Z","next_check":"2026-07-14T00:00:00.000Z","problems":[]}