mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-11-10 19:56:47 +03:00
Run lint with pre-commit
This commit is contained in:
parent
a003658cce
commit
995707f3ad
17
.github/workflows/lint.yml
vendored
17
.github/workflows/lint.yml
vendored
|
@ -15,6 +15,22 @@ jobs:
|
|||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
|
||||
- name: pip cache
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
path: ~/.cache/pip
|
||||
key: lint-pip-${{ hashFiles('**/setup.py') }}
|
||||
restore-keys: |
|
||||
lint-pip-
|
||||
|
||||
- name: pre-commit cache
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
path: ~/.cache/pre-commit
|
||||
key: lint-pre-commit-${{ hashFiles('**/.pre-commit-config.yaml') }}
|
||||
restore-keys: |
|
||||
lint-pre-commit-
|
||||
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
uses: actions/setup-python@v1
|
||||
with:
|
||||
|
@ -30,3 +46,4 @@ jobs:
|
|||
|
||||
- name: Lint
|
||||
run: tox -e lint
|
||||
|
||||
|
|
32
.pre-commit-config.yaml
Normal file
32
.pre-commit-config.yaml
Normal file
|
@ -0,0 +1,32 @@
|
|||
repos:
|
||||
- repo: https://github.com/psf/black
|
||||
rev: 19.10b0
|
||||
hooks:
|
||||
- id: black
|
||||
args: ["--target-version", "py35"]
|
||||
# Only .py files, until https://github.com/psf/black/issues/402 resolved
|
||||
files: \.py$
|
||||
types: []
|
||||
|
||||
- repo: https://gitlab.com/pycqa/flake8
|
||||
rev: 3.7.9
|
||||
hooks:
|
||||
- id: flake8
|
||||
additional_dependencies: [flake8-2020, flake8-implicit-str-concat]
|
||||
|
||||
- repo: https://github.com/timothycrosley/isort
|
||||
rev: 4.3.21
|
||||
hooks:
|
||||
- id: isort
|
||||
|
||||
- repo: https://github.com/pre-commit/pygrep-hooks
|
||||
rev: v1.5.1
|
||||
hooks:
|
||||
- id: python-check-blanket-noqa
|
||||
- id: rst-backticks
|
||||
|
||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||
rev: v2.5.0
|
||||
hooks:
|
||||
- id: check-merge-conflict
|
||||
- id: check-yaml
|
|
@ -1,6 +1,9 @@
|
|||
dist: xenial
|
||||
language: python
|
||||
cache: pip
|
||||
cache:
|
||||
pip: true
|
||||
directories:
|
||||
- $HOME/.cache/pre-commit
|
||||
|
||||
notifications:
|
||||
irc: "chat.freenode.net#pil"
|
||||
|
|
|
@ -6,6 +6,7 @@ include *.py
|
|||
include *.rst
|
||||
include *.sh
|
||||
include *.txt
|
||||
include *.yaml
|
||||
include LICENSE
|
||||
include Makefile
|
||||
include tox.ini
|
||||
|
|
Loading…
Reference in New Issue
Block a user