diff --git a/commitizen/commands/bump.py b/commitizen/commands/bump.py index 60853094f..0a2bbe37f 100644 --- a/commitizen/commands/bump.py +++ b/commitizen/commands/bump.py @@ -68,7 +68,7 @@ def __init__(self, config: BaseConfig, arguments: dict): if arguments[key] is not None }, } - self.cz = factory.commiter_factory(self.config) + self.cz = factory.committer_factory(self.config) self.changelog_flag = arguments["changelog"] self.changelog_config = self.config.settings.get("update_changelog_on_bump") self.changelog_to_stdout = arguments["changelog_to_stdout"] diff --git a/commitizen/commands/changelog.py b/commitizen/commands/changelog.py index 3b8f43e37..fb6f76a6b 100644 --- a/commitizen/commands/changelog.py +++ b/commitizen/commands/changelog.py @@ -49,7 +49,7 @@ def __init__(self, config: BaseConfig, args): ) self.encoding = self.config.settings["encoding"] - self.cz = factory.commiter_factory(self.config) + self.cz = factory.committer_factory(self.config) self.start_rev = args.get("start_rev") or self.config.settings.get( "changelog_start_rev" diff --git a/commitizen/commands/check.py b/commitizen/commands/check.py index e22155cf7..087db03ea 100644 --- a/commitizen/commands/check.py +++ b/commitizen/commands/check.py @@ -46,7 +46,7 @@ def __init__(self, config: BaseConfig, arguments: dict[str, Any], cwd=os.getcwd( self.config: BaseConfig = config self.encoding = config.settings["encoding"] - self.cz = factory.commiter_factory(self.config) + self.cz = factory.committer_factory(self.config) def _valid_command_argument(self): num_exclusive_args_provided = sum( @@ -72,7 +72,7 @@ def __call__(self): raise NoCommitsFoundError(f"No commit found with range: '{self.rev_range}'") pattern = self.cz.schema_pattern() - ill_formated_commits = [ + ill_formatted_commits = [ commit for commit in commits if not self.validate_commit_message(commit.message, pattern) @@ -80,7 +80,7 @@ def __call__(self): displayed_msgs_content = "\n".join( [ f'commit "{commit.rev}": "{commit.message}"' - for commit in ill_formated_commits + for commit in ill_formatted_commits ] ) if displayed_msgs_content: diff --git a/commitizen/commands/commit.py b/commitizen/commands/commit.py index 93f048082..cb34c41a5 100644 --- a/commitizen/commands/commit.py +++ b/commitizen/commands/commit.py @@ -35,7 +35,7 @@ def __init__(self, config: BaseConfig, arguments: dict): self.config: BaseConfig = config self.encoding = config.settings["encoding"] - self.cz = factory.commiter_factory(self.config) + self.cz = factory.committer_factory(self.config) self.arguments = arguments self.temp_file: str = get_backup_file_path() diff --git a/commitizen/commands/example.py b/commitizen/commands/example.py index e7abe7b31..a28ad85f1 100644 --- a/commitizen/commands/example.py +++ b/commitizen/commands/example.py @@ -7,7 +7,7 @@ class Example: def __init__(self, config: BaseConfig, *args): self.config: BaseConfig = config - self.cz = factory.commiter_factory(self.config) + self.cz = factory.committer_factory(self.config) def __call__(self): out.write(self.cz.example()) diff --git a/commitizen/commands/info.py b/commitizen/commands/info.py index afac9797e..abd4197e7 100644 --- a/commitizen/commands/info.py +++ b/commitizen/commands/info.py @@ -7,7 +7,7 @@ class Info: def __init__(self, config: BaseConfig, *args): self.config: BaseConfig = config - self.cz = factory.commiter_factory(self.config) + self.cz = factory.committer_factory(self.config) def __call__(self): out.write(self.cz.info()) diff --git a/commitizen/commands/init.py b/commitizen/commands/init.py index df872ec7e..20277399d 100644 --- a/commitizen/commands/init.py +++ b/commitizen/commands/init.py @@ -82,7 +82,7 @@ class Init: def __init__(self, config: BaseConfig, *args): self.config: BaseConfig = config self.encoding = config.settings["encoding"] - self.cz = factory.commiter_factory(self.config) + self.cz = factory.committer_factory(self.config) self.project_info = ProjectInfo() def __call__(self): diff --git a/commitizen/commands/schema.py b/commitizen/commands/schema.py index 0940648cd..4af5679cf 100644 --- a/commitizen/commands/schema.py +++ b/commitizen/commands/schema.py @@ -7,7 +7,7 @@ class Schema: def __init__(self, config: BaseConfig, *args): self.config: BaseConfig = config - self.cz = factory.commiter_factory(self.config) + self.cz = factory.committer_factory(self.config) def __call__(self): out.write(self.cz.schema()) diff --git a/commitizen/factory.py b/commitizen/factory.py index 09af5fd0f..b5d665b65 100644 --- a/commitizen/factory.py +++ b/commitizen/factory.py @@ -4,7 +4,7 @@ from commitizen.exceptions import NoCommitizenFoundException -def commiter_factory(config: BaseConfig) -> BaseCommitizen: +def committer_factory(config: BaseConfig) -> BaseCommitizen: """Return the correct commitizen existing in the registry.""" name: str = config.settings["name"] try: diff --git a/commitizen/version_schemes.py b/commitizen/version_schemes.py index 2486be58c..84ded9316 100644 --- a/commitizen/version_schemes.py +++ b/commitizen/version_schemes.py @@ -19,7 +19,7 @@ else: import importlib_metadata as metadata -from packaging.version import InvalidVersion # noqa: F401: Rexpose the common exception +from packaging.version import InvalidVersion # noqa: F401: expose the common exception from packaging.version import Version as _BaseVersion from commitizen.defaults import MAJOR, MINOR, PATCH, Settings @@ -78,7 +78,7 @@ def is_prerelease(self) -> bool: @property def prerelease(self) -> str | None: - """The prelease potion of the version is this is a prerelease.""" + """The prerelease potion of the version is this is a prerelease.""" raise NotImplementedError("must be implemented") @property @@ -142,7 +142,7 @@ def bump( prerelease: The type of prerelease, if Any is_local_version: Whether to increment the local version instead exact_increment: Treat the increment and prerelease arguments explicitly. Disables logic - that attempts to deduce the correct increment when a prelease suffix is present. + that attempts to deduce the correct increment when a prerelease suffix is present. """ @@ -351,7 +351,7 @@ class SemVer2(SemVer): See: https://semver.org/spec/v2.0.0.html """ - _STD_PRELEASES = { + _STD_PRERELEASES = { "a": "alpha", "b": "beta", } @@ -359,7 +359,7 @@ class SemVer2(SemVer): @property def prerelease(self) -> str | None: if self.is_prerelease and self.pre: - prerelease_type = self._STD_PRELEASES.get(self.pre[0], self.pre[0]) + prerelease_type = self._STD_PRERELEASES.get(self.pre[0], self.pre[0]) return f"{prerelease_type}.{self.pre[1]}" return None diff --git a/tests/commands/test_bump_command.py b/tests/commands/test_bump_command.py index b5ff7e6ed..f3c1ba923 100644 --- a/tests/commands/test_bump_command.py +++ b/tests/commands/test_bump_command.py @@ -209,7 +209,7 @@ def test_bump_command_increment_option( @pytest.mark.usefixtures("tmp_commitizen_project") -def test_bump_command_prelease(mocker: MockFixture): +def test_bump_command_prerelease(mocker: MockFixture): create_file_and_commit("feat: location") # Create an alpha pre-release. @@ -281,7 +281,7 @@ def test_bump_command_prelease(mocker: MockFixture): @pytest.mark.usefixtures("tmp_commitizen_project") -def test_bump_command_prelease_increment(mocker: MockFixture): +def test_bump_command_prerelease_increment(mocker: MockFixture): # FINAL RELEASE create_file_and_commit("fix: location") @@ -317,7 +317,7 @@ def test_bump_command_prelease_increment(mocker: MockFixture): @pytest.mark.usefixtures("tmp_commitizen_project") -def test_bump_command_prelease_exact_mode(mocker: MockFixture): +def test_bump_command_prerelease_exact_mode(mocker: MockFixture): # PRERELEASE create_file_and_commit("feat: location") @@ -437,7 +437,7 @@ def test_bump_on_git_with_hooks_no_verify_enabled(mocker: MockFixture): @pytest.mark.usefixtures("tmp_commitizen_project") -def test_bump_when_bumpping_is_not_support(mocker: MockFixture): +def test_bump_when_bumping_is_not_support(mocker: MockFixture): create_file_and_commit( "feat: new user interface\n\nBREAKING CHANGE: age is no longer supported" ) @@ -1062,7 +1062,7 @@ def test_bump_use_version_provider(mocker: MockFixture): mock.set_version.assert_called_once_with("0.0.1") -def test_bump_command_prelease_scheme_via_cli( +def test_bump_command_prerelease_scheme_via_cli( tmp_commitizen_project_initial, mocker: MockFixture ): tmp_commitizen_project = tmp_commitizen_project_initial() @@ -1101,7 +1101,7 @@ def test_bump_command_prelease_scheme_via_cli( assert "0.2.0" in f.read() -def test_bump_command_prelease_scheme_via_config( +def test_bump_command_prerelease_scheme_via_config( tmp_commitizen_project_initial, mocker: MockFixture ): tmp_commitizen_project = tmp_commitizen_project_initial( @@ -1145,7 +1145,7 @@ def test_bump_command_prelease_scheme_via_config( assert "0.2.0" in f.read() -def test_bump_command_prelease_scheme_check_old_tags( +def test_bump_command_prerelease_scheme_check_old_tags( tmp_commitizen_project_initial, mocker: MockFixture ): tmp_commitizen_project = tmp_commitizen_project_initial( @@ -1285,7 +1285,7 @@ def test_bump_command_version_scheme_priority_over_version_type(mocker: MockFixt ), ), ) -def test_bump_template_option_precedance( +def test_bump_template_option_precedence( mocker: MockFixture, tmp_commitizen_project: Path, any_changelog_format: ChangelogFormat, @@ -1327,7 +1327,7 @@ def test_bump_template_option_precedance( assert out == expected -def test_bump_template_extras_precedance( +def test_bump_template_extras_precedence( mocker: MockFixture, tmp_commitizen_project: Path, any_changelog_format: ChangelogFormat, diff --git a/tests/commands/test_changelog_command.py b/tests/commands/test_changelog_command.py index f794b8d9f..12a2e04b4 100644 --- a/tests/commands/test_changelog_command.py +++ b/tests/commands/test_changelog_command.py @@ -1481,7 +1481,7 @@ def test_changelog_from_current_version_tag_with_nonversion_tag( ), ), ) -def test_changelog_template_option_precedance( +def test_changelog_template_option_precedence( mocker: MockFixture, tmp_commitizen_project: Path, any_changelog_format: ChangelogFormat, @@ -1523,7 +1523,7 @@ def test_changelog_template_option_precedance( assert out == expected -def test_changelog_template_extras_precedance( +def test_changelog_template_extras_precedence( mocker: MockFixture, tmp_commitizen_project: Path, mock_plugin: BaseCommitizen, diff --git a/tests/commands/test_check_command.py b/tests/commands/test_check_command.py index f1db44619..d95a173d8 100644 --- a/tests/commands/test_check_command.py +++ b/tests/commands/test_check_command.py @@ -365,7 +365,7 @@ def test_check_command_with_pipe_message_and_failed(mocker: MockFixture): assert "commit validation: failed!" in str(excinfo.value) -def test_check_command_with_comment_in_messege_file(mocker: MockFixture, capsys): +def test_check_command_with_comment_in_message_file(mocker: MockFixture, capsys): testargs = ["cz", "check", "--commit-msg-file", "some_file"] mocker.patch.object(sys, "argv", testargs) mocker.patch( diff --git a/tests/commands/test_init_command.py b/tests/commands/test_init_command.py index ea18e89a2..f617c51d8 100644 --- a/tests/commands/test_init_command.py +++ b/tests/commands/test_init_command.py @@ -183,7 +183,7 @@ def check_pre_commit_config(expected: list[dict[str, Any]]): @pytest.mark.usefixtures("pre_commit_installed") class TestPreCommitCases: - def test_no_existing_pre_commit_conifg(_, default_choice, tmpdir, config): + def test_no_existing_pre_commit_config(_, default_choice, tmpdir, config): with tmpdir.as_cwd(): commands.Init(config)() check_cz_config(default_choice) diff --git a/tests/conftest.py b/tests/conftest.py index 3d88f19b1..60c586f2e 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -232,7 +232,7 @@ def message(self, answers: dict) -> str: @pytest.fixture def mock_plugin(mocker: MockerFixture, config: BaseConfig) -> BaseCommitizen: mock = MockPlugin(config) - mocker.patch("commitizen.factory.commiter_factory", return_value=mock) + mocker.patch("commitizen.factory.committer_factory", return_value=mock) return mock diff --git a/tests/test_bump_update_version_in_files.py b/tests/test_bump_update_version_in_files.py index 850b59c16..c14e4ad1c 100644 --- a/tests/test_bump_update_version_in_files.py +++ b/tests/test_bump_update_version_in_files.py @@ -197,7 +197,7 @@ def test_file_version_inconsistent_error( assert expected_msg in str(excinfo.value) -def test_multiplt_versions_to_bump( +def test_multiple_versions_to_bump( multiple_versions_to_update_poetry_lock, file_regression ): old_version = "1.2.9" @@ -216,7 +216,7 @@ def test_update_version_in_globbed_files(commitizen_config_file, file_regression print(commitizen_config_file, other) copyfile(commitizen_config_file, other) - # Prepend full ppath as test assume absolute paths or cwd-relative + # Prepend full path as test assume absolute paths or cwd-relative version_files = [commitizen_config_file.dirpath("*.toml")] bump.update_version_in_files( diff --git a/tests/test_changelog_format_asciidoc.py b/tests/test_changelog_format_asciidoc.py index 59ca56191..cc81a24f2 100644 --- a/tests/test_changelog_format_asciidoc.py +++ b/tests/test_changelog_format_asciidoc.py @@ -160,7 +160,7 @@ def test_parse_title_type_of_line( pytest.param(CHANGELOG_D, EXPECTED_D, id="D"), ), ) -def test_get_matadata( +def test_get_metadata( tmp_path: Path, format: AsciiDoc, content: str, expected: Metadata ): changelog = tmp_path / format.default_changelog_file diff --git a/tests/test_changelog_format_markdown.py b/tests/test_changelog_format_markdown.py index e1f0d6731..1abc63f29 100644 --- a/tests/test_changelog_format_markdown.py +++ b/tests/test_changelog_format_markdown.py @@ -160,7 +160,7 @@ def test_parse_title_type_of_line( pytest.param(CHANGELOG_D, EXPECTED_D, id="D"), ), ) -def test_get_matadata( +def test_get_metadata( tmp_path: Path, format: Markdown, content: str, expected: Metadata ): changelog = tmp_path / format.default_changelog_file diff --git a/tests/test_changelog_format_restructuredtext.py b/tests/test_changelog_format_restructuredtext.py index 74b6b736f..14bc15ec0 100644 --- a/tests/test_changelog_format_restructuredtext.py +++ b/tests/test_changelog_format_restructuredtext.py @@ -311,7 +311,7 @@ def format_with_tags(config: BaseConfig, request) -> RestructuredText: @pytest.mark.parametrize("content, expected", CASES) -def test_get_matadata( +def test_get_metadata( tmp_path: Path, format: RestructuredText, content: str, expected: Metadata ): changelog = tmp_path / format.default_changelog_file diff --git a/tests/test_changelog_format_textile.py b/tests/test_changelog_format_textile.py index eb03484ad..812fa6bf6 100644 --- a/tests/test_changelog_format_textile.py +++ b/tests/test_changelog_format_textile.py @@ -153,7 +153,7 @@ def test_parse_title_type_of_line( pytest.param(CHANGELOG_D, EXPECTED_D, id="D"), ), ) -def test_get_matadata( +def test_get_metadata( tmp_path: Path, format: Textile, content: str, expected: Metadata ): changelog = tmp_path / format.default_changelog_file diff --git a/tests/test_cz_customize.py b/tests/test_cz_customize.py index 210c8b677..933b1aa06 100644 --- a/tests/test_cz_customize.py +++ b/tests/test_cz_customize.py @@ -473,16 +473,16 @@ def test_answer(config): cz = CustomizeCommitsCz(config) answers = { "change_type": "feature", - "message": "this feature enaable customize through config file", + "message": "this feature enable customize through config file", "show_message": True, } message = cz.message(answers) - assert message == "feature: this feature enaable customize through config file" + assert message == "feature: this feature enable customize through config file" cz = CustomizeCommitsCz(config) answers = { "change_type": "feature", - "message": "this feature enaable customize through config file", + "message": "this feature enable customize through config file", "show_message": False, } message = cz.message(answers) diff --git a/tests/test_factory.py b/tests/test_factory.py index 390742f46..d81a84b3d 100644 --- a/tests/test_factory.py +++ b/tests/test_factory.py @@ -28,7 +28,7 @@ class OtherPlugin: def test_factory(): config = BaseConfig() config.settings.update({"name": defaults.DEFAULT_SETTINGS["name"]}) - r = factory.commiter_factory(config) + r = factory.committer_factory(config) assert isinstance(r, BaseCommitizen) @@ -36,7 +36,7 @@ def test_factory_fails(): config = BaseConfig() config.settings.update({"name": "Nothing"}) with pytest.raises(NoCommitizenFoundException) as excinfo: - factory.commiter_factory(config) + factory.committer_factory(config) assert "The committer has not been found in the system." in str(excinfo) diff --git a/tests/test_version_scheme_pep440.py b/tests/test_version_scheme_pep440.py index 6b1f621cb..a983dad14 100644 --- a/tests/test_version_scheme_pep440.py +++ b/tests/test_version_scheme_pep440.py @@ -144,7 +144,7 @@ (("3.1.4a0", "MAJOR", "alpha", 0, None), "4.0.0a0"), ] -excact_cases = [ +exact_cases = [ (("1.0.0", "PATCH", None, 0, None), "1.0.1"), (("1.0.0", "MINOR", None, 0, None), "1.1.0"), # with exact_increment=False: "1.0.0b0" @@ -213,7 +213,7 @@ def test_bump_pep440_version(test_input, expected): ) -@pytest.mark.parametrize("test_input, expected", excact_cases) +@pytest.mark.parametrize("test_input, expected", exact_cases) def test_bump_pep440_version_force(test_input, expected): current_version = test_input[0] increment = test_input[1] diff --git a/tests/test_version_scheme_semver.py b/tests/test_version_scheme_semver.py index 71d5e5876..8785717a3 100644 --- a/tests/test_version_scheme_semver.py +++ b/tests/test_version_scheme_semver.py @@ -83,7 +83,7 @@ (("1.0.0-alpha1", None, "alpha", 0, None), "1.0.0-a2"), ] -excact_cases = [ +exact_cases = [ (("1.0.0", "PATCH", None, 0, None), "1.0.1"), (("1.0.0", "MINOR", None, 0, None), "1.1.0"), # with exact_increment=False: "1.0.0-b0" @@ -144,7 +144,7 @@ def test_bump_semver_version(test_input, expected): ) -@pytest.mark.parametrize("test_input, expected", excact_cases) +@pytest.mark.parametrize("test_input, expected", exact_cases) def test_bump_semver_version_force(test_input, expected): current_version = test_input[0] increment = test_input[1]