forked from omni-us/jsonargparse
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
132 lines (117 loc) · 3.44 KB
/
.pre-commit-config.yaml
File metadata and controls
132 lines (117 loc) · 3.44 KB
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
fail_fast: true
ci:
skip:
- mypy
- pycodestyle
- pylint
- tox
- coverage
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-added-large-files
- id: check-ast
- id: check-case-conflict
- id: check-docstring-first
- id: end-of-file-fixer
- id: mixed-line-ending
- id: trailing-whitespace
exclude: .bumpversion.cfg
- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: isort
- repo: https://github.com/PyCQA/autoflake
rev: v2.0.1
hooks:
- id: autoflake
- repo: local
hooks:
- id: twine-check
name: twine check [on bumpversion]
entry: bash -c '
if [ "${BUMPVERSION_NEW_VERSION+x}" = "" ]; then
echo "$(tput setaf 6) Skipped, only runs when bumping version $(tput sgr0)";
else
./setup.py bdist_wheel;
twine check dist/*.whl;
fi'
language: system
pass_filenames: false
verbose: true
- id: changelog-check
name: changelog check [on bumpversion]
entry: bash -c '
if [ "${BUMPVERSION_NEW_VERSION+x}" = "" ]; then
echo "$(tput setaf 6) Skipped, only runs when bumping version $(tput sgr0)";
else
CHANGELOG=$(grep -E "^v.+\..+\..+ \(....-..-..\)" CHANGELOG.rst | head -n 1);
EXPECTED="v$BUMPVERSION_NEW_VERSION ($(date -u +%Y-%m-%d))";
if [ "$CHANGELOG" != "$EXPECTED" ] && [ $(echo $BUMPVERSION_NEW_VERSION | grep -cE "[0-9.]+(\.dev|rc)[0-9]+") = 0 ]; then
if [ ! -z "${BUMPVERSION_UPDATE_CHANGELOG+x}" ] && [ $(grep -c "^v$BUMPVERSION_NEW_VERSION " CHANGELOG.rst) = 1 ]; then
sed -i "s|^v$BUMPVERSION_NEW_VERSION .*|$EXPECTED|" CHANGELOG.rst;
git add CHANGELOG.rst;
else
echo "Expected latest release in CHANGELOG.rst to be $EXPECTED. Set BUMPVERSION_UPDATE_CHANGELOG to auto update.";
exit 1;
fi
fi
fi'
language: system
pass_filenames: false
verbose: true
- id: circleci-config-validate
name: circleci config validate -c .circleci/config.yml
entry: bash -c '
if [ "$(which circleci)" = "" ]; then
echo "$(tput setaf 6) Skipped, circleci command not found $(tput sgr0)";
else
circleci config validate -c .circleci/config.yml;
fi'
language: system
files: .circleci/config.yml
pass_filenames: false
verbose: true
- id: mypy
name: mypy jsonargparse*/*.py
entry: bash -c "mypy jsonargparse*/*.py"
language: system
types: [python]
pass_filenames: false
verbose: true
- id: pycodestyle
name: pycodestyle
entry: pycodestyle
language: system
types: [python]
verbose: true
- id: pylint
name: pylint --rcfile=setup.cfg
entry: pylint --rcfile=setup.cfg
language: system
types: [python]
verbose: true
- id: tox
name: tox --parallel
entry: tox --parallel
language: system
pass_filenames: false
verbose: true
- id: doctest
name: sphinx-build -M doctest sphinx sphinx/_build sphinx/index.rst
entry: bash -c '
if [ "$(which sphinx-build)" = "" ]; then
echo "$(tput setaf 6) Skipped, sphinx-build command not found $(tput sgr0)";
else
sphinx-build -M doctest sphinx sphinx/_build sphinx/index.rst;
fi'
language: system
pass_filenames: false
verbose: true
- id: coverage
name: ./setup.py test_coverage
entry: ./setup.py test_coverage
language: system
pass_filenames: false
verbose: true