GithubHelp home page GithubHelp logo

craftech-io / pre-commit Goto Github PK

View Code? Open in Web Editor NEW
2.0 10.0 0.0 42 KB

A collection of pre-commit hooks used by Craftech

Home Page: https://www.craftech.io/

License: Apache License 2.0

Shell 100.00%
pre-commit pre-commit-hooks devops bash git

pre-commit's Introduction

Pre-commit hooks

This repo defines Git pre-commit hooks intended for use with pre-commit. The currently supported hooks are:

  • terraform-fmt: Automatically run terraform fmt on all Terraform code (*.tf files).

General Usage

In each of your repos, add a file called .pre-commit-config.yaml with the following contents:

repos:
  - repo: https://github.com/craftech-io/pre-commit
    rev: <VERSION> # Get the latest from: https://github.com/craftech-io/pre-commit/releases
    hooks:
      - id: terraform-fmt

Next, have every developer:

  1. Install pre-commit. E.g. brew install pre-commit.
  2. Run pre-commit install in the repo.

That’s it! Now every time you commit a code change (.tf file), the hooks in the hooks: config will execute.

Running Against All Files At Once

Example: Formatting all files

If you'd like to format all of your code at once (rather than one file at a time), you can run:

pre-commit run terraform-fmt --all-files

License

This code is released under the Apache 2.0 License. Please see LICENSE for more details.

pre-commit's People

Contributors

arielvinas avatar ayalaluquez avatar b0nete avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

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.