Skip to content

Commit f4abf27

Browse files
committed
Used !r in f-strings
1 parent 8272fce commit f4abf27

6 files changed

Lines changed: 6 additions & 6 deletions

File tree

remove-json-keys/src/remove_json_keys/lib/data/json.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def is_valid(file_path, format='json'):
1919
try : json5.loads(file_text) ; return True
2020
except Exception : return False
2121
else:
22-
raise ValueError(f"Unsupported format '{format}'. Expected 'json' or 'json5'")
22+
raise ValueError(f"Unsupported format {format!r}. Expected 'json' or 'json5'")
2323

2424
def read(file_path, encoding='utf-8'):
2525
with open(file_path, 'r', encoding=encoding) as file:

remove-json-keys/src/remove_json_keys/lib/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def load(cli):
7575
setattr(cli.config, key, val)
7676
else:
7777
log.cmd_docs_url_exit(cli,
78-
f"{cli.msgs.err_INVALID_KEY} '{key}' {cli.msgs.err_FOUND_IN}"
78+
f'{cli.msgs.err_INVALID_KEY} {key!r} {cli.msgs.err_FOUND_IN}'
7979
f'\n{log.colors.gry}{cli.config_filepath}',
8080
cmd='init')
8181
log.debug('Config file loaded!', cli)

remove-json-keys/src/remove_json_keys/lib/url.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def validate(url, allowed_schemes=('http', 'https'), allowed_domains=[]):
2121
parsed_url = urlparse(url)
2222

2323
if parsed_url.scheme not in allowed_schemes:
24-
raise ValueError(f"URL scheme '{parsed_url.scheme}' not allowed. Allowed: {allowed_schemes}")
24+
raise ValueError(f'URL scheme {parsed_url.scheme!r} not allowed. Allowed: {allowed_schemes}')
2525

2626
if allowed_domains:
2727
input_domain = parsed_url.netloc.lower()

translate-messages/src/translate_messages/lib/data/json.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def is_valid(file_path, format='json'):
1717
try : json5.loads(file_text) ; return True
1818
except Exception : return False
1919
else:
20-
raise ValueError(f"Unsupported format '{format}'. Expected 'json' or 'json5'")
20+
raise ValueError(f"Unsupported format {format!r}. Expected 'json' or 'json5'")
2121

2222
def read(file_path, encoding='utf-8'):
2323
with open(file_path, 'r', encoding=encoding) as file:

translate-messages/src/translate_messages/lib/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ def load(cli):
8585
setattr(cli.config, key, val)
8686
else:
8787
log.cmd_docs_url_exit(cli,
88-
f"{cli.msgs.err_INVALID_KEY} '{key}' {cli.msgs.err_FOUND_IN}"
88+
f'{cli.msgs.err_INVALID_KEY} {key!r} {cli.msgs.err_FOUND_IN}'
8989
f'\n{log.colors.gry}{cli.config_filepath}',
9090
cmd='init')
9191
log.debug('Config file loaded!', cli)

translate-messages/src/translate_messages/lib/url.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def validate(url, allowed_schemes=('http', 'https'), allowed_domains=[]):
2121
parsed_url = urlparse(url)
2222

2323
if parsed_url.scheme not in allowed_schemes:
24-
raise ValueError(f"URL scheme '{parsed_url.scheme}' not allowed. Allowed: {allowed_schemes}")
24+
raise ValueError(f'URL scheme {parsed_url.scheme!r} not allowed. Allowed: {allowed_schemes}')
2525

2626
if allowed_domains:
2727
input_domain = parsed_url.netloc.lower()

0 commit comments

Comments
 (0)