Skip to content

Commit

Permalink
Apply ruff rule RUF023
Browse files Browse the repository at this point in the history
RUF023 `__slots__` is not sorted
  • Loading branch information
DimitriPapadopoulos committed Oct 31, 2024
1 parent 93ef70d commit 2a1720e
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion sphinx/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def match(self, value: str | list | tuple) -> bool:


class _Opt:
__slots__ = 'default', 'rebuild', 'valid_types', 'description'
__slots__ = 'default', 'description', 'rebuild', 'valid_types'

default: Any
rebuild: _ConfigRebuild
Expand Down
6 changes: 3 additions & 3 deletions sphinx/ext/intersphinx/_shared.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@ class _IntersphinxProject:
locations: tuple[InventoryLocation, ...]

__slots__ = {
'locations': 'A tuple of local or remote targets containing '
'the inventory data to fetch. '
'None indicates the default inventory file name.',
'name': 'The inventory name. '
'It is unique and in bijection with an remote inventory URL.',
'target_uri': 'The inventory project URL to which links are resolved. '
'It is unique and in bijection with an inventory name.',
'locations': 'A tuple of local or remote targets containing '
'the inventory data to fetch. '
'None indicates the default inventory file name.',
} # fmt: skip

def __init__(
Expand Down
2 changes: 1 addition & 1 deletion sphinx/locale/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class _TranslationProxy:
the lazy objects should mostly work as expected, for example for sorting.
"""

__slots__ = '_catalogue', '_namespace', '_message'
__slots__ = '_catalogue', '_message', '_namespace'

def __init__(self, catalogue: str, namespace: str, message: str) -> None:
self._catalogue = catalogue
Expand Down
8 changes: 4 additions & 4 deletions sphinx/theming.py
Original file line number Diff line number Diff line change
Expand Up @@ -423,11 +423,11 @@ def _convert_theme_conf(cfg: configparser.RawConfigParser, /) -> _ConfigFile:

class _ConfigFile:
__slots__ = (
'stylesheets',
'sidebar_templates',
'pygments_style_default',
'pygments_style_dark',
'options',
'pygments_style_dark',
'pygments_style_default',
'sidebar_templates',
'stylesheets',
)

def __init__(
Expand Down
2 changes: 1 addition & 1 deletion sphinx/util/i18n.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def __call__( # NoQA: E704


class CatalogInfo:
__slots__ = ('base_dir', 'domain', 'charset')
__slots__ = ('base_dir', 'charset', 'domain')

def __init__(
self, base_dir: str | os.PathLike[str], domain: str, charset: str
Expand Down
6 changes: 3 additions & 3 deletions tests/test_extensions/test_ext_intersphinx_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ class InventoryEntry:
"""Entry in the Intersphinx inventory."""

__slots__ = (
'name',
'anchor',
'display_name',
'domain_name',
'name',
'object_type',
'uri',
'anchor',
'priority',
'uri',
)

def __init__(
Expand Down

0 comments on commit 2a1720e

Please sign in to comment.