add Autoflake linting

This commit is contained in:
ducklet 2023-02-03 22:10:11 +01:00
parent 418116afac
commit 8e1988eea2
3 changed files with 41 additions and 8 deletions

29
poetry.lock generated
View file

@ -52,6 +52,21 @@ docs = ["furo", "myst-parser", "sphinx", "sphinx-notfound-page", "sphinxcontrib-
tests = ["attrs[tests-no-zope]", "zope.interface"] tests = ["attrs[tests-no-zope]", "zope.interface"]
tests-no-zope = ["cloudpickle", "cloudpickle", "hypothesis", "hypothesis", "mypy (>=0.971,<0.990)", "mypy (>=0.971,<0.990)", "pympler", "pympler", "pytest (>=4.3.0)", "pytest (>=4.3.0)", "pytest-mypy-plugins", "pytest-mypy-plugins", "pytest-xdist[psutil]", "pytest-xdist[psutil]"] tests-no-zope = ["cloudpickle", "cloudpickle", "hypothesis", "hypothesis", "mypy (>=0.971,<0.990)", "mypy (>=0.971,<0.990)", "pympler", "pympler", "pytest (>=4.3.0)", "pytest (>=4.3.0)", "pytest-mypy-plugins", "pytest-mypy-plugins", "pytest-xdist[psutil]", "pytest-xdist[psutil]"]
[[package]]
name = "autoflake"
version = "2.0.1"
description = "Removes unused imports and unused variables"
category = "main"
optional = false
python-versions = ">=3.7"
files = [
{file = "autoflake-2.0.1-py3-none-any.whl", hash = "sha256:143b0843667734af53532c443e950c787316b9b1155b2273558260b44836e8e4"},
{file = "autoflake-2.0.1.tar.gz", hash = "sha256:1ce520131b7f396915242fe91e57221f4d42408529bbe3ae93adafed286591e0"},
]
[package.dependencies]
pyflakes = ">=3.0.0"
[[package]] [[package]]
name = "beautifulsoup4" name = "beautifulsoup4"
version = "4.11.2" version = "4.11.2"
@ -515,6 +530,18 @@ files = [
dev = ["pre-commit", "tox"] dev = ["pre-commit", "tox"]
testing = ["pytest", "pytest-benchmark"] testing = ["pytest", "pytest-benchmark"]
[[package]]
name = "pyflakes"
version = "3.0.1"
description = "passive checker of Python programs"
category = "main"
optional = false
python-versions = ">=3.6"
files = [
{file = "pyflakes-3.0.1-py2.py3-none-any.whl", hash = "sha256:ec55bf7fe21fff7f1ad2f7da62363d749e2a470500eab1b555334b67aa1ef8cf"},
{file = "pyflakes-3.0.1.tar.gz", hash = "sha256:ec8b276a6b60bd80defed25add7e439881c19e64850afd9b346283d4165fd0fd"},
]
[[package]] [[package]]
name = "pyright" name = "pyright"
version = "1.1.292" version = "1.1.292"
@ -806,4 +833,4 @@ files = [
[metadata] [metadata]
lock-version = "2.0" lock-version = "2.0"
python-versions = "^3.11" python-versions = "^3.11"
content-hash = "5406c84bd8bd69384b125fbcb104f855df4530427a9568b72f5d623853d5b593" content-hash = "38adf8f83af28cc5d2fcc4a17dbfed2ec1026d7c297a3af8be350669790635cb"

View file

@ -14,12 +14,7 @@ starlette = "^0.23.1"
ulid-py = "^1.1.0" ulid-py = "^1.1.0"
databases = {extras = ["sqlite"], version = "^0.7.0"} databases = {extras = ["sqlite"], version = "^0.7.0"}
uvicorn = "^0.20.0" uvicorn = "^0.20.0"
autoflake = "^2.0.1"
# [tool.poetry.group.fixes.dependencies]
# # `databases` is having issues with new versions of SQLAlchemy 1.4,
# # and `greenlet` is also always a pain.
# SQLAlchemy = "1.4.25"
# greenlet = "1.1.2"
[tool.poetry.group.dev] [tool.poetry.group.dev]
optional = true optional = true
@ -37,3 +32,13 @@ build-backend = "poetry.core.masonry.api"
[tool.pyright] [tool.pyright]
pythonVersion = "3.11" pythonVersion = "3.11"
[tool.isort]
profile = "black"
[tool.autoflake]
remove-duplicate-keys = true
remove-unused-variables = true
remove-all-unused-imports = true
ignore-init-module-imports = true
ignore-pass-after-docstring = true

View file

@ -4,6 +4,7 @@ cd "$RUN_DIR"
[ -z "${DEBUG:-}" ] || set -x [ -z "${DEBUG:-}" ] || set -x
isort --profile black unwind autoflake --quiet --check --recursive unwind
isort unwind
black unwind black unwind
pyright pyright