Run pre-commit on Travis CI (#1081)

This commit is contained in:
Hugo van Kemenade 2019-10-21 12:18:23 +03:00 committed by Łukasz Langa
parent 394edc3887
commit 000147c007
2 changed files with 26 additions and 30 deletions

View File

@ -2,21 +2,23 @@
# "Version control integration" in README.md. # "Version control integration" in README.md.
exclude: ^(blib2to3/|profiling/|tests/data/) exclude: ^(blib2to3/|profiling/|tests/data/)
repos: repos:
- repo: local - repo: local
hooks: hooks:
- id: black - id: black
name: black name: black
language: system language: system
entry: black entry: black
require_serial: true
types: [python] types: [python]
- repo: https://gitlab.com/pycqa/flake8
rev: 3.7.8
hooks:
- id: flake8 - id: flake8
name: flake8 additional_dependencies: [flake8-bugbear]
language: system
entry: flake8 - repo: https://github.com/pre-commit/mirrors-mypy
types: [python] rev: v0.740
hooks:
- id: mypy - id: mypy
name: mypy
language: system
entry: mypy
types: [python]
exclude: ^docs/conf.py exclude: ^docs/conf.py

View File

@ -1,10 +1,12 @@
dist: xenial
language: python language: python
cache: pip cache:
pip: true
directories:
- $HOME/.cache/pre-commit
env: env:
- TEST_CMD="coverage run tests/test_black.py" - TEST_CMD="coverage run tests/test_black.py"
install: install:
- pip install coverage coveralls flake8 flake8-bugbear mypy - pip install coverage coveralls pre-commit
- pip install -e '.[d]' - pip install -e '.[d]'
script: script:
- $TEST_CMD - $TEST_CMD
@ -15,18 +17,10 @@ notifications:
on_failure: always on_failure: always
matrix: matrix:
include: include:
- name: "mypy" - name: "lint"
python: 3.6
env:
- TEST_CMD="mypy black.py blackd.py tests/test_black.py"
- name: "black"
python: 3.7 python: 3.7
env: env:
- TEST_CMD="black --check --verbose ." - TEST_CMD="pre-commit run --all-files"
- name: "flake8"
python: 3.7
env:
- TEST_CMD="flake8 black.py blackd.py tests/test_black.py"
- name: "3.6" - name: "3.6"
python: 3.6 python: 3.6
- name: "3.7" - name: "3.7"