From bebf404dbe3edac314a923ed72cc0c9b1b03993b Mon Sep 17 00:00:00 2001 From: Diego OJ Date: Thu, 19 Nov 2026 19:47:54 -0300 Subject: [PATCH] Chore | Drop the F541 ignore now that #333 is merged The ignore kept these f-strings from conflicting with #333. Ruff's autofix turns the 11 placeholder-free f-strings in _backend_config.py into plain strings, unescaping {{ }}; the 7 error messages are unchanged. Co-Authored-By: Claude Opus 5.5 --- leverage/_backend_config.py | 22 +++++++++++----------- pyproject.toml | 2 -- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/leverage/_backend_config.py b/leverage/_backend_config.py index 0994fd8..678e752 100644 --- a/leverage/_backend_config.py +++ b/leverage/_backend_config.py @@ -53,13 +53,13 @@ def set_backend_key(config_file_path: Union[str, Path], key: str) -> None: ): raise ExitError( 1, - f"Malformed config.tf: File must contain a terraform block with an S3 backend. " - f"Expected structure:\n" - f"terraform {{\n" - f' backend "s3" {{\n' - f" # configuration\n" - f" }}\n" - f"}}", + "Malformed config.tf: File must contain a terraform block with an S3 backend. " + "Expected structure:\n" + "terraform {\n" + ' backend "s3" {\n' + " # configuration\n" + " }\n" + "}", ) # Check if key already exists @@ -157,9 +157,9 @@ def get_backend_key(config_file: Union[str, Path]) -> Optional[str]: else: raise ExitError( 1, - f"Malformed [bold]config.tf[/bold] file. Missing backend block.\n" - f"In some cases you may want to skip this check by using the --skip-validation flag, " - f"e.g. the first time you initialize a tf-backend layer.", + "Malformed [bold]config.tf[/bold] file. Missing backend block.\n" + "In some cases you may want to skip this check by using the --skip-validation flag, " + "e.g. the first time you initialize a tf-backend layer.", ) except lark.exceptions.UnexpectedInput as error: @@ -172,4 +172,4 @@ def get_backend_key(config_file: Union[str, Path]) -> Optional[str]: # Let our own, more specific errors (e.g. missing backend block) through untouched raise except Exception: - raise ExitError(1, f"Malformed [bold]config.tf[/bold] file. Unable to parse.") + raise ExitError(1, "Malformed [bold]config.tf[/bold] file. Unable to parse.") diff --git a/pyproject.toml b/pyproject.toml index f5f376f..0eda092 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -95,5 +95,3 @@ select = ["E4", "E7", "E9", "F"] # The package's public names, imported to be re-exported "leverage/__init__.py" = ["F401"] "leverage/modules/__init__.py" = ["F401"] -# TODO: drop once #333 is merged; fixing these f-strings now would conflict with it -"leverage/_backend_config.py" = ["F541"]