]> git.ipfire.org Git - thirdparty/fastapi/fastapi.git/commitdiff
🔧 Fix Ruff configuration unintentionally enabling and re-disabling mccabe complexity...
authorJiri Daněk <jdanek@redhat.com>
Fri, 12 Jan 2024 15:01:06 +0000 (16:01 +0100)
committerGitHub <noreply@github.com>
Fri, 12 Jan 2024 15:01:06 +0000 (16:01 +0100)
Fix mistake in Ruff configuration unintentionally enabling mccabe complexity check

Enabling "C" turns on complexity checks (C90, mccabe), which is unintended
Instead, enable "C4" to get flake8-comprehensions checks

See docs at https://docs.astral.sh/ruff/rules/#flake8-comprehensions-c4

Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
pyproject.toml

index 8e7f8bbbe5914344758bce7f3babef7efec08004..3e43f35e17cac3a3af50861de4e5d5cd8b4d7870 100644 (file)
@@ -145,15 +145,14 @@ select = [
     "W",  # pycodestyle warnings
     "F",  # pyflakes
     "I",  # isort
-    "C",  # flake8-comprehensions
     "B",  # flake8-bugbear
+    "C4",  # flake8-comprehensions
     "UP",  # pyupgrade
 ]
 ignore = [
     "E501",  # line too long, handled by black
     "B008",  # do not perform function calls in argument defaults
-    "C901",  # too complex
-    "W191", # indentation contains tabs
+    "W191",  # indentation contains tabs
 ]
 
 [tool.ruff.per-file-ignores]