Skip to content

Commit

Permalink
dev: remove flakehell
Browse files Browse the repository at this point in the history
Remove the outdated flakehell library and move flake8 config to .flake8.

Bug: T323323
Change-Id: Ie61b68ba0cf1caf00090247863d6278231b89f45
  • Loading branch information
bd808 committed Dec 12, 2022
1 parent cbd1f10 commit 2f7fb2a
Show file tree
Hide file tree
Showing 9 changed files with 203 additions and 1,098 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
*

# Conditionally include things we know we want in the container
!.flake8
# Copy .git/refs/heads/* into the container
!.git
.git/*
Expand Down
47 changes: 47 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,51 @@
# See <https://gitlab.com/pycqa/flake8/-/issues/428> for details

[flake8]
exclude =
.git,
__pycache__,
docs,
manage.py,
migrations,
node_modules
format = grouped
max-line-length = 79
show-source = true
flake8-import-order = appnexus
select = E,F,W,C90,D,R,B,B9
extend-ignore =
# disable all "convention" rules
C*,
# missing-docstring-in-public-module
D100,
# missing-docstring-in-magic-method
D105,
# first-line-should-end-with-period
D400,
# first-line-should-be-in-imperative-mood
D401,
# line-too-long
E501,
# no-member
E1101,
# could-be-function
R201,
# too-many-ancestors
R901,
# too-few-public-methods
R903,
# too-many-return-statements
R911,
# too-many-arguments
R913,
# useless-super-delegation
W235,
# line-break-before-binary-operator
W503,
# line-break-after-binary-operator
W504,
# fixme
W511
per-file-ignores =
# missing docstring in public package
__init__.py: D104
2 changes: 1 addition & 1 deletion .pipeline/blubber.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ variants:
- -c
- >-
poetry check &&
poetry run flakehell lint &&
poetry run flake8 &&
poetry run black --check --diff . &&
poetry run bandit -ii -r toolhub/
Expand Down
2 changes: 1 addition & 1 deletion .pipeline/dev-nodejs.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ COPY --chown=$LIVES_UID:$LIVES_GID [".git/", "./.git/"]
ENV NODE_ENV="development"
ENTRYPOINT ["/usr/bin/env"]

LABEL blubber.variant="dev-nodejs" blubber.version="0.9.0+6331215"
LABEL blubber.variant="dev-nodejs" blubber.version="0.9.0+2638669"
2 changes: 1 addition & 1 deletion .pipeline/local-python.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@ RUN poetry "install" "--no-root"
COPY --chown=$LIVES_UID:$LIVES_GID [".", "."]
COPY --chown=$LIVES_UID:$LIVES_GID --from=dockerize ["/srv/dockerize", "/srv/dockerize"]

LABEL blubber.variant="local-python" blubber.version="0.9.0+6331215"
LABEL blubber.variant="local-python" blubber.version="0.9.0+2638669"
2 changes: 1 addition & 1 deletion .pipeline/oauth-client.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ USER $RUNS_UID
ENV HOME="/home/$RUNS_AS"
ENTRYPOINT ["/bin/bash", "-c", "poetry run python3 -m flask run --host 0.0.0.0 --port 8000"]

LABEL blubber.variant="oauth-client" blubber.version="0.9.0+6331215"
LABEL blubber.variant="oauth-client" blubber.version="0.9.0+2638669"
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ test-python-lint: ## Run linter checks for Python code
docker-compose exec web sh -c " \
export HOME=/tmp/runtime-home; \
poetry check \
&& poetry run flakehell lint \
&& poetry run flake8 \
&& poetry run black --check --diff . \
&& poetry run bandit -ii -r toolhub/ \
"
Expand Down
1,192 changes: 147 additions & 1,045 deletions poetry.lock

Large diffs are not rendered by default.

51 changes: 3 additions & 48 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,23 +45,22 @@ rules = "^3.0"
django-csp = "^3.7"
django-prometheus = "2.1.0"
ecs-logging = "^1.0.1"
# Pin flake8 to 3.x pending https://github.com/flakehell/flakehell/pull/23
flake8 = "^3.9.2"
python-memcached = "^1.59"
elasticsearch = ">=7.10.0,<7.11.0"

[tool.poetry.dev-dependencies]
pytest = "^6.2.4"
flakehell = "^0.9.0"
black = "^22.3.0"
flake8 = "^3.9.2"
flake8-blind-except = "^0.2.0"
flake8-bugbear = "^21.4.3"
flake8-builtins = "^1.5.3"
flake8-comprehensions = "^3.2.3"
flake8-docstrings = "^1.5.0"
flake8-import-order = "^0.18.1"
flake8-import-single = "^0.1.5"
flake8-logging-format = "^0.6.0"
flake8-rst-docstrings = "^0.2.3"
flake8-comprehensions = "^3.2.3"
pytest-cov = "^2.10.1"
django-coverage-plugin = "^2.0.0"
bandit = "^1.6.2"
Expand All @@ -78,50 +77,6 @@ requests-mock = "^1.8.0"
Flask = "^2.0.1" # contrib/oauth-client-example
envparse = "^0.2.0" # contrib/oauth-client-example
Authlib = "^0.15.4" # contrib/oauth-client-example
flake8-import-single = "^0.1.5"

[tool.flakehell]
exclude = [
".git",
"__pycache__",
"docs",
"manage.py",
"migrations",
"node_modules",
]
format = "grouped"
max_line_length = 79
show_source = true
extended_default_ignore=[] # https://github.com/flakehell/flakehell/issues/10

[tool.flakehell.plugins]
"flake8-*" = ["+*"]
flake8-docstrings = [
"+*",
"-D100", # missing-docstring-in-public-module
"-D105", # missing-docstring-in-magic-method
"-D400", # first-line-should-end-with-period
"-D401", # first-line-should-be-in-imperative-mood
]
pycodestyle = [
"+*",
"-E501", # line-too-long
"-W503", # line-break-before-binary-operator
"-W504", # line-break-after-binary-operator
]
pyflakes = ["+*"]
pylint = [
"+*",
"-C*", # disable all "convention" rules
"-E1101", # no-member
"-R0201", # could-be-function
"-R0901", # too-many-ancestors
"-R0903", # too-few-public-methods
"-R0911", # too-many-return-statements
"-R0913", # too-many-arguments
"-W0235", # useless-super-delegation
"-W0511", # fixme
]

[tool.pylint]

Expand Down

0 comments on commit 2f7fb2a

Please sign in to comment.