def lint(self, commit, gitcontext):

        # Skip linting if this is merge commit and if the config is set to ignore those
        if commit.is_merge_commit and self.config.ignore_merge_commits:
            return []

        violations = []
        # determine violations by applying all rules
        violations.extend(self._apply_line_rules([commit.message.title], self.title_line_rules, 1, gitcontext))
        violations.extend(self._apply_line_rules(commit.message.body, self.body_line_rules, 2, gitcontext))
        violations.extend(self._apply_commit_rules(self.body_multiline_rules, commit, gitcontext))

        # sort violations by line number
        violations.sort(key=lambda v: (v.line_nr, v.rule_id))  # sort violations by line number and rule_id
        return violations
Lint the last commit in a given git context by applying all title, body and general rules.
dataset/ETHPy150Open jorisroovers/gitlint/gitlint/lint.py/GitLinter.lint