-
Notifications
You must be signed in to change notification settings - Fork 21
/
.pre-commit-config.yaml
78 lines (62 loc) · 2.62 KB
/
.pre-commit-config.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# This file is part of the DiscoPoP software (http://www.discopop.tu-darmstadt.de)
#
# Copyright (c) 2020, Technische Universitaet Darmstadt, Germany
#
# This software may be modified and distributed under the terms of
# the 3-Clause BSD License. See the LICENSE file in the package base
# directory for details.
# pre-commit checks are defined in this file
# See https://pre-commit.com for more information
default_install_hook_types: [pre-commit, commit-msg]
default_language_version:
python: python3
# python >= 3.8 should be used.
# python3 used for compatibility reasons between different systems
# standard hooks -- more info: https://pre-commit.com/hooks.html
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: trailing-whitespace # checks for trailing whitespace
- id: end-of-file-fixer # files must be empty or end on an empty new line
- id: check-yaml # check yaml files are valid
- id: check-added-large-files # check for large files
- id: check-merge-conflict # check for merge conflict strings
# mypy -- more info: https://github.com/pre-commit/mirrors-mypy
- repo: https://github.com/pre-commit/mirrors-mypy
rev: 'v1.5.1' # Use the sha / tag you want to point at
hooks:
- id: mypy
args: [--config-file=mypy.ini, --ignore-missing-imports]
#additional_dependencies: [dep==version.version.version, ...]
# NOTE: pre-commit runs mypy in a virtualenv, so dependencies are not installed unless explicitly listed here
# black -- more info: https://github.com/psf/black/blob/main/docs/integrations/source_version_control.md
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 23.9.1
hooks:
- id: black
args: [--line-length=120]
# check for discopop license tag
- repo: local
hooks:
- id: licensetag
name: Check all files for DiscoPoP License tag
entry: scripts/dev/check-license.sh
language: script
# exclude: we could exclude files here, but we do it in the script instead
# lint commit messages -- idea based on: https://www.conventionalcommits.org/en/v1.0.0/
- repo: local
hooks:
- id: check-commit-msg
name: Check commit message
entry: python scripts/dev/check-commit-msg.py
language: python
stages: [commit-msg]
# currently we use a custom script for commit message lintining because commitlint did not work consistently on all devices
#- repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook
# rev: v9.5.0
# hooks:
# - id: commitlint
# name: Check commit message with commitlint
# stages: [commit-msg]
# additional_dependencies: ['@commitlint/config-conventional']