Skip to content

Commit

Permalink
style: fix ruff warned style
Browse files Browse the repository at this point in the history
  • Loading branch information
Lee-W committed Nov 26, 2024
1 parent 7e23626 commit bb2f8a7
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 11 deletions.
3 changes: 2 additions & 1 deletion commitizen/changelog.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,10 @@

import re
from collections import OrderedDict, defaultdict
from collections.abc import Iterable
from dataclasses import dataclass
from datetime import date
from typing import TYPE_CHECKING, Iterable
from typing import TYPE_CHECKING

from jinja2 import (
BaseLoader,
Expand Down
4 changes: 2 additions & 2 deletions commitizen/changelog_formats/restructuredtext.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import re
import sys
from itertools import zip_longest
from typing import IO, TYPE_CHECKING, Any, Tuple, Union
from typing import IO, TYPE_CHECKING, Any, Union

from commitizen.changelog import Metadata

Expand All @@ -18,7 +18,7 @@


# Can't use `|` operator and native type because of https://bugs.python.org/issue42233 only fixed in 3.10
TitleKind: TypeAlias = Union[str, Tuple[str, str]]
TitleKind: TypeAlias = Union[str, tuple[str, str]]


class RestructuredText(BaseFormat):
Expand Down
3 changes: 2 additions & 1 deletion commitizen/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
import argparse
import logging
import sys
from collections.abc import Sequence
from copy import deepcopy
from functools import partial
from pathlib import Path
from types import TracebackType
from typing import Any, Sequence
from typing import Any

import argcomplete
from decli import cli
Expand Down
2 changes: 1 addition & 1 deletion commitizen/cz/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import pkgutil
import sys
import warnings
from typing import Iterable
from collections.abc import Iterable

if sys.version_info >= (3, 10):
from importlib import metadata
Expand Down
3 changes: 2 additions & 1 deletion commitizen/cz/base.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
from __future__ import annotations

from abc import ABCMeta, abstractmethod
from typing import Any, Callable, Iterable, Protocol
from collections.abc import Iterable
from typing import Any, Callable, Protocol

from jinja2 import BaseLoader, PackageLoader
from prompt_toolkit.styles import Style, merge_styles
Expand Down
3 changes: 2 additions & 1 deletion commitizen/defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

import pathlib
from collections import OrderedDict
from typing import Any, Iterable, MutableMapping, TypedDict
from collections.abc import Iterable, MutableMapping
from typing import Any, TypedDict

# Type
Questions = Iterable[MutableMapping[str, Any]]
Expand Down
3 changes: 1 addition & 2 deletions commitizen/version_schemes.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
ClassVar,
Literal,
Protocol,
Type,
cast,
runtime_checkable,
)
Expand Down Expand Up @@ -150,7 +149,7 @@ def bump(

# With PEP 440 and SemVer semantic, Scheme is the type, Version is an instance
Version: TypeAlias = VersionProtocol
VersionScheme: TypeAlias = Type[VersionProtocol]
VersionScheme: TypeAlias = type[VersionProtocol]


class BaseVersion(_BaseVersion):
Expand Down
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import os
import re
import tempfile
from collections.abc import Iterator
from pathlib import Path
from typing import Iterator

import pytest
from pytest_mock import MockerFixture
Expand Down
2 changes: 1 addition & 1 deletion tests/providers/conftest.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from __future__ import annotations

import os
from collections.abc import Iterator
from pathlib import Path
from typing import Iterator

import pytest

Expand Down

0 comments on commit bb2f8a7

Please sign in to comment.