From be0cef067cecd566d60af96c15dc2e48bc4467af Mon Sep 17 00:00:00 2001 From: Lukas Puehringer Date: Wed, 17 Mar 2021 11:47:08 +0100 Subject: [PATCH] Manually standardize quotes where black cannot Black standardizes single to double quotes where feasible. However, it doesn't seem to change double to single quotes nor adds escape characters, as a consequence it skips standardization on strings with mixed quotes. Unfortunately, pylint's quote consistency check also doesn't detect this, so the onus will remain on the reviewer in these cases. **Unrelated changes**: The commit still enables pylint's "check-quote-consistency" just in case it can detect something the black doesn't. The commit also fixes a syntax inconsistency in pylintrc. Signed-off-by: Lukas Puehringer --- tuf/api/metadata.py | 4 ++-- tuf/api/pylintrc | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/tuf/api/metadata.py b/tuf/api/metadata.py index c94c1306..f891388f 100644 --- a/tuf/api/metadata.py +++ b/tuf/api/metadata.py @@ -266,12 +266,12 @@ def verify( ) if not signatures_for_keyid: - raise tuf.exceptions.Error(f'no signature for key {key["keyid"]}.') + raise tuf.exceptions.Error(f"no signature for key {key['keyid']}.") if len(signatures_for_keyid) > 1: raise tuf.exceptions.Error( f"{len(signatures_for_keyid)} signatures for key " - f'{key["keyid"]}, not sure which one to verify.' + f"{key['keyid']}, not sure which one to verify." ) if signed_serializer is None: diff --git a/tuf/api/pylintrc b/tuf/api/pylintrc index e2e2d9cf..409a9614 100644 --- a/tuf/api/pylintrc +++ b/tuf/api/pylintrc @@ -44,7 +44,10 @@ max-line-length=80 single-line-if-stmt=yes [LOGGING] -logging-format-style: new +logging-format-style=new [MISCELLANEOUS] notes=TODO + +[STRING] +check-quote-consistency=yes