class Gergich::Capture::ShellcheckCapture

Constants

SEVERITY_MAP

github.com/koalaman/shellcheck/blob/6c068e7d/ShellCheck/Formatter/Format.hs#L41-L47

Public Instance Methods

run(output) click to toggle source
# File lib/gergich/capture/shellcheck_capture.rb, line 16
def run(output)
  JSON.parse(output).map do |warning|
    severity = warning.fetch("level")
    {
      path: warning.fetch("file"),
      position: warning.fetch("line"),
      message: warning.fetch("message"),
      severity: SEVERITY_MAP.fetch(severity),
      source: "shellcheck"
    }
  end
end