diff options
-rw-r--r-- | .coveragerc | 2 | ||||
-rw-r--r-- | .github/workflows/checks.yml | 10 | ||||
-rw-r--r-- | .pre-commit-hooks.yaml | 1 | ||||
-rw-r--r-- | CHANGELOG.md | 6 | ||||
-rw-r--r-- | MANIFEST.in | 4 | ||||
-rw-r--r-- | doc-requirements.txt | 2 | ||||
-rw-r--r-- | docs/configuration.md | 2 | ||||
-rw-r--r-- | docs/contributing.md | 6 | ||||
-rw-r--r-- | docs/index.md | 2 | ||||
-rw-r--r-- | docs/user_defined_rules.md | 4 | ||||
-rw-r--r-- | examples/gitlint | 2 | ||||
l--------- | gitlint-core/LICENSE | 1 | ||||
-rw-r--r-- | gitlint-core/MANIFEST.in | 3 | ||||
l--------- | gitlint-core/README.md | 1 | ||||
-rw-r--r-- | gitlint-core/gitlint/__init__.py | 1 | ||||
-rw-r--r-- | gitlint-core/gitlint/cache.py (renamed from gitlint/cache.py) | 0 | ||||
-rw-r--r-- | gitlint-core/gitlint/cli.py (renamed from gitlint/cli.py) | 0 | ||||
-rw-r--r-- | gitlint-core/gitlint/config.py (renamed from gitlint/config.py) | 2 | ||||
-rw-r--r-- | gitlint-core/gitlint/contrib/__init__.py (renamed from gitlint/contrib/__init__.py) | 0 | ||||
-rw-r--r-- | gitlint-core/gitlint/contrib/rules/__init__.py (renamed from gitlint/contrib/rules/__init__.py) | 0 | ||||
-rw-r--r-- | gitlint-core/gitlint/contrib/rules/conventional_commit.py (renamed from gitlint/contrib/rules/conventional_commit.py) | 0 | ||||
-rw-r--r-- | gitlint-core/gitlint/contrib/rules/signedoff_by.py (renamed from gitlint/contrib/rules/signedoff_by.py) | 0 | ||||
-rw-r--r-- | gitlint-core/gitlint/display.py (renamed from gitlint/display.py) | 0 | ||||
-rw-r--r-- | gitlint-core/gitlint/exception.py (renamed from gitlint/exception.py) | 0 | ||||
-rw-r--r-- | gitlint-core/gitlint/files/commit-msg (renamed from gitlint/files/commit-msg) | 2 | ||||
-rw-r--r-- | gitlint-core/gitlint/files/gitlint (renamed from gitlint/files/gitlint) | 4 | ||||
-rw-r--r-- | gitlint-core/gitlint/git.py (renamed from gitlint/git.py) | 2 | ||||
-rw-r--r-- | gitlint-core/gitlint/hooks.py (renamed from gitlint/hooks.py) | 0 | ||||
-rw-r--r-- | gitlint-core/gitlint/lint.py (renamed from gitlint/lint.py) | 0 | ||||
-rw-r--r-- | gitlint-core/gitlint/options.py (renamed from gitlint/options.py) | 2 | ||||
-rw-r--r-- | gitlint-core/gitlint/rule_finder.py (renamed from gitlint/rule_finder.py) | 0 | ||||
-rw-r--r-- | gitlint-core/gitlint/rules.py (renamed from gitlint/rules.py) | 0 | ||||
-rw-r--r-- | gitlint-core/gitlint/shell.py (renamed from gitlint/shell.py) | 2 | ||||
-rw-r--r-- | gitlint-core/gitlint/tests/__init__.py (renamed from gitlint/tests/__init__.py) | 0 | ||||
-rw-r--r-- | gitlint-core/gitlint/tests/base.py (renamed from gitlint/tests/base.py) | 2 | ||||
-rw-r--r-- | gitlint-core/gitlint/tests/cli/test_cli.py (renamed from gitlint/tests/cli/test_cli.py) | 0 | ||||
-rw-r--r-- | gitlint-core/gitlint/tests/cli/test_cli_hooks.py (renamed from gitlint/tests/cli/test_cli_hooks.py) | 0 | ||||
-rw-r--r-- | gitlint-core/gitlint/tests/config/test_config.py (renamed from gitlint/tests/config/test_config.py) | 0 | ||||
-rw-r--r-- | gitlint-core/gitlint/tests/config/test_config_builder.py (renamed from gitlint/tests/config/test_config_builder.py) | 0 | ||||
-rw-r--r-- | gitlint-core/gitlint/tests/config/test_config_precedence.py (renamed from gitlint/tests/config/test_config_precedence.py) | 0 | ||||
-rw-r--r-- | gitlint-core/gitlint/tests/config/test_rule_collection.py (renamed from gitlint/tests/config/test_rule_collection.py) | 2 | ||||
-rw-r--r-- | gitlint-core/gitlint/tests/contrib/__init__.py (renamed from gitlint/tests/contrib/__init__.py) | 0 | ||||
-rw-r--r-- | gitlint-core/gitlint/tests/contrib/rules/__init__.py (renamed from gitlint/tests/contrib/rules/__init__.py) | 0 | ||||
-rw-r--r-- | gitlint-core/gitlint/tests/contrib/rules/test_conventional_commit.py (renamed from gitlint/tests/contrib/rules/test_conventional_commit.py) | 0 | ||||
-rw-r--r-- | gitlint-core/gitlint/tests/contrib/rules/test_signedoff_by.py (renamed from gitlint/tests/contrib/rules/test_signedoff_by.py) | 0 | ||||
-rw-r--r-- | gitlint-core/gitlint/tests/contrib/test_contrib_rules.py (renamed from gitlint/tests/contrib/test_contrib_rules.py) | 0 | ||||
-rw-r--r-- | gitlint-core/gitlint/tests/expected/cli/test_cli/test_contrib_1 (renamed from gitlint/tests/expected/cli/test_cli/test_contrib_1) | 0 | ||||
-rw-r--r-- | gitlint-core/gitlint/tests/expected/cli/test_cli/test_debug_1 (renamed from gitlint/tests/expected/cli/test_cli/test_debug_1) | 0 | ||||
-rw-r--r-- | gitlint-core/gitlint/tests/expected/cli/test_cli/test_input_stream_1 (renamed from gitlint/tests/expected/cli/test_cli/test_input_stream_1) | 0 | ||||
-rw-r--r-- | gitlint-core/gitlint/tests/expected/cli/test_cli/test_input_stream_debug_1 (renamed from gitlint/tests/expected/cli/test_cli/test_input_stream_debug_1) | 0 | ||||
-rw-r--r-- | gitlint-core/gitlint/tests/expected/cli/test_cli/test_input_stream_debug_2 (renamed from gitlint/tests/expected/cli/test_cli/test_input_stream_debug_2) | 0 | ||||
-rw-r--r-- | gitlint-core/gitlint/tests/expected/cli/test_cli/test_lint_commit_1 (renamed from gitlint/tests/expected/cli/test_cli/test_lint_commit_1) | 0 | ||||
-rw-r--r-- | gitlint-core/gitlint/tests/expected/cli/test_cli/test_lint_multiple_commits_1 (renamed from gitlint/tests/expected/cli/test_cli/test_lint_multiple_commits_1) | 0 | ||||
-rw-r--r-- | gitlint-core/gitlint/tests/expected/cli/test_cli/test_lint_multiple_commits_config_1 (renamed from gitlint/tests/expected/cli/test_cli/test_lint_multiple_commits_config_1) | 0 | ||||
-rw-r--r-- | gitlint-core/gitlint/tests/expected/cli/test_cli/test_lint_staged_msg_filename_1 (renamed from gitlint/tests/expected/cli/test_cli/test_lint_staged_msg_filename_1) | 0 | ||||
-rw-r--r-- | gitlint-core/gitlint/tests/expected/cli/test_cli/test_lint_staged_msg_filename_2 (renamed from gitlint/tests/expected/cli/test_cli/test_lint_staged_msg_filename_2) | 0 | ||||
-rw-r--r-- | gitlint-core/gitlint/tests/expected/cli/test_cli/test_lint_staged_stdin_1 (renamed from gitlint/tests/expected/cli/test_cli/test_lint_staged_stdin_1) | 0 | ||||
-rw-r--r-- | gitlint-core/gitlint/tests/expected/cli/test_cli/test_lint_staged_stdin_2 (renamed from gitlint/tests/expected/cli/test_cli/test_lint_staged_stdin_2) | 0 | ||||
-rw-r--r-- | gitlint-core/gitlint/tests/expected/cli/test_cli/test_named_rules_1 (renamed from gitlint/tests/expected/cli/test_cli/test_named_rules_1) | 0 | ||||
-rw-r--r-- | gitlint-core/gitlint/tests/expected/cli/test_cli/test_named_rules_2 (renamed from gitlint/tests/expected/cli/test_cli/test_named_rules_2) | 0 | ||||
-rw-r--r-- | gitlint-core/gitlint/tests/expected/cli/test_cli_hooks/test_hook_config_1_stderr (renamed from gitlint/tests/expected/cli/test_cli_hooks/test_hook_config_1_stderr) | 0 | ||||
-rw-r--r-- | gitlint-core/gitlint/tests/expected/cli/test_cli_hooks/test_hook_config_1_stdout (renamed from gitlint/tests/expected/cli/test_cli_hooks/test_hook_config_1_stdout) | 0 | ||||
-rw-r--r-- | gitlint-core/gitlint/tests/expected/cli/test_cli_hooks/test_hook_edit_1_stderr (renamed from gitlint/tests/expected/cli/test_cli_hooks/test_hook_edit_1_stderr) | 0 | ||||
-rw-r--r-- | gitlint-core/gitlint/tests/expected/cli/test_cli_hooks/test_hook_edit_1_stdout (renamed from gitlint/tests/expected/cli/test_cli_hooks/test_hook_edit_1_stdout) | 0 | ||||
-rw-r--r-- | gitlint-core/gitlint/tests/expected/cli/test_cli_hooks/test_hook_local_commit_1_stderr (renamed from gitlint/tests/expected/cli/test_cli_hooks/test_hook_local_commit_1_stderr) | 0 | ||||
-rw-r--r-- | gitlint-core/gitlint/tests/expected/cli/test_cli_hooks/test_hook_local_commit_1_stdout (renamed from gitlint/tests/expected/cli/test_cli_hooks/test_hook_local_commit_1_stdout) | 0 | ||||
-rw-r--r-- | gitlint-core/gitlint/tests/expected/cli/test_cli_hooks/test_hook_no_1_stderr (renamed from gitlint/tests/expected/cli/test_cli_hooks/test_hook_no_1_stderr) | 0 | ||||
-rw-r--r-- | gitlint-core/gitlint/tests/expected/cli/test_cli_hooks/test_hook_no_1_stdout (renamed from gitlint/tests/expected/cli/test_cli_hooks/test_hook_no_1_stdout) | 0 | ||||
-rw-r--r-- | gitlint-core/gitlint/tests/expected/cli/test_cli_hooks/test_hook_no_tty_1_stderr (renamed from gitlint/tests/expected/cli/test_cli_hooks/test_hook_no_tty_1_stderr) | 0 | ||||
-rw-r--r-- | gitlint-core/gitlint/tests/expected/cli/test_cli_hooks/test_hook_no_tty_1_stdout (renamed from gitlint/tests/expected/cli/test_cli_hooks/test_hook_no_tty_1_stdout) | 0 | ||||
-rw-r--r-- | gitlint-core/gitlint/tests/expected/cli/test_cli_hooks/test_hook_stdin_no_violations_1_stdout (renamed from gitlint/tests/expected/cli/test_cli_hooks/test_hook_stdin_no_violations_1_stdout) | 0 | ||||
-rw-r--r-- | gitlint-core/gitlint/tests/expected/cli/test_cli_hooks/test_hook_stdin_violations_1_stderr (renamed from gitlint/tests/expected/cli/test_cli_hooks/test_hook_stdin_violations_1_stderr) | 0 | ||||
-rw-r--r-- | gitlint-core/gitlint/tests/expected/cli/test_cli_hooks/test_hook_stdin_violations_1_stdout (renamed from gitlint/tests/expected/cli/test_cli_hooks/test_hook_stdin_violations_1_stdout) | 0 | ||||
-rw-r--r-- | gitlint-core/gitlint/tests/expected/cli/test_cli_hooks/test_hook_yes_1_stderr (renamed from gitlint/tests/expected/cli/test_cli_hooks/test_hook_yes_1_stderr) | 0 | ||||
-rw-r--r-- | gitlint-core/gitlint/tests/expected/cli/test_cli_hooks/test_hook_yes_1_stdout (renamed from gitlint/tests/expected/cli/test_cli_hooks/test_hook_yes_1_stdout) | 0 | ||||
-rw-r--r-- | gitlint-core/gitlint/tests/expected/cli/test_cli_hooks/test_run_hook_negative_1 (renamed from gitlint/tests/expected/cli/test_cli_hooks/test_run_hook_negative_1) | 0 | ||||
-rw-r--r-- | gitlint-core/gitlint/tests/expected/cli/test_cli_hooks/test_run_hook_negative_2 (renamed from gitlint/tests/expected/cli/test_cli_hooks/test_run_hook_negative_2) | 0 | ||||
-rw-r--r-- | gitlint-core/gitlint/tests/git/test_git.py (renamed from gitlint/tests/git/test_git.py) | 0 | ||||
-rw-r--r-- | gitlint-core/gitlint/tests/git/test_git_commit.py (renamed from gitlint/tests/git/test_git_commit.py) | 0 | ||||
-rw-r--r-- | gitlint-core/gitlint/tests/git/test_git_context.py (renamed from gitlint/tests/git/test_git_context.py) | 0 | ||||
-rw-r--r-- | gitlint-core/gitlint/tests/rules/__init__.py (renamed from gitlint/tests/rules/__init__.py) | 0 | ||||
-rw-r--r-- | gitlint-core/gitlint/tests/rules/test_body_rules.py (renamed from gitlint/tests/rules/test_body_rules.py) | 0 | ||||
-rw-r--r-- | gitlint-core/gitlint/tests/rules/test_configuration_rules.py (renamed from gitlint/tests/rules/test_configuration_rules.py) | 0 | ||||
-rw-r--r-- | gitlint-core/gitlint/tests/rules/test_meta_rules.py (renamed from gitlint/tests/rules/test_meta_rules.py) | 0 | ||||
-rw-r--r-- | gitlint-core/gitlint/tests/rules/test_rules.py (renamed from gitlint/tests/rules/test_rules.py) | 0 | ||||
-rw-r--r-- | gitlint-core/gitlint/tests/rules/test_title_rules.py (renamed from gitlint/tests/rules/test_title_rules.py) | 0 | ||||
-rw-r--r-- | gitlint-core/gitlint/tests/rules/test_user_rules.py (renamed from gitlint/tests/rules/test_user_rules.py) | 2 | ||||
-rw-r--r-- | gitlint-core/gitlint/tests/samples/commit_message/fixup (renamed from gitlint/tests/samples/commit_message/fixup) | 0 | ||||
-rw-r--r-- | gitlint-core/gitlint/tests/samples/commit_message/merge (renamed from gitlint/tests/samples/commit_message/merge) | 0 | ||||
-rw-r--r-- | gitlint-core/gitlint/tests/samples/commit_message/no-violations (renamed from gitlint/tests/samples/commit_message/no-violations) | 0 | ||||
-rw-r--r-- | gitlint-core/gitlint/tests/samples/commit_message/revert (renamed from gitlint/tests/samples/commit_message/revert) | 0 | ||||
-rw-r--r-- | gitlint-core/gitlint/tests/samples/commit_message/sample1 (renamed from gitlint/tests/samples/commit_message/sample1) | 0 | ||||
-rw-r--r-- | gitlint-core/gitlint/tests/samples/commit_message/sample2 (renamed from gitlint/tests/samples/commit_message/sample2) | 0 | ||||
-rw-r--r-- | gitlint-core/gitlint/tests/samples/commit_message/sample3 (renamed from gitlint/tests/samples/commit_message/sample3) | 0 | ||||
-rw-r--r-- | gitlint-core/gitlint/tests/samples/commit_message/sample4 (renamed from gitlint/tests/samples/commit_message/sample4) | 0 | ||||
-rw-r--r-- | gitlint-core/gitlint/tests/samples/commit_message/sample5 (renamed from gitlint/tests/samples/commit_message/sample5) | 0 | ||||
-rw-r--r-- | gitlint-core/gitlint/tests/samples/commit_message/squash (renamed from gitlint/tests/samples/commit_message/squash) | 0 | ||||
-rw-r--r-- | gitlint-core/gitlint/tests/samples/config/gitlintconfig (renamed from gitlint/tests/samples/config/gitlintconfig) | 0 | ||||
-rw-r--r-- | gitlint-core/gitlint/tests/samples/config/invalid-option-value (renamed from gitlint/tests/samples/config/invalid-option-value) | 0 | ||||
-rw-r--r-- | gitlint-core/gitlint/tests/samples/config/named-rules (renamed from gitlint/tests/samples/config/named-rules) | 0 | ||||
-rw-r--r-- | gitlint-core/gitlint/tests/samples/config/no-sections (renamed from gitlint/tests/samples/config/no-sections) | 0 | ||||
-rw-r--r-- | gitlint-core/gitlint/tests/samples/config/nonexisting-general-option (renamed from gitlint/tests/samples/config/nonexisting-general-option) | 0 | ||||
-rw-r--r-- | gitlint-core/gitlint/tests/samples/config/nonexisting-option (renamed from gitlint/tests/samples/config/nonexisting-option) | 0 | ||||
-rw-r--r-- | gitlint-core/gitlint/tests/samples/config/nonexisting-rule (renamed from gitlint/tests/samples/config/nonexisting-rule) | 0 | ||||
-rw-r--r-- | gitlint-core/gitlint/tests/samples/user_rules/bogus-file.txt (renamed from gitlint/tests/samples/user_rules/bogus-file.txt) | 0 | ||||
-rw-r--r-- | gitlint-core/gitlint/tests/samples/user_rules/import_exception/invalid_python.py (renamed from gitlint/tests/samples/user_rules/import_exception/invalid_python.py) | 0 | ||||
-rw-r--r-- | gitlint-core/gitlint/tests/samples/user_rules/incorrect_linerule/my_line_rule.py (renamed from gitlint/tests/samples/user_rules/incorrect_linerule/my_line_rule.py) | 0 | ||||
-rw-r--r-- | gitlint-core/gitlint/tests/samples/user_rules/my_commit_rules.foo (renamed from gitlint/tests/samples/user_rules/my_commit_rules.foo) | 0 | ||||
-rw-r--r-- | gitlint-core/gitlint/tests/samples/user_rules/my_commit_rules.py (renamed from gitlint/tests/samples/user_rules/my_commit_rules.py) | 0 | ||||
-rw-r--r-- | gitlint-core/gitlint/tests/samples/user_rules/parent_package/__init__.py (renamed from gitlint/tests/samples/user_rules/parent_package/__init__.py) | 0 | ||||
-rw-r--r-- | gitlint-core/gitlint/tests/samples/user_rules/parent_package/my_commit_rules.py (renamed from gitlint/tests/samples/user_rules/parent_package/my_commit_rules.py) | 0 | ||||
-rw-r--r-- | gitlint-core/gitlint/tests/test_cache.py (renamed from gitlint/tests/test_cache.py) | 0 | ||||
-rw-r--r-- | gitlint-core/gitlint/tests/test_display.py (renamed from gitlint/tests/test_display.py) | 0 | ||||
-rw-r--r-- | gitlint-core/gitlint/tests/test_hooks.py (renamed from gitlint/tests/test_hooks.py) | 0 | ||||
-rw-r--r-- | gitlint-core/gitlint/tests/test_lint.py (renamed from gitlint/tests/test_lint.py) | 0 | ||||
-rw-r--r-- | gitlint-core/gitlint/tests/test_options.py (renamed from gitlint/tests/test_options.py) | 0 | ||||
-rw-r--r-- | gitlint-core/gitlint/tests/test_utils.py (renamed from gitlint/tests/test_utils.py) | 0 | ||||
-rw-r--r-- | gitlint-core/gitlint/utils.py (renamed from gitlint/utils.py) | 0 | ||||
-rw-r--r-- | gitlint-core/setup.cfg | 2 | ||||
-rw-r--r-- | gitlint-core/setup.py | 107 | ||||
-rw-r--r-- | gitlint/__init__.py | 1 | ||||
-rw-r--r-- | qa/requirements.txt | 2 | ||||
-rw-r--r-- | qa/shell.py | 2 | ||||
-rw-r--r-- | qa/test_stdin.py | 2 | ||||
-rw-r--r-- | requirements.txt | 5 | ||||
-rwxr-xr-x | run_tests.sh | 20 | ||||
-rw-r--r-- | setup.py | 50 | ||||
-rw-r--r-- | test-requirements.txt | 8 |
128 files changed, 171 insertions, 95 deletions
diff --git a/.coveragerc b/.coveragerc index a120715..9da615c 100644 --- a/.coveragerc +++ b/.coveragerc @@ -3,4 +3,4 @@ fail_under = 97 [run] branch = true -omit=*dist-packages*,*site-packages*,gitlint/tests/*,.venv/*,*virtualenv* +omit=*dist-packages*,*site-packages*,gitlint-core/gitlint/tests/*,.venv/*,*virtualenv* diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 8fbda21..1ca2a9c 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -109,13 +109,13 @@ jobs: run: gitlint --version - name: Tests (sanity) - run: tools\windows\run_tests.bat "gitlint\tests\cli\test_cli.py::CLITests::test_lint" + run: tools\windows\run_tests.bat "gitlint-core\gitlint\tests\cli\test_cli.py::CLITests::test_lint" - name: Tests (ignore cli\*) - run: pytest --ignore gitlint\tests\cli -rw -s gitlint + run: pytest --ignore gitlint-core\gitlint\tests\cli -rw -s gitlint-core - name: Tests (test_cli.py only - continue-on-error:true) - run: tools\windows\run_tests.bat "gitlint\tests\cli\test_cli.py" + run: tools\windows\run_tests.bat "gitlint-core\gitlint\tests\cli\test_cli.py" continue-on-error: true # Known to fail at this point - name: Tests (all - continue-on-error:true) @@ -127,10 +127,10 @@ jobs: continue-on-error: true # Known to fail at this point - name: PEP8 - run: flake8 gitlint qa examples + run: flake8 gitlint-core qa examples - name: PyLint - run: pylint gitlint qa --rcfile=".pylintrc" -r n + run: pylint gitlint-core\gitlint qa --rcfile=".pylintrc" -r n # Re-add git version control so we can run gitlint on itself. - name: Re-add git version control to code diff --git a/.pre-commit-hooks.yaml b/.pre-commit-hooks.yaml index 4b15bfd..f2ccc7f 100644 --- a/.pre-commit-hooks.yaml +++ b/.pre-commit-hooks.yaml @@ -1,6 +1,7 @@ - id: gitlint name: gitlint language: python + additional_dependencies: ["./gitlint-core[trusted-deps]"] entry: gitlint args: [--staged, --msg-filename] stages: [commit-msg] diff --git a/CHANGELOG.md b/CHANGELOG.md index dd224e3..2546579 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog # +## v0.17.0 (2021-11-28) ## +Contributors: +Special thanks to all contributors for this release, in particular [andersk](https://github.com/andersk) and [sigmavirus24](https://github.com/sigmavirus24). + +- Gitlint is now split in 2 packages: `gitlint` and `gitlint-core`. This allows users to install gitlint without pinned dependencies (which is the default) ([#162](https://github.com/jorisroovers/gitlint/issues/162)) +- Under-the-hood: dependencies updated ## v0.16.0 (2021-10-08) ## Contributors: diff --git a/MANIFEST.in b/MANIFEST.in index 51a5598..ad3da8a 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -3,5 +3,5 @@ include LICENSE exclude Vagrantfile exclude *.yml *.sh *.txt recursive-exclude examples * -recursive-exclude gitlint/tests * -recursive-exclude qa *
\ No newline at end of file +recursive-exclude gitlint-core * +recursive-exclude qa * diff --git a/doc-requirements.txt b/doc-requirements.txt index becd4f4..33ce51e 100644 --- a/doc-requirements.txt +++ b/doc-requirements.txt @@ -1 +1 @@ -mkdocs==1.2.2
\ No newline at end of file +mkdocs==1.2.3
\ No newline at end of file diff --git a/docs/configuration.md b/docs/configuration.md index 226ba8a..addf0c0 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -108,7 +108,7 @@ ignore-merge-commits=false # This is useful for when developers often erroneously edit certain files or git submodules. # By specifying this rule, developers can only change the file when they explicitly # reference it in the commit message. -files=gitlint/rules.py,README.md +files=gitlint-core/gitlint/rules.py,README.md [body-match-regex] # python-style regex that the commit-msg body must match. diff --git a/docs/contributing.md b/docs/contributing.md index d39f9e1..1002676 100644 --- a/docs/contributing.md +++ b/docs/contributing.md @@ -13,7 +13,7 @@ that's open to a lot of change and input. When contributing code, please consider all the parts that are typically required: -- [Unit tests](https://github.com/jorisroovers/gitlint/tree/main/gitlint/tests) (automatically +- [Unit tests](https://github.com/jorisroovers/gitlint/tree/main/gitlint-core/gitlint/tests) (automatically [enforced by CI](https://github.com/jorisroovers/gitlint/actions)). Please consider writing new ones for your functionality, not only updating existing ones to make the build pass. - [Integration tests](https://github.com/jorisroovers/gitlint/tree/main/qa) (also automatically @@ -118,8 +118,8 @@ Then, we suggest taking the following approach to add a Contrib rule: 1. **Write your rule as a [user-defined rule](../user_defined_rules)**. In terms of code, Contrib rules are identical to user-defined rules, they just happen to have their code sit within the gitlint codebase itself. -2. **Add your user-defined rule to gitlint**. You should put your file(s) in the [gitlint/contrib/rules](https://github.com/jorisroovers/gitlint/tree/main/gitlint/contrib/rules) directory. -3. **Write unit tests**. The gitlint codebase contains [Contrib rule test files you can copy and modify](https://github.com/jorisroovers/gitlint/tree/main/gitlint/tests/contrib/rules). +2. **Add your user-defined rule to gitlint**. You should put your file(s) in the [gitlint/contrib/rules](https://github.com/jorisroovers/gitlint/tree/main/gitlint-core/gitlint/contrib/rules) directory. +3. **Write unit tests**. The gitlint codebase contains [Contrib rule test files you can copy and modify](https://github.com/jorisroovers/gitlint/tree/main/gitlint-core/gitlint/tests/contrib/rules). 4. **Write documentation**. In particular, you should update the [gitlint/docs/contrib_rules.md](https://github.com/jorisroovers/gitlint/blob/main/docs/contrib_rules.md) file with details on your Contrib rule. 5. **Create a Pull Request**: code review typically requires a bit of back and forth. Thanks for your contribution! diff --git a/docs/index.md b/docs/index.md index 98b72de..398b4e5 100644 --- a/docs/index.md +++ b/docs/index.md @@ -315,7 +315,7 @@ general `ignore-merge-commits`, `ignore-revert-commits`, `ignore-fixup-commits` You can configure gitlint to ignore specific commits or parts of a commit. -One way to do this, is to by [adding a gitline-ignore line to your commit message](configuration.md#commit-specific-config). +One way to do this, is by [adding a gitlint-ignore line to your commit message](configuration.md#commit-specific-config). If you have a case where you want to ignore a certain type of commits all-together, you can use gitlint's *ignore* rules. diff --git a/docs/user_defined_rules.md b/docs/user_defined_rules.md index 3b9f5e7..f58dcc7 100644 --- a/docs/user_defined_rules.md +++ b/docs/user_defined_rules.md @@ -374,7 +374,7 @@ class ReleaseConfigurationRule(ConfigurationRule): ``` For all available properties and methods on the `config` object, have a look at the -[LintConfig class](https://github.com/jorisroovers/gitlint/blob/main/gitlint/config.py). Please do not use any +[LintConfig class](https://github.com/jorisroovers/gitlint/blob/main/gitlint-core/gitlint/config.py). Please do not use any properties or methods starting with an underscore, as those are subject to change. @@ -385,7 +385,7 @@ As long as you stick with simple rules that are similar to the sample user-defin should be able to discover and execute them. While clearly you can run any python code you want in your rules, you might run into some issues if you don't follow the conventions that gitlint requires. -While the [rule finding source-code](https://github.com/jorisroovers/gitlint/blob/main/gitlint/rule_finder.py) is the +While the [rule finding source-code](https://github.com/jorisroovers/gitlint/blob/main/gitlint-core/gitlint/rule_finder.py) is the ultimate source of truth, here are some of the requirements that gitlint enforces. ### Rule class requirements diff --git a/examples/gitlint b/examples/gitlint index b722023..0261752 100644 --- a/examples/gitlint +++ b/examples/gitlint @@ -55,4 +55,4 @@ ignore-merge-commits=false # This is useful for when developers often erroneously edit certain files or git submodules. # By specifying this rule, developers can only change the file when they explicitly reference # it in the commit message. -files=gitlint/rules.py,README.md +files=gitlint-core/gitlint/rules.py,README.md diff --git a/gitlint-core/LICENSE b/gitlint-core/LICENSE new file mode 120000 index 0000000..ea5b606 --- /dev/null +++ b/gitlint-core/LICENSE @@ -0,0 +1 @@ +../LICENSE
\ No newline at end of file diff --git a/gitlint-core/MANIFEST.in b/gitlint-core/MANIFEST.in new file mode 100644 index 0000000..375cec1 --- /dev/null +++ b/gitlint-core/MANIFEST.in @@ -0,0 +1,3 @@ +include README.md +include LICENSE +recursive-exclude gitlint/tests * diff --git a/gitlint-core/README.md b/gitlint-core/README.md new file mode 120000 index 0000000..32d46ee --- /dev/null +++ b/gitlint-core/README.md @@ -0,0 +1 @@ +../README.md
\ No newline at end of file diff --git a/gitlint-core/gitlint/__init__.py b/gitlint-core/gitlint/__init__.py new file mode 100644 index 0000000..fd86b3e --- /dev/null +++ b/gitlint-core/gitlint/__init__.py @@ -0,0 +1 @@ +__version__ = "0.17.0" diff --git a/gitlint/cache.py b/gitlint-core/gitlint/cache.py index 1b6558f..1b6558f 100644 --- a/gitlint/cache.py +++ b/gitlint-core/gitlint/cache.py diff --git a/gitlint/cli.py b/gitlint-core/gitlint/cli.py index 19676b3..19676b3 100644 --- a/gitlint/cli.py +++ b/gitlint-core/gitlint/cli.py diff --git a/gitlint/config.py b/gitlint-core/gitlint/config.py index 6d2ead2..49c380a 100644 --- a/gitlint/config.py +++ b/gitlint-core/gitlint/config.py @@ -428,7 +428,7 @@ class LintConfigBuilder: f"'{config_option}' is an invalid configuration option. Use '<rule>.<option>=<value>'") from e def set_from_config_file(self, filename): - """ Loads lint config from a ini-style config file """ + """ Loads lint config from an ini-style config file """ if not os.path.exists(filename): raise LintConfigError(f"Invalid file path: {filename}") self._config_path = os.path.realpath(filename) diff --git a/gitlint/contrib/__init__.py b/gitlint-core/gitlint/contrib/__init__.py index e69de29..e69de29 100644 --- a/gitlint/contrib/__init__.py +++ b/gitlint-core/gitlint/contrib/__init__.py diff --git a/gitlint/contrib/rules/__init__.py b/gitlint-core/gitlint/contrib/rules/__init__.py index e69de29..e69de29 100644 --- a/gitlint/contrib/rules/__init__.py +++ b/gitlint-core/gitlint/contrib/rules/__init__.py diff --git a/gitlint/contrib/rules/conventional_commit.py b/gitlint-core/gitlint/contrib/rules/conventional_commit.py index 9c9d5cb..9c9d5cb 100644 --- a/gitlint/contrib/rules/conventional_commit.py +++ b/gitlint-core/gitlint/contrib/rules/conventional_commit.py diff --git a/gitlint/contrib/rules/signedoff_by.py b/gitlint-core/gitlint/contrib/rules/signedoff_by.py index 139a1b1..139a1b1 100644 --- a/gitlint/contrib/rules/signedoff_by.py +++ b/gitlint-core/gitlint/contrib/rules/signedoff_by.py diff --git a/gitlint/display.py b/gitlint-core/gitlint/display.py index c9bcb01..c9bcb01 100644 --- a/gitlint/display.py +++ b/gitlint-core/gitlint/display.py diff --git a/gitlint/exception.py b/gitlint-core/gitlint/exception.py index aee3fe2..aee3fe2 100644 --- a/gitlint/exception.py +++ b/gitlint-core/gitlint/exception.py diff --git a/gitlint/files/commit-msg b/gitlint-core/gitlint/files/commit-msg index 6a25d34..e754e8d 100644 --- a/gitlint/files/commit-msg +++ b/gitlint-core/gitlint/files/commit-msg @@ -11,7 +11,7 @@ if [ $stdin_available -eq 1 ]; then # Now that we know we have a functional tty, set stdin to it so we can ask the user questions :-) exec < /dev/tty - # On Windows, we need to explicitely set our stdout to the tty to make terminal editing work (e.g. vim) + # On Windows, we need to explicitly set our stdout to the tty to make terminal editing work (e.g. vim) # See SO for windows detection in bash (slight modified to work on plain shell (not bash)): # https://stackoverflow.com/questions/394230/how-to-detect-the-os-from-a-bash-script if [ "$OSTYPE" = "cygwin" ] || [ "$OSTYPE" = "msys" ] || [ "$OSTYPE" = "win32" ]; then diff --git a/gitlint/files/gitlint b/gitlint-core/gitlint/files/gitlint index cbbae70..c4d2122 100644 --- a/gitlint/files/gitlint +++ b/gitlint-core/gitlint/files/gitlint @@ -45,7 +45,7 @@ # extra-path=examples/ # This is an example of how to configure the "title-max-length" rule and -# set the line-length it enforces to 80 +# set the line-length it enforces to 50 # [title-max-length] # line-length=50 @@ -82,7 +82,7 @@ # This is useful for when developers often erroneously edit certain files or git submodules. # By specifying this rule, developers can only change the file when they explicitly reference # it in the commit message. -# files=gitlint/rules.py,README.md +# files=gitlint-core/gitlint/rules.py,README.md # [body-match-regex] # python-style regex that the commit-msg body must match. diff --git a/gitlint/git.py b/gitlint-core/gitlint/git.py index 773c7b2..2ac8b3d 100644 --- a/gitlint/git.py +++ b/gitlint-core/gitlint/git.py @@ -367,7 +367,7 @@ class GitContext(PropertyCache): def from_local_repository(repository_path, refspec=None, commit_hash=None): """ Retrieves the git context from a local git repository. :param repository_path: Path to the git repository to retrieve the context from - :param refspec: The commit(s) to retrieve (mutually exclusive with `commit_sha`) + :param refspec: The commit(s) to retrieve (mutually exclusive with `commit_hash`) :param commit_hash: Hash of the commit to retrieve (mutually exclusive with `refspec`) """ diff --git a/gitlint/hooks.py b/gitlint-core/gitlint/hooks.py index 87611e0..87611e0 100644 --- a/gitlint/hooks.py +++ b/gitlint-core/gitlint/hooks.py diff --git a/gitlint/lint.py b/gitlint-core/gitlint/lint.py index 4b6c8a3..4b6c8a3 100644 --- a/gitlint/lint.py +++ b/gitlint-core/gitlint/lint.py diff --git a/gitlint/options.py b/gitlint-core/gitlint/options.py index 9fdac8f..e5b7335 100644 --- a/gitlint/options.py +++ b/gitlint-core/gitlint/options.py @@ -86,7 +86,7 @@ class BoolOption(RuleOption): class ListOption(RuleOption): - """ Option that is either a given list or a comma-separated string that can be splitted into a list when being set. + """ Option that is either a given list or a comma-separated string that can be split into a list when being set. """ @allow_none diff --git a/gitlint/rule_finder.py b/gitlint-core/gitlint/rule_finder.py index e1c5e77..e1c5e77 100644 --- a/gitlint/rule_finder.py +++ b/gitlint-core/gitlint/rule_finder.py diff --git a/gitlint/rules.py b/gitlint-core/gitlint/rules.py index 1c5a618..1c5a618 100644 --- a/gitlint/rules.py +++ b/gitlint-core/gitlint/rules.py diff --git a/gitlint/shell.py b/gitlint-core/gitlint/shell.py index e05204a..365c65d 100644 --- a/gitlint/shell.py +++ b/gitlint-core/gitlint/shell.py @@ -1,7 +1,7 @@ """ This module implements a shim for the 'sh' library, mainly for use on Windows (sh is not supported on Windows). -We might consider removing the 'sh' dependency alltogether in the future, but 'sh' does provide a few +We might consider removing the 'sh' dependency altogether in the future, but 'sh' does provide a few capabilities wrt dealing with more edge-case environments on *nix systems that are useful. """ diff --git a/gitlint/tests/__init__.py b/gitlint-core/gitlint/tests/__init__.py index e69de29..e69de29 100644 --- a/gitlint/tests/__init__.py +++ b/gitlint-core/gitlint/tests/__init__.py diff --git a/gitlint/tests/base.py b/gitlint-core/gitlint/tests/base.py index 017122b..9d2d165 100644 --- a/gitlint/tests/base.py +++ b/gitlint-core/gitlint/tests/base.py @@ -33,7 +33,7 @@ class BaseTestCase(unittest.TestCase): logging.getLogger('gitlint').setLevel(logging.DEBUG) logging.getLogger('gitlint').handlers = [self.logcapture] - # Make sure we don't propagate anything to child loggers, we need to do this explicitely here + # Make sure we don't propagate anything to child loggers, we need to do this explicitly here # because if you run a specific test file like test_lint.py, we won't be calling the setupLogging() method # in gitlint.cli that normally takes care of this logging.getLogger('gitlint').propagate = False diff --git a/gitlint/tests/cli/test_cli.py b/gitlint-core/gitlint/tests/cli/test_cli.py index 59ec7af..59ec7af 100644 --- a/gitlint/tests/cli/test_cli.py +++ b/gitlint-core/gitlint/tests/cli/test_cli.py diff --git a/gitlint/tests/cli/test_cli_hooks.py b/gitlint-core/gitlint/tests/cli/test_cli_hooks.py index 825345f..825345f 100644 --- a/gitlint/tests/cli/test_cli_hooks.py +++ b/gitlint-core/gitlint/tests/cli/test_cli_hooks.py diff --git a/gitlint/tests/config/test_config.py b/gitlint-core/gitlint/tests/config/test_config.py index c3fd78a..c3fd78a 100644 --- a/gitlint/tests/config/test_config.py +++ b/gitlint-core/gitlint/tests/config/test_config.py diff --git a/gitlint/tests/config/test_config_builder.py b/gitlint-core/gitlint/tests/config/test_config_builder.py index e0d7f9b..e0d7f9b 100644 --- a/gitlint/tests/config/test_config_builder.py +++ b/gitlint-core/gitlint/tests/config/test_config_builder.py diff --git a/gitlint/tests/config/test_config_precedence.py b/gitlint-core/gitlint/tests/config/test_config_precedence.py index aa4de88..aa4de88 100644 --- a/gitlint/tests/config/test_config_precedence.py +++ b/gitlint-core/gitlint/tests/config/test_config_precedence.py diff --git a/gitlint/tests/config/test_rule_collection.py b/gitlint-core/gitlint/tests/config/test_rule_collection.py index 5a50be0..17b50cc 100644 --- a/gitlint/tests/config/test_rule_collection.py +++ b/gitlint-core/gitlint/tests/config/test_rule_collection.py @@ -19,7 +19,7 @@ class RuleCollectionTests(BaseTestCase): self.assertEqual(len(collection), 1) self.assertDictEqual(collection._rules, OrderedDict({"my-rüle": expected})) - # Need to explicitely compare expected attributes as the rule.__eq__ method does not compare these attributes + # Need to explicitly compare expected attributes as the rule.__eq__ method does not compare these attributes self.assertEqual(collection._rules[expected.id].my_attr, expected.my_attr) self.assertEqual(collection._rules[expected.id].my_attr2, expected.my_attr2) diff --git a/gitlint/tests/contrib/__init__.py b/gitlint-core/gitlint/tests/contrib/__init__.py index e69de29..e69de29 100644 --- a/gitlint/tests/contrib/__init__.py +++ b/gitlint-core/gitlint/tests/contrib/__init__.py diff --git a/gitlint/tests/contrib/rules/__init__.py b/gitlint-core/gitlint/tests/contrib/rules/__init__.py index e69de29..e69de29 100644 --- a/gitlint/tests/contrib/rules/__init__.py +++ b/gitlint-core/gitlint/tests/contrib/rules/__init__.py diff --git a/gitlint/tests/contrib/rules/test_conventional_commit.py b/gitlint-core/gitlint/tests/contrib/rules/test_conventional_commit.py index 5da5cd5..5da5cd5 100644 --- a/gitlint/tests/contrib/rules/test_conventional_commit.py +++ b/gitlint-core/gitlint/tests/contrib/rules/test_conventional_commit.py diff --git a/gitlint/tests/contrib/rules/test_signedoff_by.py b/gitlint-core/gitlint/tests/contrib/rules/test_signedoff_by.py index 0369cdc..0369cdc 100644 --- a/gitlint/tests/contrib/rules/test_signedoff_by.py +++ b/gitlint-core/gitlint/tests/contrib/rules/test_signedoff_by.py diff --git a/gitlint/tests/contrib/test_contrib_rules.py b/gitlint-core/gitlint/tests/contrib/test_contrib_rules.py index 8ab6539..8ab6539 100644 --- a/gitlint/tests/contrib/test_contrib_rules.py +++ b/gitlint-core/gitlint/tests/contrib/test_contrib_rules.py diff --git a/gitlint/tests/expected/cli/test_cli/test_contrib_1 b/gitlint-core/gitlint/tests/expected/cli/test_cli/test_contrib_1 index b95433b..b95433b 100644 --- a/gitlint/tests/expected/cli/test_cli/test_contrib_1 +++ b/gitlint-core/gitlint/tests/expected/cli/test_cli/test_contrib_1 diff --git a/gitlint/tests/expected/cli/test_cli/test_debug_1 b/gitlint-core/gitlint/tests/expected/cli/test_cli/test_debug_1 index fcd5d7e..fcd5d7e 100644 --- a/gitlint/tests/expected/cli/test_cli/test_debug_1 +++ b/gitlint-core/gitlint/tests/expected/cli/test_cli/test_debug_1 diff --git a/gitlint/tests/expected/cli/test_cli/test_input_stream_1 b/gitlint-core/gitlint/tests/expected/cli/test_cli/test_input_stream_1 index 4326729..4326729 100644 --- a/gitlint/tests/expected/cli/test_cli/test_input_stream_1 +++ b/gitlint-core/gitlint/tests/expected/cli/test_cli/test_input_stream_1 diff --git a/gitlint/tests/expected/cli/test_cli/test_input_stream_debug_1 b/gitlint-core/gitlint/tests/expected/cli/test_cli/test_input_stream_debug_1 index 4326729..4326729 100644 --- a/gitlint/tests/expected/cli/test_cli/test_input_stream_debug_1 +++ b/gitlint-core/gitlint/tests/expected/cli/test_cli/test_input_stream_debug_1 diff --git a/gitlint/tests/expected/cli/test_cli/test_input_stream_debug_2 b/gitlint-core/gitlint/tests/expected/cli/test_cli/test_input_stream_debug_2 index 7c94b45..7c94b45 100644 --- a/gitlint/tests/expected/cli/test_cli/test_input_stream_debug_2 +++ b/gitlint-core/gitlint/tests/expected/cli/test_cli/test_input_stream_debug_2 diff --git a/gitlint/tests/expected/cli/test_cli/test_lint_commit_1 b/gitlint-core/gitlint/tests/expected/cli/test_cli/test_lint_commit_1 index b9f0742..b9f0742 100644 --- a/gitlint/tests/expected/cli/test_cli/test_lint_commit_1 +++ b/gitlint-core/gitlint/tests/expected/cli/test_cli/test_lint_commit_1 diff --git a/gitlint/tests/expected/cli/test_cli/test_lint_multiple_commits_1 b/gitlint-core/gitlint/tests/expected/cli/test_cli/test_lint_multiple_commits_1 index be3288b..be3288b 100644 --- a/gitlint/tests/expected/cli/test_cli/test_lint_multiple_commits_1 +++ b/gitlint-core/gitlint/tests/expected/cli/test_cli/test_lint_multiple_commits_1 diff --git a/gitlint/tests/expected/cli/test_cli/test_lint_multiple_commits_config_1 b/gitlint-core/gitlint/tests/expected/cli/test_cli/test_lint_multiple_commits_config_1 index 1bf0503..1bf0503 100644 --- a/gitlint/tests/expected/cli/test_cli/test_lint_multiple_commits_config_1 +++ b/gitlint-core/gitlint/tests/expected/cli/test_cli/test_lint_multiple_commits_config_1 diff --git a/gitlint/tests/expected/cli/test_cli/test_lint_staged_msg_filename_1 b/gitlint-core/gitlint/tests/expected/cli/test_cli/test_lint_staged_msg_filename_1 index 9a9091b..9a9091b 100644 --- a/gitlint/tests/expected/cli/test_cli/test_lint_staged_msg_filename_1 +++ b/gitlint-core/gitlint/tests/expected/cli/test_cli/test_lint_staged_msg_filename_1 diff --git a/gitlint/tests/expected/cli/test_cli/test_lint_staged_msg_filename_2 b/gitlint-core/gitlint/tests/expected/cli/test_cli/test_lint_staged_msg_filename_2 index f37ffa0..f37ffa0 100644 --- a/gitlint/tests/expected/cli/test_cli/test_lint_staged_msg_filename_2 +++ b/gitlint-core/gitlint/tests/expected/cli/test_cli/test_lint_staged_msg_filename_2 diff --git a/gitlint/tests/expected/cli/test_cli/test_lint_staged_stdin_1 b/gitlint-core/gitlint/tests/expected/cli/test_cli/test_lint_staged_stdin_1 index 4326729..4326729 100644 --- a/gitlint/tests/expected/cli/test_cli/test_lint_staged_stdin_1 +++ b/gitlint-core/gitlint/tests/expected/cli/test_cli/test_lint_staged_stdin_1 diff --git a/gitlint/tests/expected/cli/test_cli/test_lint_staged_stdin_2 b/gitlint-core/gitlint/tests/expected/cli/test_cli/test_lint_staged_stdin_2 index 1d1020a..1d1020a 100644 --- a/gitlint/tests/expected/cli/test_cli/test_lint_staged_stdin_2 +++ b/gitlint-core/gitlint/tests/expected/cli/test_cli/test_lint_staged_stdin_2 diff --git a/gitlint/tests/expected/cli/test_cli/test_named_rules_1 b/gitlint-core/gitlint/tests/expected/cli/test_cli/test_named_rules_1 index a581d05..a581d05 100644 --- a/gitlint/tests/expected/cli/test_cli/test_named_rules_1 +++ b/gitlint-core/gitlint/tests/expected/cli/test_cli/test_named_rules_1 diff --git a/gitlint/tests/expected/cli/test_cli/test_named_rules_2 b/gitlint-core/gitlint/tests/expected/cli/test_cli/test_named_rules_2 index 83c4bf2..83c4bf2 100644 --- a/gitlint/tests/expected/cli/test_cli/test_named_rules_2 +++ b/gitlint-core/gitlint/tests/expected/cli/test_cli/test_named_rules_2 diff --git a/gitlint/tests/expected/cli/test_cli_hooks/test_hook_config_1_stderr b/gitlint-core/gitlint/tests/expected/cli/test_cli_hooks/test_hook_config_1_stderr index cfacd42..cfacd42 100644 --- a/gitlint/tests/expected/cli/test_cli_hooks/test_hook_config_1_stderr +++ b/gitlint-core/gitlint/tests/expected/cli/test_cli_hooks/test_hook_config_1_stderr diff --git a/gitlint/tests/expected/cli/test_cli_hooks/test_hook_config_1_stdout b/gitlint-core/gitlint/tests/expected/cli/test_cli_hooks/test_hook_config_1_stdout index bee014b..bee014b 100644 --- a/gitlint/tests/expected/cli/test_cli_hooks/test_hook_config_1_stdout +++ b/gitlint-core/gitlint/tests/expected/cli/test_cli_hooks/test_hook_config_1_stdout diff --git a/gitlint/tests/expected/cli/test_cli_hooks/test_hook_edit_1_stderr b/gitlint-core/gitlint/tests/expected/cli/test_cli_hooks/test_hook_edit_1_stderr index 3eb8fca..3eb8fca 100644 --- a/gitlint/tests/expected/cli/test_cli_hooks/test_hook_edit_1_stderr +++ b/gitlint-core/gitlint/tests/expected/cli/test_cli_hooks/test_hook_edit_1_stderr diff --git a/gitlint/tests/expected/cli/test_cli_hooks/test_hook_edit_1_stdout b/gitlint-core/gitlint/tests/expected/cli/test_cli_hooks/test_hook_edit_1_stdout index b57a35a..b57a35a 100644 --- a/gitlint/tests/expected/cli/test_cli_hooks/test_hook_edit_1_stdout +++ b/gitlint-core/gitlint/tests/expected/cli/test_cli_hooks/test_hook_edit_1_stdout diff --git a/gitlint/tests/expected/cli/test_cli_hooks/test_hook_local_commit_1_stderr b/gitlint-core/gitlint/tests/expected/cli/test_cli_hooks/test_hook_local_commit_1_stderr index 11c3cd8..11c3cd8 100644 --- a/gitlint/tests/expected/cli/test_cli_hooks/test_hook_local_commit_1_stderr +++ b/gitlint-core/gitlint/tests/expected/cli/test_cli_hooks/test_hook_local_commit_1_stderr diff --git a/gitlint/tests/expected/cli/test_cli_hooks/test_hook_local_commit_1_stdout b/gitlint-core/gitlint/tests/expected/cli/test_cli_hooks/test_hook_local_commit_1_stdout index 0b8e90e..0b8e90e 100644 --- a/gitlint/tests/expected/cli/test_cli_hooks/test_hook_local_commit_1_stdout +++ b/gitlint-core/gitlint/tests/expected/cli/test_cli_hooks/test_hook_local_commit_1_stdout diff --git a/gitlint/tests/expected/cli/test_cli_hooks/test_hook_no_1_stderr b/gitlint-core/gitlint/tests/expected/cli/test_cli_hooks/test_hook_no_1_stderr index 6d0c9cf..6d0c9cf 100644 --- a/gitlint/tests/expected/cli/test_cli_hooks/test_hook_no_1_stderr +++ b/gitlint-core/gitlint/tests/expected/cli/test_cli_hooks/test_hook_no_1_stderr diff --git a/gitlint/tests/expected/cli/test_cli_hooks/test_hook_no_1_stdout b/gitlint-core/gitlint/tests/expected/cli/test_cli_hooks/test_hook_no_1_stdout index 98a83b1..98a83b1 100644 --- a/gitlint/tests/expected/cli/test_cli_hooks/test_hook_no_1_stdout +++ b/gitlint-core/gitlint/tests/expected/cli/test_cli_hooks/test_hook_no_1_stdout diff --git a/gitlint/tests/expected/cli/test_cli_hooks/test_hook_no_tty_1_stderr b/gitlint-core/gitlint/tests/expected/cli/test_cli_hooks/test_hook_no_tty_1_stderr index a8d8760..a8d8760 100644 --- a/gitlint/tests/expected/cli/test_cli_hooks/test_hook_no_tty_1_stderr +++ b/gitlint-core/gitlint/tests/expected/cli/test_cli_hooks/test_hook_no_tty_1_stderr diff --git a/gitlint/tests/expected/cli/test_cli_hooks/test_hook_no_tty_1_stdout b/gitlint-core/gitlint/tests/expected/cli/test_cli_hooks/test_hook_no_tty_1_stdout index bee014b..bee014b 100644 --- a/gitlint/tests/expected/cli/test_cli_hooks/test_hook_no_tty_1_stdout +++ b/gitlint-core/gitlint/tests/expected/cli/test_cli_hooks/test_hook_no_tty_1_stdout diff --git a/gitlint/tests/expected/cli/test_cli_hooks/test_hook_stdin_no_violations_1_stdout b/gitlint-core/gitlint/tests/expected/cli/test_cli_hooks/test_hook_stdin_no_violations_1_stdout index da1ef0b..da1ef0b 100644 --- a/gitlint/tests/expected/cli/test_cli_hooks/test_hook_stdin_no_violations_1_stdout +++ b/gitlint-core/gitlint/tests/expected/cli/test_cli_hooks/test_hook_stdin_no_violations_1_stdout diff --git a/gitlint/tests/expected/cli/test_cli_hooks/test_hook_stdin_violations_1_stderr b/gitlint-core/gitlint/tests/expected/cli/test_cli_hooks/test_hook_stdin_violations_1_stderr index 1404f4a..1404f4a 100644 --- a/gitlint/tests/expected/cli/test_cli_hooks/test_hook_stdin_violations_1_stderr +++ b/gitlint-core/gitlint/tests/expected/cli/test_cli_hooks/test_hook_stdin_violations_1_stderr diff --git a/gitlint/tests/expected/cli/test_cli_hooks/test_hook_stdin_violations_1_stdout b/gitlint-core/gitlint/tests/expected/cli/test_cli_hooks/test_hook_stdin_violations_1_stdout index bee014b..bee014b 100644 --- a/gitlint/tests/expected/cli/test_cli_hooks/test_hook_stdin_violations_1_stdout +++ b/gitlint-core/gitlint/tests/expected/cli/test_cli_hooks/test_hook_stdin_violations_1_stdout diff --git a/gitlint/tests/expected/cli/test_cli_hooks/test_hook_yes_1_stderr b/gitlint-core/gitlint/tests/expected/cli/test_cli_hooks/test_hook_yes_1_stderr index da6f874..da6f874 100644 --- a/gitlint/tests/expected/cli/test_cli_hooks/test_hook_yes_1_stderr +++ b/gitlint-core/gitlint/tests/expected/cli/test_cli_hooks/test_hook_yes_1_stderr diff --git a/gitlint/tests/expected/cli/test_cli_hooks/test_hook_yes_1_stdout b/gitlint-core/gitlint/tests/expected/cli/test_cli_hooks/test_hook_yes_1_stdout index 0414712..0414712 100644 --- a/gitlint/tests/expected/cli/test_cli_hooks/test_hook_yes_1_stdout +++ b/gitlint-core/gitlint/tests/expected/cli/test_cli_hooks/test_hook_yes_1_stdout diff --git a/gitlint/tests/expected/cli/test_cli_hooks/test_run_hook_negative_1 b/gitlint-core/gitlint/tests/expected/cli/test_cli_hooks/test_run_hook_negative_1 index 9082830..9082830 100644 --- a/gitlint/tests/expected/cli/test_cli_hooks/test_run_hook_negative_1 +++ b/gitlint-core/gitlint/tests/expected/cli/test_cli_hooks/test_run_hook_negative_1 diff --git a/gitlint/tests/expected/cli/test_cli_hooks/test_run_hook_negative_2 b/gitlint-core/gitlint/tests/expected/cli/test_cli_hooks/test_run_hook_negative_2 index bafbf29..bafbf29 100644 --- a/gitlint/tests/expected/cli/test_cli_hooks/test_run_hook_negative_2 +++ b/gitlint-core/gitlint/tests/expected/cli/test_cli_hooks/test_run_hook_negative_2 diff --git a/gitlint/tests/git/test_git.py b/gitlint-core/gitlint/tests/git/test_git.py index 7b9b7c6..7b9b7c6 100644 --- a/gitlint/tests/git/test_git.py +++ b/gitlint-core/gitlint/tests/git/test_git.py diff --git a/gitlint/tests/git/test_git_commit.py b/gitlint-core/gitlint/tests/git/test_git_commit.py index 02c5795..02c5795 100644 --- a/gitlint/tests/git/test_git_commit.py +++ b/gitlint-core/gitlint/tests/git/test_git_commit.py diff --git a/gitlint/tests/git/test_git_context.py b/gitlint-core/gitlint/tests/git/test_git_context.py index bb05236..bb05236 100644 --- a/gitlint/tests/git/test_git_context.py +++ b/gitlint-core/gitlint/tests/git/test_git_context.py diff --git a/gitlint/tests/rules/__init__.py b/gitlint-core/gitlint/tests/rules/__init__.py index e69de29..e69de29 100644 --- a/gitlint/tests/rules/__init__.py +++ b/gitlint-core/gitlint/tests/rules/__init__.py diff --git a/gitlint/tests/rules/test_body_rules.py b/gitlint-core/gitlint/tests/rules/test_body_rules.py index 812c74a..812c74a 100644 --- a/gitlint/tests/rules/test_body_rules.py +++ b/gitlint-core/gitlint/tests/rules/test_body_rules.py diff --git a/gitlint/tests/rules/test_configuration_rules.py b/gitlint-core/gitlint/tests/rules/test_configuration_rules.py index 9302da5..9302da5 100644 --- a/gitlint/tests/rules/test_configuration_rules.py +++ b/gitlint-core/gitlint/tests/rules/test_configuration_rules.py diff --git a/gitlint/tests/rules/test_meta_rules.py b/gitlint-core/gitlint/tests/rules/test_meta_rules.py index 568ca3f..568ca3f 100644 --- a/gitlint/tests/rules/test_meta_rules.py +++ b/gitlint-core/gitlint/tests/rules/test_meta_rules.py diff --git a/gitlint/tests/rules/test_rules.py b/gitlint-core/gitlint/tests/rules/test_rules.py index 6fcf9bc..6fcf9bc 100644 --- a/gitlint/tests/rules/test_rules.py +++ b/gitlint-core/gitlint/tests/rules/test_rules.py diff --git a/gitlint/tests/rules/test_title_rules.py b/gitlint-core/gitlint/tests/rules/test_title_rules.py index 10b4aab..10b4aab 100644 --- a/gitlint/tests/rules/test_title_rules.py +++ b/gitlint-core/gitlint/tests/rules/test_title_rules.py diff --git a/gitlint/tests/rules/test_user_rules.py b/gitlint-core/gitlint/tests/rules/test_user_rules.py index 5bf9b77..d66a7cc 100644 --- a/gitlint/tests/rules/test_user_rules.py +++ b/gitlint-core/gitlint/tests/rules/test_user_rules.py @@ -170,7 +170,7 @@ class UserRuleTests(BaseTestCase): class MyRuleClass(parent_class): id = "UC1" - # Rule class must have an name + # Rule class must have a name expected_msg = "User-defined rule class 'MyRuleClass' must have a 'name' attribute" with self.assertRaisesMessage(UserRuleError, expected_msg): assert_valid_rule_class(MyRuleClass) diff --git a/gitlint/tests/samples/commit_message/fixup b/gitlint-core/gitlint/tests/samples/commit_message/fixup index 2539dd1..2539dd1 100644 --- a/gitlint/tests/samples/commit_message/fixup +++ b/gitlint-core/gitlint/tests/samples/commit_message/fixup diff --git a/gitlint/tests/samples/commit_message/merge b/gitlint-core/gitlint/tests/samples/commit_message/merge index 764e131..764e131 100644 --- a/gitlint/tests/samples/commit_message/merge +++ b/gitlint-core/gitlint/tests/samples/commit_message/merge diff --git a/gitlint/tests/samples/commit_message/no-violations b/gitlint-core/gitlint/tests/samples/commit_message/no-violations index 33c73b9..33c73b9 100644 --- a/gitlint/tests/samples/commit_message/no-violations +++ b/gitlint-core/gitlint/tests/samples/commit_message/no-violations diff --git a/gitlint/tests/samples/commit_message/revert b/gitlint-core/gitlint/tests/samples/commit_message/revert index 6dc8368..6dc8368 100644 --- a/gitlint/tests/samples/commit_message/revert +++ b/gitlint-core/gitlint/tests/samples/commit_message/revert diff --git a/gitlint/tests/samples/commit_message/sample1 b/gitlint-core/gitlint/tests/samples/commit_message/sample1 index 646c0cb..646c0cb 100644 --- a/gitlint/tests/samples/commit_message/sample1 +++ b/gitlint-core/gitlint/tests/samples/commit_message/sample1 diff --git a/gitlint/tests/samples/commit_message/sample2 b/gitlint-core/gitlint/tests/samples/commit_message/sample2 index 356540c..356540c 100644 --- a/gitlint/tests/samples/commit_message/sample2 +++ b/gitlint-core/gitlint/tests/samples/commit_message/sample2 diff --git a/gitlint/tests/samples/commit_message/sample3 b/gitlint-core/gitlint/tests/samples/commit_message/sample3 index d67d70b..d67d70b 100644 --- a/gitlint/tests/samples/commit_message/sample3 +++ b/gitlint-core/gitlint/tests/samples/commit_message/sample3 diff --git a/gitlint/tests/samples/commit_message/sample4 b/gitlint-core/gitlint/tests/samples/commit_message/sample4 index c858d89..c858d89 100644 --- a/gitlint/tests/samples/commit_message/sample4 +++ b/gitlint-core/gitlint/tests/samples/commit_message/sample4 diff --git a/gitlint/tests/samples/commit_message/sample5 b/gitlint-core/gitlint/tests/samples/commit_message/sample5 index 77ccbe8..77ccbe8 100644 --- a/gitlint/tests/samples/commit_message/sample5 +++ b/gitlint-core/gitlint/tests/samples/commit_message/sample5 diff --git a/gitlint/tests/samples/commit_message/squash b/gitlint-core/gitlint/tests/samples/commit_message/squash index 538a93a..538a93a 100644 --- a/gitlint/tests/samples/commit_message/squash +++ b/gitlint-core/gitlint/tests/samples/commit_message/squash diff --git a/gitlint/tests/samples/config/gitlintconfig b/gitlint-core/gitlint/tests/samples/config/gitlintconfig index 8c93f71..8c93f71 100644 --- a/gitlint/tests/samples/config/gitlintconfig +++ b/gitlint-core/gitlint/tests/samples/config/gitlintconfig diff --git a/gitlint/tests/samples/config/invalid-option-value b/gitlint-core/gitlint/tests/samples/config/invalid-option-value index 92015aa..92015aa 100644 --- a/gitlint/tests/samples/config/invalid-option-value +++ b/gitlint-core/gitlint/tests/samples/config/invalid-option-value diff --git a/gitlint/tests/samples/config/named-rules b/gitlint-core/gitlint/tests/samples/config/named-rules index 73ab0d2..73ab0d2 100644 --- a/gitlint/tests/samples/config/named-rules +++ b/gitlint-core/gitlint/tests/samples/config/named-rules diff --git a/gitlint/tests/samples/config/no-sections b/gitlint-core/gitlint/tests/samples/config/no-sections index ec82b25..ec82b25 100644 --- a/gitlint/tests/samples/config/no-sections +++ b/gitlint-core/gitlint/tests/samples/config/no-sections diff --git a/gitlint/tests/samples/config/nonexisting-general-option b/gitlint-core/gitlint/tests/samples/config/nonexisting-general-option index d5cfef2..d5cfef2 100644 --- a/gitlint/tests/samples/config/nonexisting-general-option +++ b/gitlint-core/gitlint/tests/samples/config/nonexisting-general-option diff --git a/gitlint/tests/samples/config/nonexisting-option b/gitlint-core/gitlint/tests/samples/config/nonexisting-option index 6964c77..6964c77 100644 --- a/gitlint/tests/samples/config/nonexisting-option +++ b/gitlint-core/gitlint/tests/samples/config/nonexisting-option diff --git a/gitlint/tests/samples/config/nonexisting-rule b/gitlint-core/gitlint/tests/samples/config/nonexisting-rule index c0f0d2b..c0f0d2b 100644 --- a/gitlint/tests/samples/config/nonexisting-rule +++ b/gitlint-core/gitlint/tests/samples/config/nonexisting-rule diff --git a/gitlint/tests/samples/user_rules/bogus-file.txt b/gitlint-core/gitlint/tests/samples/user_rules/bogus-file.txt index 2a56650..2a56650 100644 --- a/gitlint/tests/samples/user_rules/bogus-file.txt +++ b/gitlint-core/gitlint/tests/samples/user_rules/bogus-file.txt diff --git a/gitlint/tests/samples/user_rules/import_exception/invalid_python.py b/gitlint-core/gitlint/tests/samples/user_rules/import_exception/invalid_python.py index e75fed3..e75fed3 100644 --- a/gitlint/tests/samples/user_rules/import_exception/invalid_python.py +++ b/gitlint-core/gitlint/tests/samples/user_rules/import_exception/invalid_python.py diff --git a/gitlint/tests/samples/user_rules/incorrect_linerule/my_line_rule.py b/gitlint-core/gitlint/tests/samples/user_rules/incorrect_linerule/my_line_rule.py index 004ef9d..004ef9d 100644 --- a/gitlint/tests/samples/user_rules/incorrect_linerule/my_line_rule.py +++ b/gitlint-core/gitlint/tests/samples/user_rules/incorrect_linerule/my_line_rule.py diff --git a/gitlint/tests/samples/user_rules/my_commit_rules.foo b/gitlint-core/gitlint/tests/samples/user_rules/my_commit_rules.foo index 605d704..605d704 100644 --- a/gitlint/tests/samples/user_rules/my_commit_rules.foo +++ b/gitlint-core/gitlint/tests/samples/user_rules/my_commit_rules.foo diff --git a/gitlint/tests/samples/user_rules/my_commit_rules.py b/gitlint-core/gitlint/tests/samples/user_rules/my_commit_rules.py index 8b0907e..8b0907e 100644 --- a/gitlint/tests/samples/user_rules/my_commit_rules.py +++ b/gitlint-core/gitlint/tests/samples/user_rules/my_commit_rules.py diff --git a/gitlint/tests/samples/user_rules/parent_package/__init__.py b/gitlint-core/gitlint/tests/samples/user_rules/parent_package/__init__.py index 9ea5371..9ea5371 100644 --- a/gitlint/tests/samples/user_rules/parent_package/__init__.py +++ b/gitlint-core/gitlint/tests/samples/user_rules/parent_package/__init__.py diff --git a/gitlint/tests/samples/user_rules/parent_package/my_commit_rules.py b/gitlint-core/gitlint/tests/samples/user_rules/parent_package/my_commit_rules.py index b143e62..b143e62 100644 --- a/gitlint/tests/samples/user_rules/parent_package/my_commit_rules.py +++ b/gitlint-core/gitlint/tests/samples/user_rules/parent_package/my_commit_rules.py diff --git a/gitlint/tests/test_cache.py b/gitlint-core/gitlint/tests/test_cache.py index 4b1d47a..4b1d47a 100644 --- a/gitlint/tests/test_cache.py +++ b/gitlint-core/gitlint/tests/test_cache.py diff --git a/gitlint/tests/test_display.py b/gitlint-core/gitlint/tests/test_display.py index 167ef96..167ef96 100644 --- a/gitlint/tests/test_display.py +++ b/gitlint-core/gitlint/tests/test_display.py diff --git a/gitlint/tests/test_hooks.py b/gitlint-core/gitlint/tests/test_hooks.py index 0ce5040..0ce5040 100644 --- a/gitlint/tests/test_hooks.py +++ b/gitlint-core/gitlint/tests/test_hooks.py diff --git a/gitlint/tests/test_lint.py b/gitlint-core/gitlint/tests/test_lint.py index b743389..b743389 100644 --- a/gitlint/tests/test_lint.py +++ b/gitlint-core/gitlint/tests/test_lint.py diff --git a/gitlint/tests/test_options.py b/gitlint-core/gitlint/tests/test_options.py index eabcfe1..eabcfe1 100644 --- a/gitlint/tests/test_options.py +++ b/gitlint-core/gitlint/tests/test_options.py diff --git a/gitlint/tests/test_utils.py b/gitlint-core/gitlint/tests/test_utils.py index 4ec8bda..4ec8bda 100644 --- a/gitlint/tests/test_utils.py +++ b/gitlint-core/gitlint/tests/test_utils.py diff --git a/gitlint/utils.py b/gitlint-core/gitlint/utils.py index c91184b..c91184b 100644 --- a/gitlint/utils.py +++ b/gitlint-core/gitlint/utils.py diff --git a/gitlint-core/setup.cfg b/gitlint-core/setup.cfg new file mode 100644 index 0000000..2a9acf1 --- /dev/null +++ b/gitlint-core/setup.cfg @@ -0,0 +1,2 @@ +[bdist_wheel] +universal = 1 diff --git a/gitlint-core/setup.py b/gitlint-core/setup.py new file mode 100644 index 0000000..952dd7f --- /dev/null +++ b/gitlint-core/setup.py @@ -0,0 +1,107 @@ +#!/usr/bin/env python +from __future__ import print_function +from setuptools import setup, find_packages +import io +import re +import os +import platform +import sys + + +description = "Git commit message linter written in python, checks your commit messages for style." +long_description = """ +Great for use as a commit-msg git hook or as part of your gating script in a CI pipeline (e.g. jenkins, github actions). +Many of the gitlint validations are based on `well-known`_ community_ `standards`_, others are based on checks that +we've found useful throughout the years. Gitlint has sane defaults, but you can also easily customize it to your +own liking. + +Demo and full documentation on `jorisroovers.github.io/gitlint`_. +To see what's new in the latest release, visit the CHANGELOG_. + +Source code on `github.com/jorisroovers/gitlint`_. + +.. _well-known: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html +.. _community: http://addamhardy.com/blog/2013/06/05/good-commit-messages-and-enforcing-them-with-git-hooks/ +.. _standards: http://chris.beams.io/posts/git-commit/ +.. _jorisroovers.github.io/gitlint: https://jorisroovers.github.io/gitlint +.. _CHANGELOG: https://github.com/jorisroovers/gitlint/blob/main/CHANGELOG.md +.. _github.com/jorisroovers/gitlint: https://github.com/jorisroovers/gitlint +""" + + +# shamelessly stolen from mkdocs' setup.py: https://github.com/mkdocs/mkdocs/blob/master/setup.py +def get_version(package): + """Return package version as listed in `__version__` in `init.py`.""" + init_py = io.open(os.path.join(package, '__init__.py'), encoding="UTF-8").read() + return re.search("__version__ = ['\"]([^'\"]+)['\"]", init_py).group(1) + + +setup( + name="gitlint-core", + version=get_version("gitlint"), + description=description, + long_description=long_description, + classifiers=[ + "Development Status :: 5 - Production/Stable", + "Operating System :: OS Independent", + "Programming Language :: Python", + "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: Implementation :: CPython", + "Programming Language :: Python :: Implementation :: PyPy", + "Environment :: Console", + "Intended Audience :: Developers", + "Topic :: Software Development :: Quality Assurance", + "Topic :: Software Development :: Testing", + "License :: OSI Approved :: MIT License" + ], + python_requires=">=3.6", + install_requires=[ + 'Click>=8', + 'arrow>=1', + 'sh>=1.13.0 ; sys_platform != "win32"', + ], + extras_require={ + 'trusted-deps': [ + 'Click==8.0.3', + 'arrow==1.2.1', + 'sh==1.14.2 ; sys_platform != "win32"', + ], + }, + keywords='gitlint git lint', + author='Joris Roovers', + url='https://jorisroovers.github.io/gitlint', + project_urls={ + 'Documentation': 'https://jorisroovers.github.io/gitlint', + 'Source': 'https://github.com/jorisroovers/gitlint', + }, + license='MIT', + package_data={ + 'gitlint': ['files/*'] + }, + packages=find_packages(exclude=["examples"]), + entry_points={ + "console_scripts": [ + "gitlint = gitlint.cli:cli", + ], + }, +) + +# Print a red deprecation warning for python < 3.6 users +if sys.version_info[:2] < (3, 6): + msg = "\033[31mDEPRECATION: You're using a python version that has reached end-of-life. " + \ + "Gitlint does not support Python < 3.6" + \ + "Please upgrade your Python to 3.6 or above.\033[0m" + print(msg) + +# Print a warning message for Windows users +PLATFORM_IS_WINDOWS = "windows" in platform.system().lower() +if PLATFORM_IS_WINDOWS: + msg = "\n\n\n\n\n****************\n" + \ + "WARNING: Gitlint support for Windows is still experimental and there are some known issues: " + \ + "https://github.com/jorisroovers/gitlint/issues?q=is%3Aissue+is%3Aopen+label%3Awindows " + \ + "\n*******************" + print(msg) diff --git a/gitlint/__init__.py b/gitlint/__init__.py deleted file mode 100644 index 5a313cc..0000000 --- a/gitlint/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__version__ = "0.16.0" diff --git a/qa/requirements.txt b/qa/requirements.txt index 5a4f660..76d6afc 100644 --- a/qa/requirements.txt +++ b/qa/requirements.txt @@ -1,4 +1,4 @@ sh==1.14.2 pytest==6.2.5; -arrow==1.2.0; +arrow==1.2.1; gitlint # no version as you want to test the currently installed version diff --git a/qa/shell.py b/qa/shell.py index 630843f..06ebfed 100644 --- a/qa/shell.py +++ b/qa/shell.py @@ -1,5 +1,5 @@ -# This code is mostly duplicated from the `gitlint.shell` module. We conciously duplicate this code as to not depend +# This code is mostly duplicated from the `gitlint.shell` module. We consciously duplicate this code as to not depend # on gitlint internals for our integration testing framework. import subprocess diff --git a/qa/test_stdin.py b/qa/test_stdin.py index c98580e..cee5f0c 100644 --- a/qa/test_stdin.py +++ b/qa/test_stdin.py @@ -23,7 +23,7 @@ class StdInTests(BaseTestCase): self.assertEqualStdout(output, self.get_expected("test_stdin/test_stdin_pipe_1")) def test_stdin_pipe_empty(self): - """ Test the scenario where no TTY is attached an nothing is piped into gitlint. This occurs in + """ Test the scenario where no TTY is attached and nothing is piped into gitlint. This occurs in CI runners like Jenkins and Gitlab, see https://github.com/jorisroovers/gitlint/issues/42 for details. This is the equivalent of doing: $ echo -n "" | gitlint diff --git a/requirements.txt b/requirements.txt index f4f3a1b..270d9ff 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,4 @@ setuptools wheel==0.37.0 -Click==8.0.1 -sh==1.14.2; sys_platform != 'win32' # sh is not supported on windows -arrow==1.2.0 +-e . +-e ./gitlint-core[trusted-deps] diff --git a/run_tests.sh b/run_tests.sh index da937ea..09386dc 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -56,7 +56,7 @@ assert_root(){ fi } -# Utility method that prints SUCCESS if a test was succesful, or FAIL together with the test output +# Utility method that prints SUCCESS if a test was successful, or FAIL together with the test output handle_test_result(){ EXIT_CODE=$1 RESULT="$2" @@ -76,7 +76,7 @@ handle_test_result(){ run_pep8_check(){ # FLAKE 8 - target=${testargs:-"gitlint qa examples"} + target=${testargs:-"gitlint-core qa examples"} echo -ne "Running flake8..." RESULT=$(flake8 $target) local exit_code=$? @@ -88,7 +88,7 @@ run_unit_tests(){ clean # py.test -s => print standard output (i.e. show print statement output) # -rw => print warnings - target=${testargs:-"gitlint"} + target=${testargs:-"gitlint-core"} coverage run -m pytest -rw -s $target TEST_RESULT=$? if [ $include_coverage -eq 1 ]; then @@ -129,7 +129,7 @@ run_git_check(){ run_lint_check(){ echo -ne "Running pylint...${RED}" - target=${testargs:-"gitlint qa"} + target=${testargs:-"gitlint-core/gitlint qa"} RESULT=$(pylint $target --rcfile=".pylintrc" -r n) local exit_code=$? handle_test_result $exit_code "$RESULT" @@ -149,14 +149,14 @@ run_build_test(){ # Update the version to include a timestamp echo -n "Writing new version to file..." - version_file="$temp_dir/gitlint/__init__.py" + version_file="$temp_dir/gitlint-core/gitlint/__init__.py" version_str="$(cat $version_file)" version_str="${version_str:0:${#version_str}-1}-$datestr\"" echo "$version_str" > $version_file echo -e "${GREEN}DONE${NO_COLOR}" # Attempt to build the package echo "Building package ..." - pushd "$temp_dir" + pushd "$temp_dir/gitlint-core" # Copy stdout file descriptor so we can both print output to stdout as well as capture it in a variable # https://stackoverflow.com/questions/12451278/bash-capture-stdout-to-a-variable-but-still-display-it-in-the-console exec 5>&1 @@ -183,7 +183,7 @@ run_stats(){ echo "*** Docs ***" echo " Markdown: $(cat docs/*.md | wc -l | tr -d " ") lines" echo "*** Tests ***" - nr_unit_tests=$(py.test gitlint/ --collect-only | grep TestCaseFunction | wc -l) + nr_unit_tests=$(py.test gitlint-core/ --collect-only | grep TestCaseFunction | wc -l) nr_integration_tests=$(py.test qa/ --collect-only | grep TestCaseFunction | wc -l) echo " Unit Tests: ${nr_unit_tests//[[:space:]]/}" echo " Integration Tests: ${nr_integration_tests//[[:space:]]/}" @@ -212,10 +212,8 @@ run_stats(){ clean(){ echo -n "Cleaning the *.pyc, site/, build/, dist/ and all __pycache__ directories..." - find gitlint -type d -name "__pycache__" -exec rm -rf {} \; 2> /dev/null - find qa -type d -name "__pycache__" -exec rm -rf {} \; 2> /dev/null - find gitlint -iname *.pyc -exec rm -rf {} \; 2> /dev/null - find qa -iname *.pyc -exec rm -rf {} \; 2> /dev/null + find gitlint-core qa -type d -name "__pycache__" -exec rm -rf {} \; 2> /dev/null + find gitlint-core qa -iname "*.pyc" -exec rm -rf {} \; 2> /dev/null rm -rf "site" "dist" "build" echo -e "${GREEN}DONE${NO_COLOR}" } @@ -1,12 +1,6 @@ #!/usr/bin/env python from __future__ import print_function -from setuptools import setup, find_packages -import io -import re -import os -import platform -import sys - +from setuptools import setup description = "Git commit message linter written in python, checks your commit messages for style." long_description = """ @@ -29,16 +23,11 @@ Source code on `github.com/jorisroovers/gitlint`_. """ -# shamelessly stolen from mkdocs' setup.py: https://github.com/mkdocs/mkdocs/blob/master/setup.py -def get_version(package): - """Return package version as listed in `__version__` in `init.py`.""" - init_py = io.open(os.path.join(package, '__init__.py'), encoding="UTF-8").read() - return re.search("__version__ = ['\"]([^'\"]+)['\"]", init_py).group(1) - +version = "0.17.0" setup( name="gitlint", - version=get_version("gitlint"), + version=version, description=description, long_description=long_description, classifiers=[ @@ -60,14 +49,8 @@ setup( ], python_requires=">=3.6", install_requires=[ - 'Click==8.0.1', - 'arrow==1.2.0', + 'gitlint-core[trusted-deps]==' + version, ], - extras_require={ - ':sys_platform != "win32"': [ - 'sh==1.14.2', - ], - }, keywords='gitlint git lint', author='Joris Roovers', url='https://jorisroovers.github.io/gitlint', @@ -76,29 +59,4 @@ setup( 'Source': 'https://github.com/jorisroovers/gitlint', }, license='MIT', - package_data={ - 'gitlint': ['files/*'] - }, - packages=find_packages(exclude=["examples"]), - entry_points={ - "console_scripts": [ - "gitlint = gitlint.cli:cli", - ], - }, ) - -# Print a red deprecation warning for python < 3.6 users -if sys.version_info[:2] < (3, 6): - msg = "\033[31mDEPRECATION: You're using a python version that has reached end-of-life. " + \ - "Gitlint does not support Python < 3.6" + \ - "Please upgrade your Python to 3.6 or above.\033[0m" - print(msg) - -# Print a warning message for Windows users -PLATFORM_IS_WINDOWS = "windows" in platform.system().lower() -if PLATFORM_IS_WINDOWS: - msg = "\n\n\n\n\n****************\n" + \ - "WARNING: Gitlint support for Windows is still experimental and there are some known issues: " + \ - "https://github.com/jorisroovers/gitlint/issues?q=is%3Aissue+is%3Aopen+label%3Awindows " + \ - "\n*******************" - print(msg) diff --git a/test-requirements.txt b/test-requirements.txt index 30b3073..ef3c711 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,8 +1,8 @@ -flake8==3.9.2 -coverage==6.0 +flake8==4.0.1 +coverage==6.1.2 python-coveralls==2.9.3 radon==5.1.0 flake8-polyfill==1.0.2 # Required when installing both flake8 and radon>=4.3.1 pytest==6.2.5; -pylint==2.11.1; --e . +pylint==2.12.1; +-r requirements.txt |