From 38ac489d44add26ea4b0ffacb9bb11ad1972ed96 Mon Sep 17 00:00:00 2001 From: Patrick Ogenstad Date: Tue, 18 Nov 2025 15:46:38 +0100 Subject: [PATCH] Update ruleset for shadowing builtins --- pyproject.toml | 14 +++++++++++++- tests/unit/sdk/test_yaml.py | 6 +++--- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 4a67fbf0..f2d633f2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -176,7 +176,6 @@ ignore = [ "G", # flake8-logging-format "RSE", # flake8-raise "BLE", # flake8-blind-except (BLE) - "A", # flake8-builtins ################################################################################################## # The ignored rules below should be removed once the code has been updated, they are included # @@ -230,6 +229,19 @@ indent-style = "space" skip-magic-trailing-comma = false line-ending = "auto" + +[tool.ruff.lint.flake8-builtins] +ignorelist = [ + "id", + # Review and update builtin shadowing below this line + "filter", + "format", + "input", + "list", + "property", +] + + [tool.ruff.lint.isort] known-first-party = ["infrahub_sdk", "infrahub_ctl"] diff --git a/tests/unit/sdk/test_yaml.py b/tests/unit/sdk/test_yaml.py index 9835ae40..e99ba6fc 100644 --- a/tests/unit/sdk/test_yaml.py +++ b/tests/unit/sdk/test_yaml.py @@ -11,12 +11,12 @@ def test_read_missing_file() -> None: file_name = "i_do_not_exist.yml" - dir = here / "test_data" - full_path = dir / file_name + test_data_dir = here / "test_data" + full_path = test_data_dir / file_name yaml_file = YamlFile(location=full_path) yaml_file.load_content() assert not yaml_file.valid - assert yaml_file.error_message == f"{file_name}: not found at {dir}" + assert yaml_file.error_message == f"{file_name}: not found at {test_data_dir}" def test_read_incorrect_encoding() -> None: