src/lint/private/runner

Source   Edit  

The runner: walks sources, parses files, runs steps, assembles reports.

Types

ExitMode = enum
  emClean = 0, emErrorsFound = 1, emParseError = 2, emNoSources = 3,
  emCheckError = 4
Source   Edit  
FileReport = object
  file*: string
  stepReports*: seq[StepReport]
Source   Edit  
FindingTag = object
  severity*: Severity
  stepLabel*: string
  checkName*: string
  file*: string
  finding*: Finding
A finding with everything the runner knows attached. Source   Edit  
ParseFailure = object of CatchableError
Source   Edit  
RunReport = object
  fileReports*: seq[FileReport]
Source   Edit  
StepReport = object
  label*: string
  findings*: seq[FindingTag]
Source   Edit  

Procs

proc `$`(report: RunReport; format: string = "text"): string {....raises: [],
    tags: [], forbids: [].}
Source   Edit  
proc exitMode(report: RunReport): ExitMode {....raises: [], tags: [], forbids: [].}
Source   Edit  
proc run(config: Config; targets: seq[Target] = @[]; format: string = "text") {....raises: [
    GlobSyntaxError, RegexError, OSError, ValueError, Exception, IOError,
    Exception, Exception, IOError, KeyError], tags: [ReadDirEffect, RootEffect,
    WriteIOEffect, ReadIOEffect, ReadEnvEffect], forbids: [].}

Runs the config and exits with the code for the resulting exit mode.

targets come from the command line and override the config's sources.

Source   Edit