chore: add flake8 pre-commit hook

Part-of: <https://dev.funkwhale.audio/funkwhale/funkwhale/-/merge_requests/2178>
environments/review-docs-pre-c-3w4ikk/deployments/15645
jo 2022-11-19 16:38:51 +01:00 zatwierdzone przez Marge
rodzic af699c3303
commit 4fbef50d71
4 zmienionych plików z 16 dodań i 24 usunięć

11
.flake8 100644
Wyświetl plik

@ -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

Wyświetl plik

@ -166,25 +166,6 @@ black:
changes:
- 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:
interruptible: true
image: node:18-alpine

Wyświetl plik

@ -23,3 +23,8 @@ repos:
exclude: ^(docs/locales/.*/LC_MESSAGES)
- id: mixed-line-ending
- id: trailing-whitespace
- repo: https://github.com/pycqa/flake8
rev: 5.0.4
hooks:
- id: flake8

Wyświetl plik

@ -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]
skip_glob = .tox,.git,*/migrations/*,*/static/CACHE/*,docs,node_modules