From 605f90580f80ce79ab6280d49ddb67d0d9fed2cb Mon Sep 17 00:00:00 2001 From: Ahmed Abdelsalam Date: Wed, 21 Aug 2024 17:42:15 +0200 Subject: [PATCH] Change: Replace pylint with ruff --- poetry.lock | 43 +++++++++++++++++++++++++++++++++++-------- pyproject.toml | 11 +++++++++-- 2 files changed, 44 insertions(+), 10 deletions(-) diff --git a/poetry.lock b/poetry.lock index 09ffa4fb..cb853355 100644 --- a/poetry.lock +++ b/poetry.lock @@ -86,19 +86,19 @@ autohooks = ">=21.6.0" black = ">=20.8" [[package]] -name = "autohooks-plugin-pylint" -version = "23.10.0" -description = "An autohooks plugin for python code linting via pylint" +name = "autohooks-plugin-ruff" +version = "24.1.0" +description = "An autohooks plugin for python code formatting via ruff" optional = false python-versions = ">=3.9,<4.0" files = [ - {file = "autohooks_plugin_pylint-23.10.0-py3-none-any.whl", hash = "sha256:49e1e60b81f48ca17d55a6660bff9aae0e9bd8cda2ec6f4ef1237b2f86475682"}, - {file = "autohooks_plugin_pylint-23.10.0.tar.gz", hash = "sha256:ed2f82ba89d28f772562794734eb37ae630b7a3011526e9cdfc13240865b0359"}, + {file = "autohooks_plugin_ruff-24.1.0-py3-none-any.whl", hash = "sha256:2a072805b60abb63311abab84a6600cde9112840ab68f39af53f517648341651"}, + {file = "autohooks_plugin_ruff-24.1.0.tar.gz", hash = "sha256:1a8dd732a2e7215c1c66faa79ac499195859c499af7ce52284ee6003ece4f25c"}, ] [package.dependencies] -autohooks = ">=2.2.0" -pylint = ">=2.8.3" +autohooks = ">=23.4.0" +ruff = ">=0.0.272" [[package]] name = "black" @@ -1722,6 +1722,33 @@ dev = ["build (>=0.7.0)", "pre-commit (>=2.20.0)", "pytest (>=7.0.1)", "pytest-c doc = ["pytoolconfig[doc]", "sphinx (>=4.5.0)", "sphinx-autodoc-typehints (>=1.18.1)", "sphinx-rtd-theme (>=1.0.0)"] release = ["pip-tools (>=6.12.1)", "toml (>=0.10.2)", "twine (>=4.0.2)"] +[[package]] +name = "ruff" +version = "0.6.1" +description = "An extremely fast Python linter and code formatter, written in Rust." +optional = false +python-versions = ">=3.7" +files = [ + {file = "ruff-0.6.1-py3-none-linux_armv6l.whl", hash = "sha256:b4bb7de6a24169dc023f992718a9417380301b0c2da0fe85919f47264fb8add9"}, + {file = "ruff-0.6.1-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:45efaae53b360c81043e311cdec8a7696420b3d3e8935202c2846e7a97d4edae"}, + {file = "ruff-0.6.1-py3-none-macosx_11_0_arm64.whl", hash = "sha256:bc60c7d71b732c8fa73cf995efc0c836a2fd8b9810e115be8babb24ae87e0850"}, + {file = "ruff-0.6.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2c7477c3b9da822e2db0b4e0b59e61b8a23e87886e727b327e7dcaf06213c5cf"}, + {file = "ruff-0.6.1-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:3a0af7ab3f86e3dc9f157a928e08e26c4b40707d0612b01cd577cc84b8905cc9"}, + {file = "ruff-0.6.1-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:392688dbb50fecf1bf7126731c90c11a9df1c3a4cdc3f481b53e851da5634fa5"}, + {file = "ruff-0.6.1-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:5278d3e095ccc8c30430bcc9bc550f778790acc211865520f3041910a28d0024"}, + {file = "ruff-0.6.1-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:fe6d5f65d6f276ee7a0fc50a0cecaccb362d30ef98a110f99cac1c7872df2f18"}, + {file = "ruff-0.6.1-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b2e0dd11e2ae553ee5c92a81731d88a9883af8db7408db47fc81887c1f8b672e"}, + {file = "ruff-0.6.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d812615525a34ecfc07fd93f906ef5b93656be01dfae9a819e31caa6cfe758a1"}, + {file = "ruff-0.6.1-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:faaa4060f4064c3b7aaaa27328080c932fa142786f8142aff095b42b6a2eb631"}, + {file = "ruff-0.6.1-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:99d7ae0df47c62729d58765c593ea54c2546d5de213f2af2a19442d50a10cec9"}, + {file = "ruff-0.6.1-py3-none-musllinux_1_2_i686.whl", hash = "sha256:9eb18dfd7b613eec000e3738b3f0e4398bf0153cb80bfa3e351b3c1c2f6d7b15"}, + {file = "ruff-0.6.1-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:c62bc04c6723a81e25e71715aa59489f15034d69bf641df88cb38bdc32fd1dbb"}, + {file = "ruff-0.6.1-py3-none-win32.whl", hash = "sha256:9fb4c4e8b83f19c9477a8745e56d2eeef07a7ff50b68a6998f7d9e2e3887bdc4"}, + {file = "ruff-0.6.1-py3-none-win_amd64.whl", hash = "sha256:c2ebfc8f51ef4aca05dad4552bbcf6fe8d1f75b2f6af546cc47cc1c1ca916b5b"}, + {file = "ruff-0.6.1-py3-none-win_arm64.whl", hash = "sha256:3bc81074971b0ffad1bd0c52284b22411f02a11a012082a76ac6da153536e014"}, + {file = "ruff-0.6.1.tar.gz", hash = "sha256:af3ffd8c6563acb8848d33cd19a69b9bfe943667f0419ca083f8ebe4224a3436"}, +] + [[package]] name = "semver" version = "3.0.2" @@ -2050,4 +2077,4 @@ tracking = ["sentry-sdk"] [metadata] lock-version = "2.0" python-versions = "^3.9" -content-hash = "6b715aebb104837cbe3aaced9d97bda24b8608e459c5018e10aaf091d076f54f" +content-hash = "fbfbaadf964d6a75f002d238511a9c9efa4acc8f6d8aa2c1353d89a254bb4d90" diff --git a/pyproject.toml b/pyproject.toml index c25462bf..5dadcea4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -39,7 +39,7 @@ pytest-cov = ">=4.0.0" pytest-django = ">=3.9" pytest-env = ">=0.8.1" autohooks = ">=23.1.0" -autohooks-plugin-pylint = ">=22.8.1" +autohooks-plugin-ruff = ">=24.1.0" autohooks-plugin-black = ">=22.11.0" rope = ">=0.17,<1.14" pontos = ">=21.6.3" @@ -64,9 +64,16 @@ exclude = ''' ''' [tool.autohooks] -pre-commit = ['autohooks.plugins.black', 'autohooks.plugins.pylint'] +pre-commit = ['autohooks.plugins.black', 'autohooks.plugins.ruff'] mode = "poetry" +[tool.ruff] +line-length = 80 +target-version = "py39" + +[tool.ruff.lint] +extend-select = ["I", "PLE", "PLW"] + [tool.pontos.version] version-module-file = "pheme/version/__version__.py"