-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Removed old `commitlint.py`. - Added new module `linter` for linting and validation. - Added detailed validation on `linter` for message enhancement. - Added new error messages. - Added option `--quick` for quick linting. - Moved old validation to quick linting. - Added `pytest.ini` for adding src as a python path. - Updated test for both detailed and quick with same test data.
- Loading branch information
Showing
25 changed files
with
757 additions
and
286 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[pytest] | ||
pythonpath = src |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
"""Main module for commitlint""" | ||
"""Main module for commitlint.""" | ||
|
||
from .commitlint import check_commit_message | ||
from .linter import lint_commit_message | ||
|
||
__all__ = ["check_commit_message"] | ||
__all__ = ["lint_commit_message"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,28 @@ | ||
"""This module defines constants used throughout the application.""" | ||
|
||
COMMIT_HEADER_MAX_LENGTH = 72 | ||
|
||
COMMIT_TYPES = ( | ||
"build", | ||
"ci", | ||
"docs", | ||
"feat", | ||
"fix", | ||
"perf", | ||
"refactor", | ||
"style", | ||
"test", | ||
"chore", | ||
"revert", | ||
"bump", | ||
) | ||
|
||
IGNORE_COMMIT_PATTERNS = ( | ||
r"^((Merge pull request)|(Merge (.*?) into (.*?)|(Merge branch (.*?)))(?:\r?\n)*$)|" | ||
r"^(Merge tag (.*?))(?:\r?\n)*$|" | ||
r"^(R|r)evert (.*)|" | ||
r"^(Merged (.*?)(in|into) (.*)|Merged PR (.*): (.*))$|" | ||
r"^Merge remote-tracking branch(\s*)(.*)$|" | ||
r"^Automatic merge(.*)$|" | ||
r"^Auto-merged (.*?) into (.*)$" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
""" | ||
This module contains the git related helper functions. | ||
""" | ||
|
||
import subprocess | ||
from typing import List | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
"""Main module for commit linters and validators""" | ||
|
||
from ._linter import lint_commit_message | ||
|
||
__all__ = [ | ||
"lint_commit_message", | ||
] |
Oops, something went wrong.