Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions leverage/_backend_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand All @@ -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.")
2 changes: 0 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Loading