From 06a28ba9df6a57228fbc796e99f006ef1e1980ef Mon Sep 17 00:00:00 2001 From: Christophe Bornet Date: Thu, 1 Aug 2024 14:29:44 +0200 Subject: [PATCH] Configure ruff by allowing all rules and then exclude some --- libs/knowledge-graph/pyproject.toml | 57 ++++------------------------ pyproject.toml | 58 ++++------------------------- 2 files changed, 14 insertions(+), 101 deletions(-) diff --git a/libs/knowledge-graph/pyproject.toml b/libs/knowledge-graph/pyproject.toml index e341b7159..38c1fdbea 100644 --- a/libs/knowledge-graph/pyproject.toml +++ b/libs/knowledge-graph/pyproject.toml @@ -62,71 +62,28 @@ target-version = "py311" [tool.ruff.lint] pydocstyle.convention = "google" +select = ["ALL"] ignore = [ + "ANN", # Do we want to activate (type hints) ? + "C90", # Do we want to activate (complexity) ? "COM812", # Messes with the formatter "D100", # Do we want to activate (docstring in module) ? "D104", # Do we want to activate (docstring in package) ? "D105", # Do we want to activate (docstring in magic method) ? "D107", # Do we want to activate (docstring in __init__) ? + "EM", # Do we want to activate (error messages) ? "ERA", # Do we want to activate (no commented code) ? + "FBT", # Do we want to activate (boolean trap) ? + "FIX", # Do we want to activate (no fix-me) ? "ISC001", # Messes with the formatter "PERF203", # Incorrect detection "PLR09", # TODO: do we enforce these ones (complexity) ? + "PTH", # Do we want to activate (use pathlib) ? "TRY003", # A bit too strict ? "TD002", # We know the TODOs authors with git. Activate anyway ? "TD003", # Do we want to activate (TODOs with issue reference) ? ] -select = [ - "A", - "ARG", - "ASYNC", - "B", - "BLE", - "C4", - "COM", - "D", - "DTZ", - "E", - "EXE", - "F", - "FLY", - "FURB", - "G", - "I", - "ICN", - "INP", - "INT", - "ISC", - "LOG", - "N", - "NPY", - "PD", - "PERF", - "PGH", - "PIE", - "PL", - "PT", - "PYI", - "Q", - "RET", - "RSE", - "RUF", - "S", - "SIM", - "SLF", - "SLOT", - "T10", - "T20", - "TCH", - "TD", - "TID", - "TRY", - "UP", - "W", - "YTT", -] - [tool.ruff.lint.per-file-ignores] "tests/*" = [ "D", diff --git a/pyproject.toml b/pyproject.toml index fe5283fa9..085c751c1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -59,72 +59,28 @@ extend-include = ["*.ipynb"] [tool.ruff.lint] pydocstyle.convention = "google" +select = ["ALL"] ignore = [ + "ANN", # Do we want to activate (type hints) ? + "C90", # Do we want to activate (complexity) ? "COM812", # Messes with the formatter "D100", # Do we want to activate (docstring in module) ? "D104", # Do we want to activate (docstring in package) ? "D105", # Do we want to activate (docstring in magic method) ? "D107", # Do we want to activate (docstring in __init__) ? + "EM", # Do we want to activate (error messages) ? "ERA", # Do we want to activate (no commented code) ? + "FBT", # Do we want to activate (boolean trap) ? + "FIX", # Do we want to activate (no fix-me) ? "ISC001", # Messes with the formatter "PERF203", # Incorrect detection "PLR09", # TODO: do we enforce these ones (complexity) ? + "PTH", # Do we want to activate (use pathlib) ? "TRY003", # A bit too strict ? "TD002", # We know the TODOs authors with git. Activate anyway ? "TD003", # Do we want to activate (TODOs with issue reference) ? ] -select = [ - "A", - "ARG", - "ASYNC", - "B", - "BLE", - "C4", - "COM", - "D", - "DTZ", - "E", - "EXE", - "F", - "FA", - "FLY", - "FURB", - "G", - "I", - "ICN", - "INP", - "INT", - "ISC", - "LOG", - "N", - "NPY", - "PD", - "PERF", - "PGH", - "PIE", - "PL", - "PT", - "PYI", - "Q", - "RET", - "RSE", - "RUF", - "S", - "SIM", - "SLF", - "SLOT", - "T10", - "T20", - "TCH", - "TD", - "TID", - "TRY", - "UP", - "W", - "YTT", -] - [tool.ruff.lint.per-file-ignores] "libs/langchain/*" = [ "UP006", # Incompatible with Pydantic v1