Skip to content

Files

Latest commit

b305754 · Oct 25, 2020

History

History
33 lines (27 loc) · 746 Bytes

README.md

File metadata and controls

33 lines (27 loc) · 746 Bytes

Useful Pre-commit Hooks

A collection of useful pre-commit hooks.

Usage

We current support common hooks for C++ development. Here is the list:

cmake-format
cmake-lint
clang-format
cpplint

To use these hooks, simply place the following in your .pre-commit-config.yaml

For example:

repos:
  - repo: https://github.com/xiaoyuechen/useful-pre-commit-hooks.git
    rev: v0.8
    hooks: 
    - id: cmake-format
      args: [--in-place, --line-ending=auto]
    - id: cmake-lint
      args: [--disabled-codes=C0327]
    - id: clang-format
    - id: cpplint
      args: [--output=vs7]

Then run pre-commit install. Now every time when you run git commit, the selected pre-commit commands are going to run.