File tree 7 files changed +38
-73
lines changed
7 files changed +38
-73
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
- # This configuration includes the default, minimal set of hooks to be
2
- # run on all commits. It requires no specific setup and one can just
3
- # start using pre-commit with it.
4
- #
5
- # See .pre-commit-config-all.yaml for a more complete one that comes
6
- # with a better coverage at the cost of some specific setup needed.
7
-
8
1
repos :
9
2
- repo : https://github.com/psf/black
10
3
rev : 19.10b0
@@ -48,3 +41,16 @@ repos:
48
41
rev : v2.4.0
49
42
hooks :
50
43
- id : check-json
44
+ - repo : local
45
+ hooks :
46
+ # Run mypy through our wrapper script in order to get the possible
47
+ # pyenv and/or virtualenv activated; it may not have been e.g. if
48
+ # committing from a GUI tool that was not launched from an activated
49
+ # shell.
50
+ - id : mypy
51
+ name : mypy
52
+ entry : script/run-in-env.sh mypy
53
+ language : script
54
+ types : [python]
55
+ require_serial : true
56
+ files : ^homeassistant/.+\.py$
Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ stages:
43
43
44
44
. venv/bin/activate
45
45
pip install -r requirements_test.txt -c homeassistant/package_constraints.txt
46
- pre-commit install-hooks --config .pre-commit-config-all.yaml
46
+ pre-commit install-hooks
47
47
- script : |
48
48
. venv/bin/activate
49
49
pre-commit run codespell --all-files
@@ -98,7 +98,7 @@ stages:
98
98
99
99
. venv/bin/activate
100
100
pip install -r requirements_test.txt -c homeassistant/package_constraints.txt
101
- pre-commit install-hooks --config .pre-commit-config-all.yaml
101
+ pre-commit install-hooks
102
102
- script : |
103
103
. venv/bin/activate
104
104
pre-commit run black --all-files --show-diff-on-failure
@@ -194,8 +194,8 @@ stages:
194
194
195
195
. venv/bin/activate
196
196
pip install -e . -r requirements_test.txt -c homeassistant/package_constraints.txt
197
- pre-commit install-hooks --config .pre-commit-config-all.yaml
197
+ pre-commit install-hooks
198
198
- script : |
199
199
. venv/bin/activate
200
- pre-commit run --config .pre-commit-config-all.yaml mypy --all-files
200
+ pre-commit run mypy --all-files
201
201
displayName: 'Run mypy'
Original file line number Diff line number Diff line change 1
- # Automatically generated from .pre-commit-config-all .yaml by gen_requirements_all.py, do not edit
1
+ # Automatically generated from .pre-commit-config.yaml by gen_requirements_all.py, do not edit
2
2
3
3
bandit==1.6.2
4
4
black==19.10b0
Original file line number Diff line number Diff line change @@ -253,7 +253,7 @@ def requirements_test_output(reqs):
253
253
254
254
def requirements_pre_commit_output ():
255
255
"""Generate output for pre-commit dependencies."""
256
- source = ".pre-commit-config-all .yaml"
256
+ source = ".pre-commit-config.yaml"
257
257
pre_commit_conf = load_yaml (source )
258
258
reqs = []
259
259
for repo in (x for x in pre_commit_conf ["repos" ] if x .get ("rev" )):
Original file line number Diff line number Diff line change
1
+ #! /bin/sh -eu
2
+
3
+ # Activate pyenv and virtualenv if present, then run the specified command
4
+
5
+ # pyenv, pyenv-virtualenv
6
+ if [ -s .python-version ]; then
7
+ PYENV_VERSION=$( head -n 1 .python-version)
8
+ export PYENV_VERSION
9
+ fi
10
+
11
+ # other common virtualenvs
12
+ for venv in venv .venv . ; do
13
+ if [ -f $venv /bin/activate ]; then
14
+ . $venv /bin/activate
15
+ fi
16
+ done
17
+
18
+ exec " $@ "
Original file line number Diff line number Diff line change 45
45
-r{toxinidir}/requirements_test.txt
46
46
-c{toxinidir}/homeassistant/package_constraints.txt
47
47
commands =
48
- pre-commit run --config .pre-commit-config-all.yaml mypy {posargs: --all-files}
48
+ pre-commit run mypy {posargs: --all-files}
You can’t perform that action at this time.
0 commit comments