xiaoyuechen / useful-pre-commit-hooks

Useful Pre-commit Hooks

Repository from Github https://github.comxiaoyuechen/useful-pre-commit-hooksRepository from Github https://github.comxiaoyuechen/useful-pre-commit-hooks

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.

About

Useful Pre-commit Hooks

License:Apache License 2.0


Languages

Language:Python 100.0%