Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added 'ci' and 'build' to conventional commit types #135

Merged
merged 2 commits into from
Jun 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/contrib_rules.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ CT1 | contrib-title-conventional-commits | >= 0.12.0 | Enforces [C

Name | gitlint version | Default | Description
---------------|--------------------|--------------|----------------------------------
types | >= 0.12.0 | `fix,feat,chore,docs,style,refactor,perf,test,revert` | Comma separated list of allowed commit types.
types | >= 0.12.0 | `fix,feat,chore,docs,style,refactor,perf,test,revert,ci,build` | Comma separated list of allowed commit types.


## CC1: contrib-requires-signed-off-by ##
Expand All @@ -64,4 +64,4 @@ CC1 | contrib-requires-signed-off-by | >= 0.12.0 | Commit body


# Contributing Contrib rules
We'd love for you to contribute new Contrib rules to gitlint or improve existing ones! Please visit the [Contributing](contributing) page on how to get started.
We'd love for you to contribute new Contrib rules to gitlint or improve existing ones! Please visit the [Contributing](contributing) page on how to get started.
2 changes: 1 addition & 1 deletion gitlint/contrib/rules/conventional_commit.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class ConventionalCommit(LineRule):
options_spec = [
ListOption(
"types",
["fix", "feat", "chore", "docs", "style", "refactor", "perf", "test", "revert"],
["fix", "feat", "chore", "docs", "style", "refactor", "perf", "test", "revert", "ci", "build"],
"Comma separated list of allowed commit types.",
)
]
Expand Down
2 changes: 1 addition & 1 deletion gitlint/tests/config/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def test_contrib(self):

expected_rule_option = options.ListOption(
"types",
["fix", "feat", "chore", "docs", "style", "refactor", "perf", "test", "revert"],
["fix", "feat", "chore", "docs", "style", "refactor", "perf", "test", "revert", "ci", "build"],
"Comma separated list of allowed commit types.",
)

Expand Down
4 changes: 2 additions & 2 deletions gitlint/tests/contrib/test_conventional_commit.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ def test_conventional_commits(self):
rule = ConventionalCommit()

# No violations when using a correct type and format
for type in ["fix", "feat", "chore", "docs", "style", "refactor", "perf", "test", "revert"]:
for type in ["fix", "feat", "chore", "docs", "style", "refactor", "perf", "test", "revert", "ci", "build"]:
violations = rule.validate(type + u": föo", None)
self.assertListEqual([], violations)

# assert violation on wrong type
expected_violation = RuleViolation("CT1", "Title does not start with one of fix, feat, chore, docs,"
" style, refactor, perf, test, revert", u"bår: foo")
" style, refactor, perf, test, revert, ci, build", u"bår: foo")
violations = rule.validate(u"bår: foo", None)
self.assertListEqual([expected_violation], violations)

Expand Down
2 changes: 1 addition & 1 deletion gitlint/tests/expected/test_cli/test_contrib_1
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
1: CC1 Body does not contain a 'Signed-Off-By' line
1: CT1 Title does not start with one of fix, feat, chore, docs, style, refactor, perf, test, revert: "Test tïtle"
1: CT1 Title does not start with one of fix, feat, chore, docs, style, refactor, perf, test, revert, ci, build: "Test tïtle"
1: CT1 Title does not follow ConventionalCommits.org format 'type(optional-scope): description': "Test tïtle"
2 changes: 1 addition & 1 deletion qa/expected/test_contrib/test_contrib_rules_1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
1: CC1 Body does not contain a 'Signed-Off-By' line
1: CT1 Title does not start with one of fix, feat, chore, docs, style, refactor, perf, test, revert: "WIP Thi$ is å title"
1: CT1 Title does not start with one of fix, feat, chore, docs, style, refactor, perf, test, revert, ci, build: "WIP Thi$ is å title"
1: CT1 Title does not follow ConventionalCommits.org format 'type(optional-scope): description': "WIP Thi$ is å title"
1: T5 Title contains the word 'WIP' (case-insensitive): "WIP Thi$ is å title"