Skip to content

Commit eb4545b

Browse files
committed
Linter issues
1 parent ec99d3a commit eb4545b

9 files changed

Lines changed: 16 additions & 16 deletions

File tree

python-t-strings/asynchronous.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ async def get_name():
88

99

1010
async def greeting_template():
11-
return t"Hello, {await get_name()}!"
11+
return t"Hello, {await get_name()}!" # noqa
1212

1313

1414
async def main():

python-t-strings/emails.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
def fill_order_template(lang, name, order_id, date):
22
templates = {
3-
"en": t"Thank you, {name}! Your order #{order_id} will arrive on {date}.",
4-
"es": t"Gracias, {name} Su orden No. {order_id} arribará el próximo {date}.",
5-
"fr": t"Merci, {name}! Votre commande n° {order_id} arrivera le {date}.",
3+
"en": t"Thank you, {name}! Your order #{order_id} will arrive on {date}.", # noqa
4+
"es": t"Gracias, {name} Su orden No. {order_id} arribará el próximo {date}.", # noqa
5+
"fr": t"Merci, {name}! Votre commande n° {order_id} arrivera le {date}.", # noqa
66
}
77
return templates.get(lang, templates["en"])
88

python-t-strings/i18n.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
name = input("Enter your name please: ")
22

33
translations = {
4-
"en": t"Hello, {name}! Welcome back!",
5-
"es": t"¡Hola, {name}! ¡Bienvenido de vuelta!",
6-
"fr": t"Bonjour, {name}! Bon retour!"
4+
"en": t"Hello, {name}! Welcome back!", # noqa
5+
"es": t"¡Hola, {name}! ¡Bienvenido de vuelta!", # noqa
6+
"fr": t"Bonjour, {name}! Bon retour!" # noqa
77
}
88

99

python-t-strings/logging_message.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,5 @@ def __str__(self):
3131

3232

3333
action, amount, item = "refund", 7, "keyboard"
34-
msg_template = TemplateMessage(t"Process {action}: {amount:.2f} {item}")
34+
msg_template = TemplateMessage(t"Process {action}: {amount:.2f} {item}") # noqa
3535
logging.info(msg_template)

python-t-strings/scape_html.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ def render_safe_html(template):
1212

1313

1414
username = "<script>alert('Hacked!')</script>"
15-
template = t"<p>Hello, {username}!</p>"
15+
template = t"<p>Hello, {username}!</p>" # noqa
1616

1717
safe_html = render_safe_html(template)
1818
print(safe_html)

python-t-strings/sql.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def sanitized_sql(template):
1313
return query, tuple(params)
1414

1515

16-
template = t"SELECT * FROM students WHERE name = '{username}';"
16+
template = t"SELECT * FROM students WHERE name = '{username}';" # noqa
1717
query, params = sanitized_sql(template)
1818
print("Sanitized SQL Query:", query)
1919
print("Parameters:", params)

python-t-strings/template_to_string.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ def to_string(template):
1414

1515

1616
price = 234.8765
17-
print(to_string(t"The price is ${price:.2f}"))
18-
print(to_string(t"The price is ${price!s:.2f}"))
17+
print(to_string(t"The price is ${price:.2f}")) # noqa
18+
print(to_string(t"The price is ${price!s:.2f}")) # noqa

python-t-strings/to_stirngs.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def convert(value, conversion):
1414

1515

1616
price = 234.8765
17-
print(to_string(t"The price is ${price:.2f}"))
17+
print(to_string(t"The price is ${price:.2f}")) # noqa
1818

1919
header = "Report"
20-
print(to_string(t"{header:=^20}"))
20+
print(to_string(t"{header:=^20}")) # noqa

python-t-strings/traverse_items.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
name = "Pythonista"
44
site = "realpython.com"
5-
template = t"Hello, {name}! Welcome to {site}!"
5+
template = t"Hello, {name}! Welcome to {site}!" # noqa
66

77
# for item in template:
88
# print(item)
@@ -16,7 +16,7 @@
1616
debit = 300.4344
1717
credit = 450.5676
1818
balance = credit - debit
19-
template = t"Credit: {credit:.2f}, Debit: {debit:.2f}, Balance: {balance:.2f}"
19+
template = t"Credit: {credit:.2f}, Debit: {debit:.2f}, Balance: {balance:.2f}" # noqa
2020

2121

2222
# def build_report(template):

0 commit comments

Comments
 (0)