From 28a481fff738747ad41107b7ed1afe031e829d96 Mon Sep 17 00:00:00 2001 From: Isaac To Date: Mon, 11 Nov 2024 12:11:47 -0800 Subject: [PATCH] fix: provide a basic configuration for Ruff This reduces the number of complaints from Ruff significantly --- pyproject.toml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 83efe3b..e3a76a8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -88,3 +88,25 @@ skip = '.git*' check-hidden = true # ignore-regex = '' # ignore-words-list = '' + +[tool.ruff] +line-length = 88 +indent-width = 4 +[tool.ruff.lint] +ignore = [ + # Avoid use of `from __future__ import annotations` + # because it causes problem with Typer + "FA100" +] +[tool.ruff.lint.per-file-ignores] +"**/tests/**/*" = [ + # === defaults recommended by hatch === + # https://hatch.pypa.io/latest/config/internal/static-analysis/#per-file-ignored-rules + "PLC1901", + "PLR2004", + "PLR6301", + "S", + "TID252", + # Allow access to protected members in tests + "SLF001", +]