diff --git a/.coveragerc b/.coveragerc index a120715d..9da615ce 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 8fbda21d..1ca2a9c0 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 4b15bfde..f2ccc7f4 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/MANIFEST.in b/MANIFEST.in index 51a5598b..ad3da8a6 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/docs/configuration.md b/docs/configuration.md index 226ba8aa..addf0c0d 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 d39f9e16..1002676c 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/user_defined_rules.md b/docs/user_defined_rules.md index 3b9f5e76..f58dcc7d 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 b722023c..02617524 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 00000000..ea5b6064 --- /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 00000000..375cec1d --- /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 00000000..32d46ee8 --- /dev/null +++ b/gitlint-core/README.md @@ -0,0 +1 @@ +../README.md \ No newline at end of file diff --git a/gitlint/__init__.py b/gitlint-core/gitlint/__init__.py similarity index 100% rename from gitlint/__init__.py rename to gitlint-core/gitlint/__init__.py diff --git a/gitlint/cache.py b/gitlint-core/gitlint/cache.py similarity index 100% rename from gitlint/cache.py rename to gitlint-core/gitlint/cache.py diff --git a/gitlint/cli.py b/gitlint-core/gitlint/cli.py similarity index 100% rename from gitlint/cli.py rename to gitlint-core/gitlint/cli.py diff --git a/gitlint/config.py b/gitlint-core/gitlint/config.py similarity index 100% rename from gitlint/config.py rename to gitlint-core/gitlint/config.py diff --git a/gitlint/contrib/__init__.py b/gitlint-core/gitlint/contrib/__init__.py similarity index 100% rename from gitlint/contrib/__init__.py rename to gitlint-core/gitlint/contrib/__init__.py diff --git a/gitlint/contrib/rules/__init__.py b/gitlint-core/gitlint/contrib/rules/__init__.py similarity index 100% rename from gitlint/contrib/rules/__init__.py rename to 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 similarity index 100% rename from gitlint/contrib/rules/conventional_commit.py rename to 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 similarity index 100% rename from gitlint/contrib/rules/signedoff_by.py rename to gitlint-core/gitlint/contrib/rules/signedoff_by.py diff --git a/gitlint/display.py b/gitlint-core/gitlint/display.py similarity index 100% rename from gitlint/display.py rename to gitlint-core/gitlint/display.py diff --git a/gitlint/exception.py b/gitlint-core/gitlint/exception.py similarity index 100% rename from gitlint/exception.py rename to gitlint-core/gitlint/exception.py diff --git a/gitlint/files/commit-msg b/gitlint-core/gitlint/files/commit-msg similarity index 100% rename from gitlint/files/commit-msg rename to gitlint-core/gitlint/files/commit-msg diff --git a/gitlint/files/gitlint b/gitlint-core/gitlint/files/gitlint similarity index 99% rename from gitlint/files/gitlint rename to gitlint-core/gitlint/files/gitlint index 3e195721..c4d21226 100644 --- a/gitlint/files/gitlint +++ b/gitlint-core/gitlint/files/gitlint @@ -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 similarity index 100% rename from gitlint/git.py rename to gitlint-core/gitlint/git.py diff --git a/gitlint/hooks.py b/gitlint-core/gitlint/hooks.py similarity index 100% rename from gitlint/hooks.py rename to gitlint-core/gitlint/hooks.py diff --git a/gitlint/lint.py b/gitlint-core/gitlint/lint.py similarity index 100% rename from gitlint/lint.py rename to gitlint-core/gitlint/lint.py diff --git a/gitlint/options.py b/gitlint-core/gitlint/options.py similarity index 100% rename from gitlint/options.py rename to gitlint-core/gitlint/options.py diff --git a/gitlint/rule_finder.py b/gitlint-core/gitlint/rule_finder.py similarity index 100% rename from gitlint/rule_finder.py rename to gitlint-core/gitlint/rule_finder.py diff --git a/gitlint/rules.py b/gitlint-core/gitlint/rules.py similarity index 100% rename from gitlint/rules.py rename to gitlint-core/gitlint/rules.py diff --git a/gitlint/shell.py b/gitlint-core/gitlint/shell.py similarity index 100% rename from gitlint/shell.py rename to gitlint-core/gitlint/shell.py diff --git a/gitlint/tests/__init__.py b/gitlint-core/gitlint/tests/__init__.py similarity index 100% rename from gitlint/tests/__init__.py rename to gitlint-core/gitlint/tests/__init__.py diff --git a/gitlint/tests/base.py b/gitlint-core/gitlint/tests/base.py similarity index 100% rename from gitlint/tests/base.py rename to gitlint-core/gitlint/tests/base.py diff --git a/gitlint/tests/cli/test_cli.py b/gitlint-core/gitlint/tests/cli/test_cli.py similarity index 100% rename from gitlint/tests/cli/test_cli.py rename to 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 similarity index 100% rename from gitlint/tests/cli/test_cli_hooks.py rename to 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 similarity index 100% rename from gitlint/tests/config/test_config.py rename to 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 similarity index 100% rename from gitlint/tests/config/test_config_builder.py rename to 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 similarity index 100% rename from gitlint/tests/config/test_config_precedence.py rename to 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 similarity index 100% rename from gitlint/tests/config/test_rule_collection.py rename to gitlint-core/gitlint/tests/config/test_rule_collection.py diff --git a/gitlint/tests/contrib/__init__.py b/gitlint-core/gitlint/tests/contrib/__init__.py similarity index 100% rename from gitlint/tests/contrib/__init__.py rename to 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 similarity index 100% rename from gitlint/tests/contrib/rules/__init__.py rename to 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 similarity index 100% rename from gitlint/tests/contrib/rules/test_conventional_commit.py rename to 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 similarity index 100% rename from gitlint/tests/contrib/rules/test_signedoff_by.py rename to 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 similarity index 100% rename from gitlint/tests/contrib/test_contrib_rules.py rename to 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 similarity index 100% rename from gitlint/tests/expected/cli/test_cli/test_contrib_1 rename to 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 similarity index 100% rename from gitlint/tests/expected/cli/test_cli/test_debug_1 rename to 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 similarity index 100% rename from gitlint/tests/expected/cli/test_cli/test_input_stream_1 rename to 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 similarity index 100% rename from gitlint/tests/expected/cli/test_cli/test_input_stream_debug_1 rename to 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 similarity index 100% rename from gitlint/tests/expected/cli/test_cli/test_input_stream_debug_2 rename to 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 similarity index 100% rename from gitlint/tests/expected/cli/test_cli/test_lint_commit_1 rename to 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 similarity index 100% rename from gitlint/tests/expected/cli/test_cli/test_lint_multiple_commits_1 rename to 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 similarity index 100% rename from gitlint/tests/expected/cli/test_cli/test_lint_multiple_commits_config_1 rename to 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 similarity index 100% rename from gitlint/tests/expected/cli/test_cli/test_lint_staged_msg_filename_1 rename to 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 similarity index 100% rename from gitlint/tests/expected/cli/test_cli/test_lint_staged_msg_filename_2 rename to 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 similarity index 100% rename from gitlint/tests/expected/cli/test_cli/test_lint_staged_stdin_1 rename to 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 similarity index 100% rename from gitlint/tests/expected/cli/test_cli/test_lint_staged_stdin_2 rename to 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 similarity index 100% rename from gitlint/tests/expected/cli/test_cli/test_named_rules_1 rename to 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 similarity index 100% rename from gitlint/tests/expected/cli/test_cli/test_named_rules_2 rename to 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 similarity index 100% rename from gitlint/tests/expected/cli/test_cli_hooks/test_hook_config_1_stderr rename to 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 similarity index 100% rename from gitlint/tests/expected/cli/test_cli_hooks/test_hook_config_1_stdout rename to 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 similarity index 100% rename from gitlint/tests/expected/cli/test_cli_hooks/test_hook_edit_1_stderr rename to 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 similarity index 100% rename from gitlint/tests/expected/cli/test_cli_hooks/test_hook_edit_1_stdout rename to 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 similarity index 100% rename from gitlint/tests/expected/cli/test_cli_hooks/test_hook_local_commit_1_stderr rename to 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 similarity index 100% rename from gitlint/tests/expected/cli/test_cli_hooks/test_hook_local_commit_1_stdout rename to 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 similarity index 100% rename from gitlint/tests/expected/cli/test_cli_hooks/test_hook_no_1_stderr rename to 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 similarity index 100% rename from gitlint/tests/expected/cli/test_cli_hooks/test_hook_no_1_stdout rename to 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 similarity index 100% rename from gitlint/tests/expected/cli/test_cli_hooks/test_hook_no_tty_1_stderr rename to 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 similarity index 100% rename from gitlint/tests/expected/cli/test_cli_hooks/test_hook_no_tty_1_stdout rename to 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 similarity index 100% rename from gitlint/tests/expected/cli/test_cli_hooks/test_hook_stdin_no_violations_1_stdout rename to 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 similarity index 100% rename from gitlint/tests/expected/cli/test_cli_hooks/test_hook_stdin_violations_1_stderr rename to 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 similarity index 100% rename from gitlint/tests/expected/cli/test_cli_hooks/test_hook_stdin_violations_1_stdout rename to 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 similarity index 100% rename from gitlint/tests/expected/cli/test_cli_hooks/test_hook_yes_1_stderr rename to 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 similarity index 100% rename from gitlint/tests/expected/cli/test_cli_hooks/test_hook_yes_1_stdout rename to 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 similarity index 100% rename from gitlint/tests/expected/cli/test_cli_hooks/test_run_hook_negative_1 rename to 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 similarity index 100% rename from gitlint/tests/expected/cli/test_cli_hooks/test_run_hook_negative_2 rename to 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 similarity index 100% rename from gitlint/tests/git/test_git.py rename to 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 similarity index 100% rename from gitlint/tests/git/test_git_commit.py rename to 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 similarity index 100% rename from gitlint/tests/git/test_git_context.py rename to 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 similarity index 100% rename from gitlint/tests/rules/__init__.py rename to 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 similarity index 100% rename from gitlint/tests/rules/test_body_rules.py rename to 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 similarity index 100% rename from gitlint/tests/rules/test_configuration_rules.py rename to 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 similarity index 100% rename from gitlint/tests/rules/test_meta_rules.py rename to 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 similarity index 100% rename from gitlint/tests/rules/test_rules.py rename to 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 similarity index 100% rename from gitlint/tests/rules/test_title_rules.py rename to 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 similarity index 100% rename from gitlint/tests/rules/test_user_rules.py rename to gitlint-core/gitlint/tests/rules/test_user_rules.py diff --git a/gitlint/tests/samples/commit_message/fixup b/gitlint-core/gitlint/tests/samples/commit_message/fixup similarity index 100% rename from gitlint/tests/samples/commit_message/fixup rename to 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 similarity index 100% rename from gitlint/tests/samples/commit_message/merge rename to 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 similarity index 100% rename from gitlint/tests/samples/commit_message/no-violations rename to 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 similarity index 100% rename from gitlint/tests/samples/commit_message/revert rename to 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 similarity index 100% rename from gitlint/tests/samples/commit_message/sample1 rename to 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 similarity index 100% rename from gitlint/tests/samples/commit_message/sample2 rename to 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 similarity index 100% rename from gitlint/tests/samples/commit_message/sample3 rename to 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 similarity index 100% rename from gitlint/tests/samples/commit_message/sample4 rename to 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 similarity index 100% rename from gitlint/tests/samples/commit_message/sample5 rename to 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 similarity index 100% rename from gitlint/tests/samples/commit_message/squash rename to gitlint-core/gitlint/tests/samples/commit_message/squash diff --git a/gitlint/tests/samples/config/gitlintconfig b/gitlint-core/gitlint/tests/samples/config/gitlintconfig similarity index 100% rename from gitlint/tests/samples/config/gitlintconfig rename to 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 similarity index 100% rename from gitlint/tests/samples/config/invalid-option-value rename to 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 similarity index 100% rename from gitlint/tests/samples/config/named-rules rename to 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 similarity index 100% rename from gitlint/tests/samples/config/no-sections rename to 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 similarity index 100% rename from gitlint/tests/samples/config/nonexisting-general-option rename to 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 similarity index 100% rename from gitlint/tests/samples/config/nonexisting-option rename to 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 similarity index 100% rename from gitlint/tests/samples/config/nonexisting-rule rename to 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 similarity index 100% rename from gitlint/tests/samples/user_rules/bogus-file.txt rename to 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 similarity index 100% rename from gitlint/tests/samples/user_rules/import_exception/invalid_python.py rename to 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 similarity index 100% rename from gitlint/tests/samples/user_rules/incorrect_linerule/my_line_rule.py rename to 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 similarity index 100% rename from gitlint/tests/samples/user_rules/my_commit_rules.foo rename to 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 similarity index 100% rename from gitlint/tests/samples/user_rules/my_commit_rules.py rename to 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 similarity index 100% rename from gitlint/tests/samples/user_rules/parent_package/__init__.py rename to 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 similarity index 100% rename from gitlint/tests/samples/user_rules/parent_package/my_commit_rules.py rename to 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 similarity index 100% rename from gitlint/tests/test_cache.py rename to gitlint-core/gitlint/tests/test_cache.py diff --git a/gitlint/tests/test_display.py b/gitlint-core/gitlint/tests/test_display.py similarity index 100% rename from gitlint/tests/test_display.py rename to gitlint-core/gitlint/tests/test_display.py diff --git a/gitlint/tests/test_hooks.py b/gitlint-core/gitlint/tests/test_hooks.py similarity index 100% rename from gitlint/tests/test_hooks.py rename to gitlint-core/gitlint/tests/test_hooks.py diff --git a/gitlint/tests/test_lint.py b/gitlint-core/gitlint/tests/test_lint.py similarity index 100% rename from gitlint/tests/test_lint.py rename to gitlint-core/gitlint/tests/test_lint.py diff --git a/gitlint/tests/test_options.py b/gitlint-core/gitlint/tests/test_options.py similarity index 100% rename from gitlint/tests/test_options.py rename to gitlint-core/gitlint/tests/test_options.py diff --git a/gitlint/tests/test_utils.py b/gitlint-core/gitlint/tests/test_utils.py similarity index 100% rename from gitlint/tests/test_utils.py rename to gitlint-core/gitlint/tests/test_utils.py diff --git a/gitlint/utils.py b/gitlint-core/gitlint/utils.py similarity index 100% rename from gitlint/utils.py rename to gitlint-core/gitlint/utils.py diff --git a/gitlint-core/setup.cfg b/gitlint-core/setup.cfg new file mode 100644 index 00000000..2a9acf13 --- /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 00000000..952dd7f1 --- /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/requirements.txt b/requirements.txt index 33f143ce..270d9ff3 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,4 @@ setuptools wheel==0.37.0 -Click==8.0.3 -sh==1.14.2; sys_platform != 'win32' # sh is not supported on windows -arrow==1.2.1 +-e . +-e ./gitlint-core[trusted-deps] diff --git a/run_tests.sh b/run_tests.sh index 3471d8f3..09386dc6 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -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}" } diff --git a/setup.py b/setup.py index 12812885..c3544b73 100644 --- a/setup.py +++ b/setup.py @@ -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 @@ """ -# 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.0dev" setup( name="gitlint", - version=get_version("gitlint"), + version=version, description=description, long_description=long_description, classifiers=[ @@ -60,14 +49,8 @@ def get_version(package): ], python_requires=">=3.6", install_requires=[ - 'Click==8.0.3', - 'arrow==1.2.1', + '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 @@ def get_version(package): '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 259d36fd..ee4c7b9a 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -5,4 +5,4 @@ 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 . +-r requirements.txt