Skip to content

Commit fa5eaae

Browse files
feanilclaude
andcommitted
style: suppress UP032 in helpers.py with block-level disable
ruff's --add-noqa injected # noqa: UP032 after the backslash line continuation on two multi-line .format() strings in get_expiration_banner_text(), corrupting the syntax (a comment cannot follow a line continuation character). Rather than converting to f-strings, use ruff's block-level suppression (# ruff: disable[UP032] / # ruff: enable[UP032]) which avoids the syntax corruption and results in a smaller diff than an f-string rewrite. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent b579f11 commit fa5eaae

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

lms/djangoapps/courseware/tests/helpers.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,8 @@ def get_expiration_banner_text(user, course, language='en'): # lint-amnesty, py
433433
if upgrade_deadline:
434434
formatted_upgrade_deadline = strftime_localized_html(upgrade_deadline, 'SHORT_DATE')
435435

436-
bannerText = '<strong>Audit Access Expires {expiration_date}</strong><br>\ # noqa: UP032
436+
# ruff: disable[UP032]
437+
bannerText = '<strong>Audit Access Expires {expiration_date}</strong><br>\
437438
You lose all access to this course, including your progress, on {expiration_date}.\
438439
<br>Upgrade by {upgrade_deadline} to get unlimited access to the course as long as it exists\
439440
on the site. <a id="FBE_banner" href="{upgrade_link}">Upgrade now<span class="sr-only"> to retain access past\
@@ -442,12 +443,15 @@ def get_expiration_banner_text(user, course, language='en'): # lint-amnesty, py
442443
upgrade_link=upgrade_link,
443444
upgrade_deadline=formatted_upgrade_deadline
444445
)
446+
# ruff: enable[UP032]
445447
else:
446-
bannerText = '<strong>Audit Access Expires {expiration_date}</strong><br>\ # noqa: UP032
448+
# ruff: disable[UP032]
449+
bannerText = '<strong>Audit Access Expires {expiration_date}</strong><br>\
447450
You lose all access to this course, including your progress, on {expiration_date}.\
448451
'.format(
449452
expiration_date=formatted_expiration_date
450453
)
454+
# ruff: enable[UP032]
451455
return bannerText
452456

453457

0 commit comments

Comments
 (0)