GithubHelp home page GithubHelp logo

jiuka / puppet-lint-strict_indent-check Goto Github PK

View Code? Open in Web Editor NEW

This project forked from voxpupuli/puppet-lint-strict_indent-check

0.0 2.0 0.0 15 KB

indent check for puppet-lint

License: Other

Ruby 100.00%

puppet-lint-strict_indent-check's Introduction

Installation

gem install puppet-lint-strict_indent-check

Usage

This plugin provides an indentation check for puppet-lint strict_indent. The check has a strict expectation for all indentation, except comments and whitespace/blank lines.

supports --fix flag

Check will raise a warning for any files that don't have 2-space indent, and follow specific guidelines for increase/decrease of indent.

Alternate Indentation

Indentation defaults to 2 spaces. To use a different number of spaces, use the -l option to load ruby file changing the chars_per_indent config.

config file chars_per_indent_4.rb:

# This could also be set in your Rakefile
PuppetLint.configuration.chars_per_indent = 4

lint command:

puppet-lint -l chars_per_indent_4.rb puppet-mysql/manifests/init.pp

Acceptable Identation

  • indent should increase by one step the line after each opened brace (square, curly, paren)
  • indent should decrease by one step the line of every closed brace.
  • indent should increase by one step the line after a resource title, unless it already increased due to a bracket.
  • indent should decrease by one step the line after the end of a resource due to semicolon, if it was indented for resource title.
  • indent should decrease by one step the line of the end of a resource due to right curly brace, if it was indented for resource title, and not ended by a semicolon.
  • indent should increase by one step the line after an equals = or farrow => that ends a line, but only for that one line.

see spec/fixtures/pass/ for good indentation examples.

see spec/fixtures/fail/ for bad indentation examples.

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.