from babel import localedata
from babel.plural import PluralRule
-__all__ = ['UnknownLocaleError', 'Locale', 'default_locale', 'negotiate_locale',
- 'parse_locale']
+__all__ = [
+ 'Locale',
+ 'UnknownLocaleError',
+ 'default_locale',
+ 'get_global',
+ 'get_locale_identifier',
+ 'negotiate_locale',
+ 'parse_locale',
+]
if TYPE_CHECKING:
from typing_extensions import Literal, TypeAlias
_MessageID: TypeAlias = str | tuple[str, ...] | list[str]
-__all__ = ['Message', 'Catalog', 'TranslationError']
+__all__ = [
+ 'DEFAULT_HEADER',
+ 'PYTHON_FORMAT',
+ 'Catalog',
+ 'Message',
+ 'TranslationError',
+]
def get_close_matches(word, possibilities, n=3, cutoff=0.6):
"""A modified version of ``difflib.get_close_matches``.
select = [
"B",
"C",
- "COM",
+ "COM", # Trailing commas
"E",
"F",
- "I",
- "SIM300",
- "UP",
+ "I", # import sorting
+ "SIM300", # Yoda conditions
+ "UP", # upgrades
+ "RUF022", # unsorted __all__
]
ignore = [
- "C901", # Complexity
- "E501", # Line length
- "E731", # Do not assign a lambda expression (we use them on purpose)
- "E741", # Ambiguous variable name
- "UP012", # "utf-8" is on purpose
- "UP031", # A bunch of places where % formatting is better
+ "C901", # Complexity
+ "E501", # Line length
+ "E731", # Do not assign a lambda expression (we use them on purpose)
+ "E741", # Ambiguous variable name
+ "UP012", # "utf-8" is on purpose
+ "UP031", # A bunch of places where % formatting is better
]
[tool.ruff.lint.per-file-ignores]