From 38dd7ad19ffddee9b596d57ca78821dfc43b4c50 2024-12-25 18:33:33 From: M Bussonnier Date: 2024-12-25 18:33:33 Subject: [PATCH] Merge branch 'main' into revert-14625-ruffisation --- diff --git a/pyproject.toml b/pyproject.toml index 0837a0e..db8900b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -382,4 +382,63 @@ version = {attr = "IPython.core.release.__version__"} omit = [ # omit everything in /tmp as we run tempfile "/tmp/*", - ] +] + +[tool.ruff.lint] +extend-select = [ + # "B", # flake8-bugbear + # "I", # isort + # that will be a problem for pytest fixture unless you swap with the usefixture decorator https://docs.pytest.org/en/7.1.x/how-to/fixtures.html#use-fixtures-in-classes-and-modules-with-usefixtures + # "ARG", # flake8-unused-arguments + # "C4", # flake8-comprehensions + # "EM", # flake8-errmsg + # "ICN", # flake8-import-conventions + # "G", # flake8-logging-format + # "PGH", # pygrep-hooks + # "PIE", # flake8-pie + # "PL", # pylint + # "PTH", # flake8-use-pathlib + # "PT", # flake8-pytest-style + # "RET", # flake8-return + # "RUF", # Ruff-specific + # "SIM", # flake8-simplify + # "T20", # flake8-print + # "UP", # pyupgrade + # "YTT", # flake8-2020 + # "EXE", # flake8-executable + # "PYI", # flake8-pyi + # "S", # flake8-bandit +] +ignore = [ + # "E501", # E501 Line too long (158 > 100 characters) + # "SIM105", # SIM105 Use `contextlib.suppress(...)` + # "PLR", # Design related pylint codes + # "S101", # Use of `assert` detected + "E712", # 1 + "E713", # 1 + "E902", # 2 + "E702", # 3 + "E721", # 3 + "E401", # 5 + "E711", # 14 Comparison to `None` should be `cond is None` + "E701", # 19 Multiple statements on one line (colon) + "E741", # 25 Ambiguous variable name: `` + "E731", # 27 Do not assign a `lambda` expression, use a `def` + "E402", # 28 Module level import not at top of file + "E722", # 75 Do not use bare `except` + "F523", # 1 + "F811", # 3 + "F403", # 7 + "F841", # 38 Local variable `...` is assigned to but never used + "F401", # 69 imported but unused + "F821", # 624 F821 Undefined name +] +unfixable = [ + # Don't touch print statements + "T201", + # Don't touch noqa lines + "RUF100", +] + +[tool.ruff] +extend-exclude = ["tests"]