Skip to content

Commit

Permalink
🧪💅 Move flake8 to pre-commit config
Browse files Browse the repository at this point in the history
  • Loading branch information
webknjaz committed Jan 16, 2024
1 parent 9f47a57 commit 3598ca9
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 21 deletions.
9 changes: 9 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,15 @@ repos:
args:
- --strict

- repo: https://github.com/PyCQA/flake8.git
rev: 6.1.0
hooks:
- id: flake8
alias: flake8-no-wps
name: flake8 WPS-excluded
additional_dependencies:
- flake8-pyi ~= 22.11.0

- repo: local
hooks:
- id: top-level-tests-init-py
Expand Down
19 changes: 3 additions & 16 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Some simple testing tasks (sorry, UNIX only).
.PHONY: all build flake test vtest cov clean doc
.PHONY: all build test vtest cov clean doc


PYXS = $(wildcard multidict/*.pyx)
Expand All @@ -11,16 +11,6 @@ all: test
pip install -r requirements/dev.txt
@touch .install-deps

.flake: .install-deps $(shell find multidict -type f) \
$(shell find tests -type f)
flake8 multidict tests
@if ! isort --check multidict tests; then \
echo "Import sort errors, run 'make fmt' to fix them!!!"; \
isort --diff --check multidict tests; \
false; \
fi
@touch .flake


isort-check:
@if ! isort --check $(SRC); then \
Expand All @@ -29,24 +19,21 @@ isort-check:
false; \
fi

flake8:
flake8 $(SRC)

black-check:
@if ! isort --check $(SRC); then \
echo "black errors, run 'make fmt' to fix them!!!"; \
black -t py35 --diff --check $(SRC); \
false; \
fi

lint: flake8 black-check isort-check
lint: black-check isort-check
python -Im pre_commit run --all-files --show-diff-on-failure

fmt:
black -t py35 $(SRC)
isort $(SRC)

.develop: .install-deps $(shell find multidict -type f) .flake
.develop: .install-deps $(shell find multidict -type f)
pip install -e .
@touch .develop

Expand Down
4 changes: 1 addition & 3 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
from contextlib import suppress
from pathlib import Path

import alabaster
from sphinx.addnodes import pending_xref
from sphinx.application import Sphinx
from sphinx.environment import BuildEnvironment
Expand Down Expand Up @@ -60,9 +61,6 @@
except IndexError:
raise RuntimeError("Unable to determine version.")


import alabaster

# -- General configuration ------------------------------------------------

# If your documentation needs a minimal Sphinx version, state it here.
Expand Down
2 changes: 0 additions & 2 deletions requirements/lint.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
-r ci.txt

flake8==6.0.0
flake8-pyi==22.11.0
black==23.12.1
isort==5.13.2
pre-commit==3.5.0

0 comments on commit 3598ca9

Please sign in to comment.