code: def lint(self, commit):
          
          LOG.debug("Linting commit %s", commit.sha or "[SHA UNKNOWN]")
          LOG.debug("Commit Object\n" + ustr(commit))
  
          # Apply config rules
          for rule in self.configuration_rules:
              rule.apply(self.config, commit)
  
          # Skip linting if this is a special commit type that is configured to be ignored
          ignore_commit_types = ["merge", "squash", "fixup"]
          for commit_type in ignore_commit_types:
              if getattr(commit, "is_{0}_commit".format(commit_type)) and \
                 getattr(self.config, "ignore_{0}_commits".format(commit_type)):
                  return []
  
          violations = []
          # determine violations by applying all rules
          violations.extend(self._apply_line_rules([commit.message.title], commit, self.title_line_rules, 1))
          violations.extend(self._apply_line_rules(commit.message.body, commit, self.body_line_rules, 2))
          violations.extend(self._apply_commit_rules(self.commit_rules, commit))
  
          # Sort violations by line number and rule_id. If there's no line nr specified (=common certain commit rules),
          # we replace None with -1 so that it always get's placed first. Note that we need this to do this to support
          # python 3, as None is not allowed in a list that is being sorted.
          violations.sort(key=lambda v: (-1 if v.line_nr is None else v.line_nr, v.rule_id))
          return violations
docs: Lint the last commit in a given git context by applying all ignore, title, body and commit rules.