mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
This gives developers the ability to import models without importing them directly from their module: from aurweb.models import Ban, AccountType This provides more conciseness: from aurweb import models def some_func(ban: models.Ban): pass def some_other_func(user: models.User): pass This more aligns with a Django-style of core model bases. NOTE: Docker images must be rebuilt with this change, as setup.cfg has changed. Old Docker images will cause flake8 violation reports. Signed-off-by: Kevin Morris <kevr@0cost.org>
40 lines
1.2 KiB
INI
40 lines
1.2 KiB
INI
[pycodestyle]
|
|
max-line-length = 127
|
|
ignore = E741, W503
|
|
|
|
[flake8]
|
|
max-line-length = 127
|
|
max-complexity = 10
|
|
|
|
# Ignore some unavoidable flake8 warnings; we know this is against
|
|
# PEP8, but some of the existing codebase uses `I` variables,
|
|
# so specifically silence warnings about it in pre-defined files.
|
|
#
|
|
# In E741, the 'I', 'O', 'l' are ambiguous variable names.
|
|
# Our current implementation uses these variables through HTTP
|
|
# and the FastAPI form specification wants them named as such.
|
|
#
|
|
# With {W503,W504}, PEP8 does not want us to break lines before
|
|
# or after a binary operator. We have many scripts that already
|
|
# do this, so we're ignoring it here.
|
|
ignore = E741, W503, W504
|
|
|
|
# aurweb/routers/accounts.py
|
|
# Ignore over-reaching complexity.
|
|
# TODO: This should actually be addressed so we do not ignore C901.
|
|
#
|
|
# test/test_ssh_pub_key.py
|
|
# E501 is detected due to our >127 width test constant. Ignore it.
|
|
# Due to this, line width should _always_ be looked at in code reviews.
|
|
# Anything like this should be questioned.
|
|
#
|
|
per-file-ignores =
|
|
aurweb/routers/accounts.py:C901
|
|
test/test_ssh_pub_key.py:E501
|
|
aurweb/routers/packages.py:E741
|
|
aurweb/models/__init__.py:F401
|
|
|
|
[isort]
|
|
line_length = 127
|
|
lines_between_types = 1
|
|
|