Enable the RUF003 lint in Ruff

This commit is contained in:
Adam Turner
2024-11-30 19:14:22 +00:00
parent b458850b32
commit 439bff92c7
2 changed files with 9 additions and 9 deletions

View File

@@ -222,7 +222,7 @@ select = [
# ruff-specific rules ('RUF')
# "RUF001", # String contains ambiguous {}. Did you mean {}?
"RUF002", # Docstring contains ambiguous {}. Did you mean {}?
# "RUF003", # Comment contains ambiguous {}. Did you mean {}?
"RUF003", # Comment contains ambiguous {}. Did you mean {}?
"RUF005", # Consider `{expression}` instead of concatenation
"RUF006", # Store a reference to the return value of `{expr}.{method}`
"RUF007", # Prefer `itertools.pairwise()` over `zip()` when iterating over successive pairs

View File

@@ -167,11 +167,11 @@ def docname_to_domain(docname: str, compaction: bool | str) -> str:
# date_format mappings: ustrftime() to babel.dates.format_datetime()
date_format_mappings = {
'%a': 'EEE', # Weekday as locales abbreviated name.
'%A': 'EEEE', # Weekday as locales full name.
'%b': 'MMM', # Month as locales abbreviated name.
'%B': 'MMMM', # Month as locales full name.
'%c': 'medium', # Locales appropriate date and time representation.
'%a': 'EEE', # Weekday as locale's abbreviated name.
'%A': 'EEEE', # Weekday as locale's full name.
'%b': 'MMM', # Month as locale's abbreviated name.
'%B': 'MMMM', # Month as locale's full name.
'%c': 'medium', # Locale's appropriate date and time representation.
'%-d': 'd', # Day of the month as a decimal number.
'%d': 'dd', # Day of the month as a zero-padded decimal number.
'%-H': 'H', # Hour (24-hour clock) as a decimal number [0,23].
@@ -184,7 +184,7 @@ date_format_mappings = {
'%m': 'MM', # Month as a zero-padded decimal number.
'%-M': 'm', # Minute as a decimal number [0,59].
'%M': 'mm', # Minute as a zero-padded decimal number [00,59].
'%p': 'a', # Locales equivalent of either AM or PM.
'%p': 'a', # Locale's equivalent of either AM or PM.
'%-S': 's', # Second as a decimal number.
'%S': 'ss', # Second as a zero-padded decimal number.
'%U': 'WW', # Week number of the year (Sunday as the first day of the week)
@@ -196,8 +196,8 @@ date_format_mappings = {
# Monday are considered to be in week 0.
'%W': 'WW', # Week number of the year (Monday as the first day of the week)
# as a zero-padded decimal number.
'%x': 'medium', # Locales appropriate date representation.
'%X': 'medium', # Locales appropriate time representation.
'%x': 'medium', # Locale's appropriate date representation.
'%X': 'medium', # Locale's appropriate time representation.
'%y': 'YY', # Year without century as a zero-padded decimal number.
'%Y': 'yyyy', # Year with century as a decimal number.
'%Z': 'zzz', # Time zone name (no characters if no time zone exists).