Skip to content

Commit

Permalink
Enable the RUF003 lint in Ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
AA-Turner committed Nov 30, 2024
1 parent b458850 commit 439bff9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .ruff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 8 additions & 8 deletions sphinx/util/i18n.py
Original file line number Diff line number Diff line change
Expand Up @@ -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].
Expand All @@ -184,7 +184,7 @@ def docname_to_domain(docname: str, compaction: bool | str) -> str:
'%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)
Expand All @@ -196,8 +196,8 @@ def docname_to_domain(docname: str, compaction: bool | str) -> str:
# 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).
Expand Down

0 comments on commit 439bff9

Please sign in to comment.