mirror of
https://github.com/home-assistant/core.git
synced 2025-04-24 01:08:12 +00:00
pre-commit: ship default and full configs (#28463)
For now, the only difference between the two is mypy.
This commit is contained in:
parent
b8fa5367db
commit
a8dff2f2d0
42
.pre-commit-config-all.yaml
Normal file
42
.pre-commit-config-all.yaml
Normal file
@ -0,0 +1,42 @@
|
||||
# This configuration includes the full set of hooks we use. In
|
||||
# addition to the defaults (see .pre-commit-config.yaml), this
|
||||
# includes hooks that require our development and test dependencies
|
||||
# installed and the virtualenv containing them active by the time
|
||||
# pre-commit runs to produce correct results.
|
||||
#
|
||||
# If this is not a problem for your workflow, using this config is
|
||||
# recommended, install it with
|
||||
# pre-commit install --config .pre-commit-config-all.yaml
|
||||
# Otherwise, see the default .pre-commit-config.yaml for a lighter one.
|
||||
|
||||
repos:
|
||||
- repo: https://github.com/psf/black
|
||||
rev: 19.10b0
|
||||
hooks:
|
||||
- id: black
|
||||
args:
|
||||
- --safe
|
||||
- --quiet
|
||||
files: ^((homeassistant|script|tests)/.+)?[^/]+\.py$
|
||||
- repo: https://gitlab.com/pycqa/flake8
|
||||
rev: 3.7.8
|
||||
hooks:
|
||||
- id: flake8
|
||||
additional_dependencies:
|
||||
- flake8-docstrings==1.3.1
|
||||
- pydocstyle==4.0.0
|
||||
files: ^(homeassistant|script|tests)/.+\.py$
|
||||
# Using a local "system" mypy instead of the mypy hook, because its
|
||||
# results depend on what is installed. And the mypy hook runs in a
|
||||
# virtualenv of its own, meaning we'd need to install and maintain
|
||||
# another set of our dependencies there... no. Use the "system" one
|
||||
# and reuse the environment that is set up anyway already instead.
|
||||
- repo: local
|
||||
hooks:
|
||||
- id: mypy
|
||||
name: mypy
|
||||
entry: mypy
|
||||
language: system
|
||||
types: [python]
|
||||
require_serial: true
|
||||
files: ^homeassistant/.+\.py$
|
@ -1,3 +1,10 @@
|
||||
# This configuration includes the default, minimal set of hooks to be
|
||||
# run on all commits. It requires no specific setup and one can just
|
||||
# start using pre-commit with it.
|
||||
#
|
||||
# See .pre-commit-config-all.yaml for a more complete one that comes
|
||||
# with a better coverage at the cost of some specific setup needed.
|
||||
|
||||
repos:
|
||||
- repo: https://github.com/psf/black
|
||||
rev: 19.10b0
|
||||
@ -15,17 +22,3 @@ repos:
|
||||
- flake8-docstrings==1.3.1
|
||||
- pydocstyle==4.0.0
|
||||
files: ^(homeassistant|script|tests)/.+\.py$
|
||||
# Using a local "system" mypy instead of the mypy hook, because its
|
||||
# results depend on what is installed. And the mypy hook runs in a
|
||||
# virtualenv of its own, meaning we'd need to install and maintain
|
||||
# another set of our dependencies there... no. Use the "system" one
|
||||
# and reuse the environment that is set up anyway already instead.
|
||||
- repo: local
|
||||
hooks:
|
||||
- id: mypy
|
||||
name: mypy
|
||||
entry: mypy
|
||||
language: system
|
||||
types: [python]
|
||||
require_serial: true
|
||||
files: ^homeassistant/.+\.py$
|
||||
|
@ -45,7 +45,7 @@ stages:
|
||||
|
||||
. venv/bin/activate
|
||||
pip install -r requirements_test.txt -c homeassistant/package_constraints.txt
|
||||
pre-commit install-hooks
|
||||
pre-commit install-hooks --config .pre-commit-config-all.yaml
|
||||
- script: |
|
||||
. venv/bin/activate
|
||||
pre-commit run flake8 --all-files
|
||||
@ -84,7 +84,7 @@ stages:
|
||||
|
||||
. venv/bin/activate
|
||||
pip install -r requirements_test.txt -c homeassistant/package_constraints.txt
|
||||
pre-commit install-hooks
|
||||
pre-commit install-hooks --config .pre-commit-config-all.yaml
|
||||
- script: |
|
||||
. venv/bin/activate
|
||||
pre-commit run black --all-files
|
||||
@ -182,8 +182,8 @@ stages:
|
||||
|
||||
. venv/bin/activate
|
||||
pip install -e . -r requirements_test.txt -c homeassistant/package_constraints.txt
|
||||
pre-commit install-hooks
|
||||
pre-commit install-hooks --config .pre-commit-config-all.yaml
|
||||
- script: |
|
||||
. venv/bin/activate
|
||||
pre-commit run mypy --all-files
|
||||
pre-commit run --config .pre-commit-config-all.yaml mypy --all-files
|
||||
displayName: 'Run mypy'
|
||||
|
@ -2,7 +2,7 @@
|
||||
# make new things fail. Manually update these pins when pulling in a
|
||||
# new version
|
||||
|
||||
# When updating this file, update .pre-commit-config.yaml too
|
||||
# When updating this file, update .pre-commit-config*.yaml too
|
||||
asynctest==0.13.0
|
||||
black==19.10b0
|
||||
codecov==2.0.15
|
||||
|
@ -3,7 +3,7 @@
|
||||
# make new things fail. Manually update these pins when pulling in a
|
||||
# new version
|
||||
|
||||
# When updating this file, update .pre-commit-config.yaml too
|
||||
# When updating this file, update .pre-commit-config*.yaml too
|
||||
asynctest==0.13.0
|
||||
black==19.10b0
|
||||
codecov==2.0.15
|
||||
|
Loading…
x
Reference in New Issue
Block a user