1 # Git has the notion of hooks, which are custom scripts that are run on
2 # specific events. One of these hooks is the pre-commit hook (located at
3 # .git/hooks/pre-commit), which is run when committing, before specifying a
6 # To ease management of the pre-commit hook, the pre-commit framework
7 # ( https://pre-commit.com ) was developed. This is the configuration file
8 # for that framework. It contains a list of hooks, with information on where
9 # to find them and on which files to run them.
11 # See here ( https://pre-commit.com/#install ) on how to install the
12 # pre-commit framework.
14 # To run all the hooks specified in this file manually, you can do:
17 # To run some hooks and skip others, you can use environment variable SKIP:
18 # $ SKIP=flake8,isort pre-commit run
20 # To install the pre-commit framework in the repository in order to run the
21 # hooks on every commit, do:
22 # $ pre-commit install
24 # After installing the pre-commit framework, you can skip running all
25 # pre-commit hooks using --no-verify, or some using SKIP.
26 # $ git commit --no-verify ...
27 # $ SKIP=flake8,isort git commit ...
29 # In case some of these hooks don't work for you, you can make the SKIP
30 # setting permanent by:
31 # - setting SKIP in your environment
32 # (this will affect all repositories where it is set)
33 # - setting SKIP in .git/hooks/pre-commit by adding "export SKIP=..."
34 # (this will affect only this repository, but it may have to be re-added
35 # if .git/hooks/pre-commit is regenerated)
37 # See https://pre-commit.com for more information
38 # See https://pre-commit.com/hooks.html for more hooks
41 - repo: https://github.com/psf/black-pre-commit-mirror
46 files: 'gdb/.*\.py(\.in)?$'
47 - repo: https://github.com/pycqa/flake8
52 # Note this one is only run on gdb/python, not (for now) the
54 files: 'gdb/python/.*\.py(\.in)?$'
55 args: [--config, gdb/setup.cfg]
56 - repo: https://github.com/pycqa/isort
61 files: 'gdb/.*\.py(\.in)?$'