From f06f1cc8b25f425862d6af872ca3852224648520 Mon Sep 17 00:00:00 2001 From: Sakarias Johansson Date: Mon, 12 Feb 2024 19:37:15 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9A=A1=20Change=20ruff=20conf?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We added ruff but missed some configuration. Added a more to make it pick up problems similarly to the alternative --- CHANGELOG.md | 4 ++++ python/hooks/config/ruff.toml | 41 ++++++++++++++++++++++++++++++++++- 2 files changed, 44 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index eb00294..5e76078 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Changed +- Ruff default configuration. Now picks upp issues similar to to the + alternative (isort, black, flake etc). + ## [3.1.0] - 2024-02-08 ### Added diff --git a/python/hooks/config/ruff.toml b/python/hooks/config/ruff.toml index 37096b6..f9c28d4 100644 --- a/python/hooks/config/ruff.toml +++ b/python/hooks/config/ruff.toml @@ -1,2 +1,41 @@ [tool.ruff] -select=[ "E4", "E7", "E9", "F", "PLE", "PLW" ] +select=[ + "A", + "ARG", + "BLE", + "C4", + "E", + "E4", + "E7", + "E9", + "EXE", + "F", + "ISC", + "PLC", + "PLE", + "PLW", + "RSE", + "RET", + "S", + "SLF", + "SIM", + "TID", + "UP", + "W", +] + +[tool.ruff.lint] +ignore = [ + "ISC001" # The following rules may cause conflicts when used with the formatter +] + +[tool.ruff.lint.per-file-ignores] +"tests/*" = [ + "SLF001", # Common to access private members in order to mock things. + "S101", # Allowed to use asserts in tests +] +"test_*" = [ + "SLF001", # Common to access private members in order to mock things. + "S101", # Allowed to use asserts in tests +] +