diff --git a/.bandit.yaml b/.bandit.yaml deleted file mode 100644 index 6db076a1..00000000 --- a/.bandit.yaml +++ /dev/null @@ -1,3 +0,0 @@ -skips: - - B101 # Use of assert detected. - - B113 # Requests call without timeout. Done internally diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4258dba2..39c94a87 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -61,39 +61,24 @@ repos: rev: v0.1.8 hooks: - id: ripsecrets - - repo: https://github.com/PyCQA/autoflake - rev: v2.3.1 + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.8.1 hooks: - - id: autoflake - - repo: https://github.com/asottile/pyupgrade - rev: v3.19.0 - hooks: - - id: pyupgrade - args: - - --py39-plus - - repo: https://github.com/PyCQA/isort - rev: 5.13.2 - hooks: - - id: isort - # isort issue: https://github.com/PyCQA/isort/issues/1889 + - id: ruff-format args: - - --project=c2cwsgiutils - - repo: https://github.com/psf/black - rev: 24.10.0 - hooks: - - id: black - exclude: .*\.html + - --line-length=110 - repo: https://github.com/PyCQA/prospector rev: v1.13.3 hooks: - id: prospector args: - - --tool=pydocstyle + - --tool=ruff - --die-on-tool-error - --output-format=pylint additional_dependencies: - prospector-profile-duplicated==1.8.0 # pypi - - prospector-profile-utils==1.12.2 # pypi + - prospector-profile-utils==1.13.0 # pypi + - ruff==0.8.1 # pypi - repo: https://github.com/sbrunner/jsonschema-validator rev: 0.3.2 hooks: diff --git a/.prospector.yaml b/.prospector.yaml index 730e625d..8a509aaa 100644 --- a/.prospector.yaml +++ b/.prospector.yaml @@ -1,11 +1,11 @@ inherits: - utils:base - utils:no-design-checks + - utils:c2cwsgiutils - utils:fix + - utils:unsafe - duplicated -doc-warnings: true - ignore-paths: - docs - acceptance_tests @@ -16,24 +16,3 @@ pylint: extension-pkg-allow-list: - ujson - lxml - disable: - - no-else-return - - no-else-raise - - missing-module-docstring - - missing-timeout # A default timeout is set - -pydocstyle: - disable: - - D104 # Missing docstring in public package - - D105 # Missing docstring in magic method - - D107 # Missing docstring in __init__ - -pycodestyle: - disable: - # Buggy checks with Python 3.12 - - E221 # multiple spaces before operator - - E702 # multiple statements on one line (semicolon) - -bandit: - options: - config: .bandit.yaml diff --git a/poetry.lock b/poetry.lock index 7cda8b66..08abacbf 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1582,6 +1582,7 @@ pylint-flask = "0.6" pyroma = {version = ">=2.4", optional = true, markers = "extra == \"with-pyroma\" or extra == \"with_everything\""} PyYAML = "*" requirements-detector = ">=1.3.2" +ruff = {version = "*", optional = true, markers = "extra == \"with-ruff\" or extra == \"with_everything\""} setoptconf-tmp = ">=0.3.1,<0.4.0" toml = ">=0.10.2,<0.11.0" @@ -2167,6 +2168,33 @@ typing-extensions = {version = ">=4.0.0,<5.0", markers = "python_version < \"3.1 [package.extras] jupyter = ["ipywidgets (>=7.5.1,<9)"] +[[package]] +name = "ruff" +version = "0.8.1" +description = "An extremely fast Python linter and code formatter, written in Rust." +optional = false +python-versions = ">=3.7" +files = [ + {file = "ruff-0.8.1-py3-none-linux_armv6l.whl", hash = "sha256:fae0805bd514066f20309f6742f6ee7904a773eb9e6c17c45d6b1600ca65c9b5"}, + {file = "ruff-0.8.1-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:b8a4f7385c2285c30f34b200ca5511fcc865f17578383db154e098150ce0a087"}, + {file = "ruff-0.8.1-py3-none-macosx_11_0_arm64.whl", hash = "sha256:cd054486da0c53e41e0086e1730eb77d1f698154f910e0cd9e0d64274979a209"}, + {file = "ruff-0.8.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2029b8c22da147c50ae577e621a5bfbc5d1fed75d86af53643d7a7aee1d23871"}, + {file = "ruff-0.8.1-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:2666520828dee7dfc7e47ee4ea0d928f40de72056d929a7c5292d95071d881d1"}, + {file = "ruff-0.8.1-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:333c57013ef8c97a53892aa56042831c372e0bb1785ab7026187b7abd0135ad5"}, + {file = "ruff-0.8.1-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:288326162804f34088ac007139488dcb43de590a5ccfec3166396530b58fb89d"}, + {file = "ruff-0.8.1-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:b12c39b9448632284561cbf4191aa1b005882acbc81900ffa9f9f471c8ff7e26"}, + {file = "ruff-0.8.1-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:364e6674450cbac8e998f7b30639040c99d81dfb5bbc6dfad69bc7a8f916b3d1"}, + {file = "ruff-0.8.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b22346f845fec132aa39cd29acb94451d030c10874408dbf776af3aaeb53284c"}, + {file = "ruff-0.8.1-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:b2f2f7a7e7648a2bfe6ead4e0a16745db956da0e3a231ad443d2a66a105c04fa"}, + {file = "ruff-0.8.1-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:adf314fc458374c25c5c4a4a9270c3e8a6a807b1bec018cfa2813d6546215540"}, + {file = "ruff-0.8.1-py3-none-musllinux_1_2_i686.whl", hash = "sha256:a885d68342a231b5ba4d30b8c6e1b1ee3a65cf37e3d29b3c74069cdf1ee1e3c9"}, + {file = "ruff-0.8.1-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:d2c16e3508c8cc73e96aa5127d0df8913d2290098f776416a4b157657bee44c5"}, + {file = "ruff-0.8.1-py3-none-win32.whl", hash = "sha256:93335cd7c0eaedb44882d75a7acb7df4b77cd7cd0d2255c93b28791716e81790"}, + {file = "ruff-0.8.1-py3-none-win_amd64.whl", hash = "sha256:2954cdbe8dfd8ab359d4a30cd971b589d335a44d444b6ca2cb3d1da21b75e4b6"}, + {file = "ruff-0.8.1-py3-none-win_arm64.whl", hash = "sha256:55873cc1a473e5ac129d15eccb3c008c096b94809d693fc7053f588b67822737"}, + {file = "ruff-0.8.1.tar.gz", hash = "sha256:3583db9a6450364ed5ca3f3b4225958b24f78178908d5c4bc0f46251ccca898f"}, +] + [[package]] name = "scikit-image" version = "0.24.0" @@ -3044,4 +3072,4 @@ webserver = ["SQLAlchemy", "SQLAlchemy-Utils", "cornice", "gunicorn", "prometheu [metadata] lock-version = "2.0" python-versions = ">=3.10,<4.0" -content-hash = "b2092bc0272300c7b2e64d8b6d7487ca6c67b889fb2b881f0c459440d8350849" +content-hash = "98a6222be2148c3e64045b36bf041f207ead7a04c7b971475439f9e4eae83de6" diff --git a/pyproject.toml b/pyproject.toml index 64208d42..9935a8fb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -172,7 +172,7 @@ test_images = ["scikit-image"] [tool.poetry.group.dev.dependencies] # pylint = { version = "2.15.6" } -prospector = { extras = ["with_bandit", "with_mypy", "with_pyroma"], version = "1.13.3" } +prospector = { version = "1.13.3", extras = ["with_bandit", "with_mypy", "with_pyroma", "with_ruff"] } prospector-profile-duplicated = "1.8.0" prospector-profile-utils = "1.14.0" coverage = "7.6.8"