def _on_lint_issue(self, linter_type, rule_id, rule_desc, message=None): lint_record = lintutils.LintRecord(linter_type, rule_id, rule_desc) rule_code = '{}_{}'.format(linter_type, rule_id).lower() rule_info = lookup_lint_rule(rule_code) if rule_info is not None: lint_record.score_type = rule_info[0] lint_record.severity = rule_info[1] self._score_stats[lint_record.score_type] = ( self._score_stats.get(lint_record.score_type, 0.0) + SEVERITY_TO_WEIGHT[lint_record.severity]) else: self.log.warning( 'Severity not found for rule: {}'.format(rule_code)) self.log.warning(message or rule_desc, extra={'lint_record': lint_record})
def _on_lint_issue(self, linter_type, rule_id, rule_desc, message=None): lint_record = lintutils.LintRecord(linter_type, rule_id, rule_desc) self.log.warning(message or rule_desc, extra={'lint_record': lint_record})