Sha256: 68c9dd193daa640b309f470b4252b26874b47ae3642e3ca216ce7e6a8150b3b0
Contents?: true
Size: 775 Bytes
Versions: 17
Compression:
Stored size: 775 Bytes
Contents
module CC module Analyzer class EngineOutputFilter ISSUE_TYPE = "issue".freeze def initialize(config = {}) @config = config end def filter?(output) if (json = parse_as_json(output)) issue?(json) && ignore_issue?(json) else false end end private def parse_as_json(output) JSON.parse(output) rescue JSON::ParserError nil end def issue?(json) json["type"] == ISSUE_TYPE end def ignore_issue?(json) !check_config(json["check"]).fetch("enabled", true) end def check_config(check_name) @checks ||= @config.fetch("checks", {}) @checks.fetch(check_name, {}) end end end end
Version data entries
17 entries across 17 versions & 1 rubygems