]> git.ipfire.org Git - thirdparty/babel.git/commitdiff
Ensure imported names are in __all__; sort __all__s
authorAarni Koskela <akx@iki.fi>
Mon, 13 Jan 2025 11:10:48 +0000 (13:10 +0200)
committerAarni Koskela <akx@iki.fi>
Tue, 14 Jan 2025 07:52:31 +0000 (09:52 +0200)
babel/__init__.py
babel/core.py
babel/messages/catalog.py
pyproject.toml

index 9a1ef4bab73bc0eabfb6b7ea75b7670245b19923..ff9c533a7ede1fb7b9277c1ed42aa56f14703cda 100644 (file)
@@ -30,6 +30,7 @@ __version__ = '2.16.0'
 __all__ = [
     'Locale',
     'UnknownLocaleError',
+    '__version__',
     'default_locale',
     'get_locale_identifier',
     'negotiate_locale',
index a3ebb40e0bd9dfd7884ce4d6291be676f1d496cc..7df32c9882285d424bb4fdd08fa3373bb6ab8de8 100644 (file)
@@ -18,8 +18,15 @@ from typing import TYPE_CHECKING, Any
 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
index 272ec65414f00fe6b0626ea49d9391412879817b..67d4dbe23977d15a9a6f98a3558b4a9fc553f85d 100644 (file)
@@ -29,7 +29,13 @@ if TYPE_CHECKING:
 
     _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``.
index ba0e4771d780a474ee263c33a46f156a3c099abb..2e23f7a6d73a18130603042ff424eaade2886f92 100644 (file)
@@ -8,20 +8,21 @@ extend-exclude = [
 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]