GithubHelp home page GithubHelp logo

lint-rules's Introduction

lint-rules

lint-rules is a dispacher script of LINT.

Requirements

Usage

Apply lint to all files

git clone https://github.com/infra-ci-book/lint-rules.git
lint-rules/lint_master.sh

Apply lint to branch files

git clone https://github.com/infra-ci-book/lint-rules.git
lint-rules/lint_branches.sh

Ex) GitLab CI

Lint_Check_Master:
  stage: lint
  image:
    name: irixjp/lint-rules:latest
    entrypoint: [""]
  script:
    - git clone https://github.com/infra-ci-book/lint-rules.git
    - lint-rules/lint_master.sh
  only:
    - master
  tags:
    - docker

Lint_Check_Branches:
  stage: lint
  image:
    name: irixjp/lint-rules:latest
    entrypoint: [""]
  script:
    - git clone https://github.com/infra-ci-book/lint-rules.git
    - lint-rules/lint_branches.sh
  only:
    - branches
  except:
    - master
  tags:
    - docker

Test list

  • ANSIBLE0002: Trailing whitespace
    • There should not be any trailing whitespace
  • ANSIBLE0004: Git checkouts must contain explicit version
    • All version control checkouts must point to an explicit commit or tag, not just "latest"
  • ANSIBLE0005: Mercurial checkouts must contain explicit revision
    • All version control checkouts must point to an explicit commit or tag, not just "latest"
  • ANSIBLE0006: Using command rather than module
    • Executing a command when there is an Ansible module is generally a bad idea
  • ANSIBLE0007: Using command rather than an argument to e.g. file
    • Executing a command when there is are arguments to modules is generally a bad idea
  • ANSIBLE0008: Deprecated sudo
    • Instead of sudo/sudo_user, use become/become_user.
  • ANSIBLE0009: Octal file permissions must contain leading zero
  • ANSIBLE0010: Package installs should not use latest
    • Package installs should use state=present with or without a version
  • ANSIBLE0011: All tasks should be named
    • All tasks should have a distinct name for readability and for --start-at-task to work
  • ANSIBLE0012: Commands should not change things if nothing needs doing
    • Commands should either read information (and thus set changed_when) or not do something if it has already been done (using creates/removes) or only do it if another check has a particular result (when)
  • ANSIBLE0013: Use shell only when shell functionality is required
    • Shell should only be used when piping, redirecting or chaining commands (and Ansible would be preferred for some of those!)
  • ANSIBLE0014: Environment variables don't work as part of command
    • Environment variables should be passed to shell or command through environment argument
  • ANSIBLE0015: Using bare variables is deprecated
    • Using bare variables is deprecated. Update yourplaybooks so that the environment value uses the full variablesyntax ("{{your_variable}}").
  • ANSIBLE0016: Tasks that run when changed should likely be handlers
    • If a task has a when: result.changed setting, it's effectively acting as a handler
  • ANSIBLE0017: become_user requires become to work as expected
    • become_user without become will not actually change user
  • ANSIBLE0018: Deprecated always_run
    • Instead of always_run, use check_mode.

Docker build status

lint-rules's People

Contributors

irixjp avatar

Stargazers

S Y avatar Akira Yokochi avatar Oleg Bukatchuk avatar

Watchers

Osamu Habuka avatar James Cloos avatar  avatar Hideki Saito avatar Shingo Kitayama avatar

Forkers

olegbukatchuk

lint-rules's Issues

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.