From c0873f4343ff34dfd3e0b3cc33f19d877b097c72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Thu, 8 May 2025 17:30:44 +0200 Subject: [PATCH] ruff: Use all rules but some --- hm/dev/python.nix | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/hm/dev/python.nix b/hm/dev/python.nix index d03e511..4d9ec18 100644 --- a/hm/dev/python.nix +++ b/hm/dev/python.nix @@ -22,16 +22,29 @@ ruff = { enable = true; settings = { + target-version = "py311"; # Matches Debian 12 + line-length = 79; # writePython3 enforces PEP-8 lint = { - select = [ - # Original - "F" # pyflakes - "I" # isort - "C90" # mccabe (complexity) - "E" # pycodestyle error - "W" # pycodestyle warning - "PL" # pylint + select = [ "ALL" ]; + ignore = [ + # Things that don't teach me to write better Python + "CPY" # Copyright + "D1" # missing docstring + "ERA" # commented out code + "FIX002" # enforce TODOs + "T20" # print + "TD" # TODOs convention + "INP" # missing __init__.py + "S603" # subproces untrusted input (broken?) + "S101" # asserts + # Allow nix-shell + "EXE003" + "EXE005" + # Conflict with formatter + "COM" + "ISC001" ]; + pydocstyle.convention = "pep257"; }; }; };