Skip to content

Commit 5a0053c

Browse files
committed
style: sort import
1 parent f8e37a0 commit 5a0053c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+47
-73
lines changed

commitizen/changelog_formats/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@
55
import importlib_metadata as metadata
66

77
from commitizen.changelog import Metadata
8-
from commitizen.exceptions import ChangelogFormatUnknown
98
from commitizen.config.base_config import BaseConfig
10-
9+
from commitizen.exceptions import ChangelogFormatUnknown
1110

1211
CHANGELOG_FORMAT_ENTRYPOINT = "commitizen.changelog_format"
1312
TEMPLATE_EXTENSION = "j2"

commitizen/changelog_formats/restructuredtext.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import re
44
import sys
55
from itertools import zip_longest
6-
from typing import IO, TYPE_CHECKING, Any, Union, Tuple
6+
from typing import IO, TYPE_CHECKING, Any, Tuple, Union
77

88
from commitizen.changelog import Metadata
99

commitizen/commands/bump.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import questionary
77

88
from commitizen import bump, factory, git, hooks, out
9+
from commitizen.changelog_formats import get_changelog_format
910
from commitizen.commands.changelog import Changelog
1011
from commitizen.config import BaseConfig
1112
from commitizen.exceptions import (
@@ -21,13 +22,12 @@
2122
NotAllowed,
2223
NoVersionSpecifiedError,
2324
)
24-
from commitizen.changelog_formats import get_changelog_format
2525
from commitizen.providers import get_provider
2626
from commitizen.version_schemes import (
27-
get_version_scheme,
2827
Increment,
2928
InvalidVersion,
3029
Prerelease,
30+
get_version_scheme,
3131
)
3232

3333
logger = getLogger("commitizen")

commitizen/commands/changelog.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@
77
from typing import Callable, cast
88

99
from commitizen import bump, changelog, defaults, factory, git, out
10-
10+
from commitizen.changelog_formats import get_changelog_format
1111
from commitizen.config import BaseConfig
12-
from commitizen.cz.base import MessageBuilderHook, ChangelogReleaseHook
12+
from commitizen.cz.base import ChangelogReleaseHook, MessageBuilderHook
13+
from commitizen.cz.utils import strip_local_version
1314
from commitizen.exceptions import (
1415
DryRunExit,
1516
NoCommitsFoundError,
@@ -18,10 +19,8 @@
1819
NotAGitProjectError,
1920
NotAllowed,
2021
)
21-
from commitizen.changelog_formats import get_changelog_format
2222
from commitizen.git import GitTag, smart_open
2323
from commitizen.version_schemes import get_version_scheme
24-
from commitizen.cz.utils import strip_local_version
2524

2625

2726
class Changelog:

commitizen/commands/commit.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import contextlib
44
import os
55

6-
76
import questionary
87

98
from commitizen import factory, git, out

commitizen/commands/init.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
import questionary
88
import yaml
9+
910
from commitizen import cmd, factory, out
1011
from commitizen.__version__ import __version__
1112
from commitizen.config import BaseConfig, JsonConfig, TomlConfig, YAMLConfig

commitizen/config/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from pathlib import Path
44

55
from commitizen import defaults, git
6-
from commitizen.exceptions import ConfigFileNotFound, ConfigFileIsEmpty
6+
from commitizen.exceptions import ConfigFileIsEmpty, ConfigFileNotFound
77

88
from .base_config import BaseConfig
99
from .json_config import JsonConfig

commitizen/config/json_config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
import json
44
from pathlib import Path
5-
from commitizen.exceptions import InvalidConfigurationError
65

6+
from commitizen.exceptions import InvalidConfigurationError
77
from commitizen.git import smart_open
88

99
from .base_config import BaseConfig

commitizen/config/toml_config.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from tomlkit import exceptions, parse, table
77

88
from commitizen.exceptions import InvalidConfigurationError
9+
910
from .base_config import BaseConfig
1011

1112

commitizen/config/yaml_config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
import yaml
66

7-
from commitizen.git import smart_open
87
from commitizen.exceptions import InvalidConfigurationError
8+
from commitizen.git import smart_open
99

1010
from .base_config import BaseConfig
1111

commitizen/cz/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import re
21
import os
2+
import re
33
import tempfile
44

5-
from commitizen.cz import exceptions
65
from commitizen import git
6+
from commitizen.cz import exceptions
77

88

99
def required_validator(answer, msg=None):

commitizen/defaults.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22

33
import pathlib
44
from collections import OrderedDict
5-
from typing import Any, Iterable, MutableMapping
6-
7-
from typing import TypedDict
5+
from typing import Any, Iterable, MutableMapping, TypedDict
86

97
# Type
108
Questions = Iterable[MutableMapping[str, Any]]

commitizen/providers/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
from commitizen.config.base_config import BaseConfig
88
from commitizen.exceptions import VersionProviderUnknown
9-
109
from commitizen.providers.base_provider import VersionProvider
1110
from commitizen.providers.cargo_provider import CargoProvider
1211
from commitizen.providers.commitizen_provider import CommitizenProvider

commitizen/providers/cargo_provider.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import tomlkit
44

5-
65
from commitizen.providers.base_provider import TomlProvider
76

87

commitizen/providers/commitizen_provider.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
from __future__ import annotations
22

3-
43
from commitizen.providers.base_provider import VersionProvider
54

65

commitizen/providers/composer_provider.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
from __future__ import annotations
22

3-
43
from commitizen.providers.base_provider import JsonProvider
54

65

commitizen/providers/npm_provider.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
from pathlib import Path
55
from typing import Any, ClassVar
66

7-
87
from commitizen.providers.base_provider import VersionProvider
98

109

commitizen/providers/pep621_provider.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
from __future__ import annotations
22

3-
43
from commitizen.providers.base_provider import TomlProvider
54

65

commitizen/providers/poetry_provider.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import tomlkit
44

5-
65
from commitizen.providers.base_provider import TomlProvider
76

87

commitizen/providers/scm_provider.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,15 @@
33
import re
44
from typing import Callable
55

6-
76
from commitizen.git import get_tags
7+
from commitizen.providers.base_provider import VersionProvider
88
from commitizen.version_schemes import (
9-
get_version_scheme,
109
InvalidVersion,
1110
Version,
1211
VersionProtocol,
12+
get_version_scheme,
1313
)
1414

15-
from commitizen.providers.base_provider import VersionProvider
16-
1715

1816
class ScmProvider(VersionProvider):
1917
"""

tests/commands/test_bump_command.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
import commitizen.commands.bump as bump
1414
from commitizen import cli, cmd, git, hooks
15+
from commitizen.changelog_formats import ChangelogFormat
1516
from commitizen.cz.base import BaseCommitizen
1617
from commitizen.exceptions import (
1718
BumpTagFailedError,
@@ -28,7 +29,6 @@
2829
NotAllowed,
2930
NoVersionSpecifiedError,
3031
)
31-
from commitizen.changelog_formats import ChangelogFormat
3232
from tests.utils import create_file_and_commit, create_tag, skip_below_py_3_10
3333

3434

tests/commands/test_changelog_command.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
from commitizen import __file__ as commitizen_init
1313
from commitizen import cli, git
14+
from commitizen.changelog_formats import ChangelogFormat
1415
from commitizen.commands.changelog import Changelog
1516
from commitizen.config.base_config import BaseConfig
1617
from commitizen.cz.base import BaseCommitizen
@@ -22,16 +23,15 @@
2223
NotAGitProjectError,
2324
NotAllowed,
2425
)
25-
from commitizen.changelog_formats import ChangelogFormat
2626
from tests.utils import (
2727
create_branch,
2828
create_file_and_commit,
2929
create_tag,
3030
get_current_branch,
3131
merge_branch,
32+
skip_below_py_3_10,
3233
switch_branch,
3334
wait_for_tag,
34-
skip_below_py_3_10,
3535
)
3636

3737

tests/commands/test_commit_command.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import os
22
import sys
3+
from unittest.mock import ANY
34

45
import pytest
56
from pytest_mock import MockFixture
6-
from unittest.mock import ANY
77

88
from commitizen import cli, cmd, commands
99
from commitizen.cz.exceptions import CzException
@@ -19,7 +19,6 @@
1919
NotAllowed,
2020
NothingToCommitError,
2121
)
22-
2322
from tests.utils import skip_below_py_3_10
2423

2524

tests/commands/test_example_command.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import pytest
21
import sys
3-
from commitizen import cli, commands
42

3+
import pytest
54
from pytest_mock import MockerFixture
65

6+
from commitizen import cli, commands
77
from tests.utils import skip_below_py_3_10
88

99

tests/commands/test_info_command.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
import pytest
21
import sys
3-
from commitizen import cli, commands
42

3+
import pytest
54
from pytest_mock import MockerFixture
5+
6+
from commitizen import cli, commands
67
from tests.utils import skip_below_py_3_10
78

89

tests/commands/test_init_command.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
from commitizen import cli, commands
1313
from commitizen.__version__ import __version__
1414
from commitizen.exceptions import InitFailedError, NoAnswersError
15-
1615
from tests.utils import skip_below_py_3_10
1716

1817

tests/commands/test_ls_command.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import pytest
21
import sys
3-
from commitizen import cli, commands
42

3+
import pytest
54
from pytest_mock import MockerFixture
65

6+
from commitizen import cli, commands
77
from tests.utils import skip_below_py_3_10
88

99

tests/commands/test_schema_command.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import pytest
21
import sys
3-
from commitizen import cli, commands
42

3+
import pytest
54
from pytest_mock import MockerFixture
65

6+
from commitizen import cli, commands
77
from tests.utils import skip_below_py_3_10
88

99

tests/conftest.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@
1010
from pytest_mock import MockerFixture
1111

1212
from commitizen import cmd, defaults
13-
from commitizen.config import BaseConfig
14-
from commitizen.cz import registry
15-
from commitizen.cz.base import BaseCommitizen
1613
from commitizen.changelog_formats import (
1714
ChangelogFormat,
1815
get_changelog_format,
1916
)
17+
from commitizen.config import BaseConfig
18+
from commitizen.cz import registry
19+
from commitizen.cz.base import BaseCommitizen
2020
from tests.utils import create_file_and_commit
2121

2222
SIGNER = "GitHub Action"

tests/providers/test_base_provider.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
from __future__ import annotations
22

3-
43
import pytest
54

65
from commitizen.config.base_config import BaseConfig

tests/providers/test_cargo_provider.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
from commitizen.providers import get_provider
1010
from commitizen.providers.cargo_provider import CargoProvider
1111

12-
1312
CARGO_TOML = """\
1413
[package]
1514
name = "whatever"

tests/providers/test_commitizen_provider.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,9 @@
22

33
from typing import TYPE_CHECKING
44

5-
65
from commitizen.config.base_config import BaseConfig
76
from commitizen.providers.commitizen_provider import CommitizenProvider
87

9-
108
if TYPE_CHECKING:
119
from pytest_mock import MockerFixture
1210

tests/providers/test_composer_provider.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
from commitizen.providers import get_provider
1010
from commitizen.providers.composer_provider import ComposerProvider
1111

12-
1312
COMPOSER_JSON = """\
1413
{
1514
"name": "whatever",

tests/providers/test_npm_provider.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
from commitizen.providers import get_provider
1010
from commitizen.providers.npm_provider import NpmProvider
1111

12-
1312
NPM_PACKAGE_JSON = """\
1413
{
1514
"name": "whatever",

0 commit comments

Comments
 (0)