diff --git a/.gitlint b/.gitlint index cad036b1..fa4e6373 100644 --- a/.gitlint +++ b/.gitlint @@ -3,6 +3,7 @@ ignore=body-is-missing extra-path=./scripts/gitlint_rules/ debug=true verbosity=3 +contrib = contrib-body-requires-signed-off-by, contrib-title-conventional-commits [title-max-length] line-length=50 diff --git a/scripts/gitlint_rules/rules.py b/scripts/gitlint_rules/rules.py index c05521cb..929b121c 100644 --- a/scripts/gitlint_rules/rules.py +++ b/scripts/gitlint_rules/rules.py @@ -2,39 +2,38 @@ from gitlint.rules import CommitRule, RuleViolation -class SignedOffBy(CommitRule): - """This rule will enforce that each commit contains a "Signed-off-by" line.""" +# class SignedOffBy(CommitRule): +# """This rule will enforce that each commit contains a "Signed-off-by" line.""" - name = "body-requires-signed-off-by" - id = "Workflows1" +# name = "body-requires-signed-off-by" +# id = "Workflows1" - def validate(self, commit): - for line in commit.message.body: - if line.startswith("Signed-off-by"): - return +# def validate(self, commit): +# for line in commit.message.body: +# if line.startswith("Signed-off-by"): +# return - msg = "Body does not contain a 'Signed-Off-By' line" - return [RuleViolation(self.id, msg, line_nr=1)] +# msg = "Body does not contain a 'Signed-Off-By' line" +# return [RuleViolation(self.id, msg, line_nr=1)] -class ApprovedSubject(CommitRule): - """Validate subject of each commit. +# class ApprovedSubject(CommitRule): +# """Validate subject of each commit. - This rule will enforce that each commit starts with a "module: text" format. - The 'module' can be any alphanumeric word, and the message must start with a colon followed by a space. - """ +# This rule will enforce that each commit starts with a "module: text" format. +# The 'module' can be any alphanumeric word, and the message must start with a colon followed by a space. +# """ - name = "approved-subject-in-title" - id = "Workflows2" +# name = "approved-subject-in-title" +# id = "Workflows2" - MODULE_PATTERN = re.compile(r"^[a-zA-Z0-9_-]+: .+") +# MODULE_PATTERN = re.compile(r"^[a-zA-Z0-9_-]+: .+") - def validate(self, commit): - title = commit.message.title +# def validate(self, commit): +# title = commit.message.title - if not self.MODULE_PATTERN.match(title): - msg = "Subject does not follow 'module: text' format" - return [RuleViolation(self.id, msg, line_nr=1)] - - return +# if not self.MODULE_PATTERN.match(title): +# msg = "Subject does not follow 'module: text' format" +# return [RuleViolation(self.id, msg, line_nr=1)] +# return \ No newline at end of file