Giter Site home page Giter Site logo

salt-lint's Introduction

salt-lint

Linter for Salt configuration management.

Master: Master: Build Status Development: Development: Build Status

Gem Version Code Climate Gratipay

Documentation:

Please see documentation to interpret any results returned.

Running within git repo with its git files only

git ls-files | grep sls | xargs -I {} salt-lint -f {}

Do not use it until version >= 0.5

salt-lint's People

Contributors

lukaszraczylo avatar dijit avatar

Stargazers

Christopher Draper avatar Jeremy Reichman avatar Jothibasu avatar  avatar Michael McMahon avatar Sjoerd Oostdijck avatar Nikolaus Schlemm avatar Claas Lisowski avatar Valentin Ouvrard avatar  avatar William Allen avatar Chris Donnelly avatar Vitalii Mikhnevych avatar Benedetto Lo Giudice avatar dragon788 avatar Denys Slipetskyy avatar Mikhail Sokolov avatar Aleksandr Piatkin avatar Frank avatar

Watchers

 avatar James Cloos avatar Dmitry Kalinnikov avatar  avatar

salt-lint's Issues

Single line declaration has problems

If I have a stanza like this:

awesome-service:
  service.running:
    - blah: True

The check fails (with the [!] Found single line declaration in... error), because it matches on the service in the top line, not just the service in the 2nd line. Anyway around this?

Return code is always 1, even when no issues are found

Hello, thank you for this gem!

I would like to use it in our CI/CD pipeline, but am running into an issue: the return code is always 1, even where no issues are found. I've read the code to try to understand why, but could not find the issue.

I would very much appreciate if you have the time to look into it! Let me know if you need additional information.

Recommend using map.jinja over calling `pillar.get`

For example in firewall/templates/iptables-rules:

Bad

:INPUT {{ salt['pillar.get']('firewall:default_policy', 'ACCEPT') }} [0:0]

Good

{% from 'firewall/map.jinja' import firewall with context %}
:INPUT {{ salt['pillar.get']('firewall:default_policy', 'ACCEPT') }} [0:0]

I.e. we probably want to look for any instance of {{ salt['pillar.get']( (though be a bit more relaxed about whitespace)

Check templates all live under a templates/ folder

For instance

/etc/iptables-rules:
  file.managed:
    - source: salt://firewall/iptables-rules
    - template: jinja
    - user: root
    - group: root

If there is a template: jinja attribute the source attribute should have /templates/ in it somewhere.

Exit codes

The salt-lint executable always returns 0, even if something has failed. Are there plans to actually return correct codes? Also have to think of the case when using -s also.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.