From 8b23a0904ed7a970ffb5b9996cb38aed72d12317 Mon Sep 17 00:00:00 2001 From: "Salvador E. Tropea" Date: Thu, 17 Feb 2022 12:47:01 -0300 Subject: [PATCH] Configured falke8 for pre-commit --- .pre-commit-config.yaml | 12 +++++++----- Makefile | 3 +-- setup.cfg | 10 ---------- 3 files changed, 8 insertions(+), 17 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 61f51fd7..048af334 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -26,6 +26,7 @@ repos: - id: end-of-file-fixer - id: trailing-whitespace - id: check-json + stages: [manual] - id: mixed-line-ending - id: check-builtin-literals - id: check-merge-conflict @@ -58,11 +59,12 @@ repos: rev: v0.3.1 hooks: - id: autoflake8 -# Flake8 is run outside and here the config doesn't work -# - repo: https://github.com/PyCQA/flake8 -# rev: 3.9.2 -# hooks: -# - id: flake8 + - repo: https://github.com/PyCQA/flake8 + rev: 3.9.2 + hooks: + - id: flake8 + exclude: ^kibot/mcpyrate/ + args: [--config, .flake8, --count, --statistics] # Sorting imports is dangerous. # - repo: https://github.com/PyCQA/isort # rev: 5.10.1 diff --git a/Makefile b/Makefile index 9ceaf265..671652a3 100644 --- a/Makefile +++ b/Makefile @@ -28,10 +28,9 @@ lint: doc ln -sf src/kibot kibot.py # stop the build if there are Python syntax errors or undefined names flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics - flake8 . --count --statistics + pre-commit run -a rm kiplot.py rm kibot.py - pre-commit run -a test_tmp: lint $(PY_COV) erase diff --git a/setup.cfg b/setup.cfg index f35c1527..d0aa6aa3 100644 --- a/setup.cfg +++ b/setup.cfg @@ -17,16 +17,6 @@ in-place = True recursive = True expand-star-imports = True -[flake8] -ignore = E402, E226, E126, W504 -max-line-length = 127 -max-complexity = 21 -exclude = - experiments/kicad/v6/ - experiments/JLC/ - kibot/mcpyrate/ - submodules/ - [codespell] ignore-words-list=kibot,tht quiet-level = 2