diff options
author | Jan Holthuis <jan.holthuis@ruhr-uni-bochum.de> | 2020-01-24 12:05:51 +0100 |
---|---|---|
committer | Jan Holthuis <jan.holthuis@ruhr-uni-bochum.de> | 2020-01-24 13:11:50 +0100 |
commit | c023f18dfc0798f218b6f502c5809deb85e80f02 (patch) | |
tree | ac2290da3f1ae5b3ee66336d12226a4821fee2ff /.pre-commit-config.yaml | |
parent | 011e4b1b059b5b0b083aa1bd33250f69b1c3294b (diff) |
Add pre-commit config
This adds a configuration for the pre-commit framework, a simple way to
manage, install and run git hooks to catch common problems early on. See
https://pre-commit.com/ for details.
This adds the following hooks:
- check-case-conflict
- check-byte-order-marker
- check-yaml
- check-json
- check-xml
- mixed-line-ending
- end-of-file-fixer
- trailing-whitespace
- no-commit-to-branch
- eslint
- clang-format
- qsscheck
If you have python and python-pip installed, just run:
$ pip install --user pre-commit
$ git clone https://github.com/mixxxdj/mixxx.git
$ cd mixxx
$ pre-commit install
$ pre-commit install -t pre-push
It will now run relevant hooks automatically on every `git commit` or
`git push` in the mixxx git repository.
If you have a problems with a particular hook, you can use the `$SKIP`
environment variable to disable hooks:
$ SKIP=clang-format,end-of-file-fixer git commit
This can also be used to separate logic changes and autoformatting into
two subsequent commits.
Using the `$SKIP` var is preferable to using `git commit --no-verify`
because it won't prevent catching other, unrelated issues.
Diffstat (limited to '.pre-commit-config.yaml')
-rw-r--r-- | .pre-commit-config.yaml | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000000..3f5459f593 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,53 @@ +repos: +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: v2.3.0 + hooks: + - id: check-case-conflict + - id: check-byte-order-marker + - id: check-yaml + - id: check-json + - id: check-xml + - id: mixed-line-ending + - id: end-of-file-fixer + stages: + - commit + - manual + - id: trailing-whitespace + stages: + - commit + - manual + - id: no-commit-to-branch +- repo: https://github.com/pre-commit/mirrors-eslint + rev: v6.8.0 + hooks: + - id: eslint + args: [--fix] + additional_dependencies: + - eslint@6.8.0 + stages: + - commit + - manual +- repo: git://github.com/doublify/pre-commit-clang-format + rev: master + hooks: + - id: clang-format + stages: + - commit + - manual +- repo: local + hooks: + - id: qsscheck + name: qsscheck + description: Run qsscheck to detect broken QSS. + entry: ./scripts/qsscheck.py + args: [.] + pass_filenames: false + language: python + additional_dependencies: + - tinycss==0.4 + types: [text] + files: ^.*\.qss$ + stages: + - commit + - push + - manual |