chore: add flake8 pre-commit hook
Part-of: <https://dev.funkwhale.audio/funkwhale/funkwhale/-/merge_requests/2178>
This commit is contained in:
parent
af699c3303
commit
4fbef50d71
|
@ -0,0 +1,11 @@
|
||||||
|
# Use .flake8 file until pyproject.toml is supported
|
||||||
|
# See https://github.com/PyCQA/flake8/issues/234
|
||||||
|
[flake8]
|
||||||
|
max-line-length = 120
|
||||||
|
extend-exclude =
|
||||||
|
*/migrations/*
|
||||||
|
extend-ignore =
|
||||||
|
F405
|
||||||
|
W503
|
||||||
|
E203
|
||||||
|
E741
|
|
@ -166,25 +166,6 @@ black:
|
||||||
changes:
|
changes:
|
||||||
- api/**/*
|
- api/**/*
|
||||||
|
|
||||||
flake8:
|
|
||||||
interruptible: true
|
|
||||||
image: python:3.7
|
|
||||||
stage: lint
|
|
||||||
variables:
|
|
||||||
GIT_STRATEGY: fetch
|
|
||||||
before_script:
|
|
||||||
- pip install 'flake8<3.7'
|
|
||||||
script:
|
|
||||||
- flake8 -v api
|
|
||||||
cache:
|
|
||||||
key: "$CI_PROJECT_ID__flake8_pip_cache"
|
|
||||||
paths:
|
|
||||||
- "$PIP_CACHE_DIR"
|
|
||||||
rules:
|
|
||||||
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
|
|
||||||
changes:
|
|
||||||
- api/**/*
|
|
||||||
|
|
||||||
eslint:
|
eslint:
|
||||||
interruptible: true
|
interruptible: true
|
||||||
image: node:18-alpine
|
image: node:18-alpine
|
||||||
|
|
|
@ -23,3 +23,8 @@ repos:
|
||||||
exclude: ^(docs/locales/.*/LC_MESSAGES)
|
exclude: ^(docs/locales/.*/LC_MESSAGES)
|
||||||
- id: mixed-line-ending
|
- id: mixed-line-ending
|
||||||
- id: trailing-whitespace
|
- id: trailing-whitespace
|
||||||
|
|
||||||
|
- repo: https://github.com/pycqa/flake8
|
||||||
|
rev: 5.0.4
|
||||||
|
hooks:
|
||||||
|
- id: flake8
|
||||||
|
|
|
@ -1,8 +1,3 @@
|
||||||
[flake8]
|
|
||||||
max-line-length = 120
|
|
||||||
exclude = .tox,.git,*/migrations/*,*/static/CACHE/*,docs,node_modules,tests/data,tests/music/conftest.py
|
|
||||||
ignore = F405,W503,E203,E741
|
|
||||||
|
|
||||||
[isort]
|
[isort]
|
||||||
skip_glob = .tox,.git,*/migrations/*,*/static/CACHE/*,docs,node_modules
|
skip_glob = .tox,.git,*/migrations/*,*/static/CACHE/*,docs,node_modules
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue