diff --git a/pyproject.toml b/pyproject.toml index d5653c69..7ee6fa76 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -101,4 +101,4 @@ profile = "black" [tool.flake8] max-line-length = 88 -extend-ignore = ["E203", "E501"] +extend-ignore = ["E203", "E501", "E231", "E221"] diff --git a/src/dnsrobocert/core/certbot.py b/src/dnsrobocert/core/certbot.py index 421c53be..28ad04c8 100644 --- a/src/dnsrobocert/core/certbot.py +++ b/src/dnsrobocert/core/certbot.py @@ -148,7 +148,7 @@ def _issue(config_path: str, directory_path: str, lock: threading.Lock): ) except BaseException as error: LOGGER.error( - f"An error occurred while processing certificate config `{certificate}`:\n{error}" + f"An error occurred while processing certificate config {certificate}:\n{error}" ) LOGGER.info("Revoke and delete certificates if needed") diff --git a/src/dnsrobocert/core/config.py b/src/dnsrobocert/core/config.py index bceb1d67..cbdada9b 100644 --- a/src/dnsrobocert/core/config.py +++ b/src/dnsrobocert/core/config.py @@ -130,12 +130,12 @@ def find_profile_for_lineage(config: Dict[str, Any], lineage: str) -> Dict[str, certificate = get_certificate(config, lineage) if not certificate: raise RuntimeError( - f"Error, certificate named `{lineage}` could not be found in configuration." + f"Error, certificate named {lineage} could not be found in configuration." ) profile_name = certificate.get("profile") if not profile_name: raise RuntimeError( - f"Error, profile named `{lineage}` could not be found in configuration." + f"Error, profile named {lineage} could not be found in configuration." ) return get_profile(config, profile_name) @@ -179,11 +179,11 @@ def _business_check(config: Dict[str, Any]): if lineage: if profile_name not in profile_names: raise ValueError( - f"Profile `{profile_name}` used by certificate `{lineage}` does not exist." + f"Profile {profile_name} used by certificate {lineage} does not exist." ) if lineage in lineages: - raise ValueError(f"Certificate with name `{lineage}` is duplicated.") + raise ValueError(f"Certificate with name {lineage} is duplicated.") lineages.add(lineage) # Emit warning for deprecated delegated_subdomain field in profile section @@ -198,7 +198,7 @@ def _business_check(config: Dict[str, Any]): # Check that each files_mode and dirs_mode is a valid POSIX mode files_mode = config.get("acme", {}).get("certs_permissions", {}).get("files_mode") if files_mode and files_mode > 511: - raise ValueError("Invalid files_mode `{0}` provided.".format(oct(files_mode))) + raise ValueError("Invalid files_mode {0} provided.".format(oct(files_mode))) dirs_mode = config.get("acme", {}).get("certs_permissions", {}).get("dirs_mode") if dirs_mode and dirs_mode > 511: - raise ValueError("Invalid dirs_mode `{0}` provided.".format(oct(files_mode))) + raise ValueError("Invalid dirs_mode {0} provided.".format(oct(files_mode))) diff --git a/src/dnsrobocert/core/hooks.py b/src/dnsrobocert/core/hooks.py index 11f69543..bb118e34 100644 --- a/src/dnsrobocert/core/hooks.py +++ b/src/dnsrobocert/core/hooks.py @@ -31,7 +31,7 @@ def main(args: Optional[List[str]] = None) -> int: if not dnsrobocert_config: print( - f"Error occured while loading the configuration file, aborting the `{parsed_args.type}` hook.", + f"Error occured while loading the configuration file, aborting the {parsed_args.type} hook.", file=sys.stderr, ) return 1 @@ -40,7 +40,7 @@ def main(args: Optional[List[str]] = None) -> int: globals()[parsed_args.type](dnsrobocert_config, parsed_args.lineage) except BaseException as e: print( - f"Error while executing the `{parsed_args.type}` hook:", + f"Error while executing the {parsed_args.type} hook:", file=sys.stderr, ) print(e, file=sys.stderr) diff --git a/src/dnsrobocert/core/legacy.py b/src/dnsrobocert/core/legacy.py index 9818b6bb..fe5090af 100644 --- a/src/dnsrobocert/core/legacy.py +++ b/src/dnsrobocert/core/legacy.py @@ -81,11 +81,11 @@ def migrate(config_path: str) -> str | None: "for more details. " ) LOGGER.warning( - f"New configuration file is available at `{example_config_path}`" + f"New configuration file is available at {example_config_path}" ) LOGGER.warning( - f"Quick fix (if directory `{os.path.dirname(config_path)}` is persisted): " - f"rename this file to `{os.path.basename(config_path)}`" + f"Quick fix (if directory {os.path.dirname(config_path)} is persisted): " + f"rename this file to {os.path.basename(config_path)}" ) os.makedirs(os.path.dirname(example_config_path), exist_ok=True)