mirror of
https://gitea.invidious.io/iv-org/shard-ameba.git
synced 2024-08-15 00:53:29 +00:00
Add autocorrect checks to Flycheck, JSON, and TODO formatters
This commit is contained in:
parent
749c53527e
commit
8d3b76003e
3 changed files with 3 additions and 0 deletions
|
@ -5,6 +5,7 @@ module Ameba::Formatter
|
|||
def source_finished(source : Source)
|
||||
source.issues.each do |e|
|
||||
next if e.disabled?
|
||||
next if e.correctable? && config[:autocorrect]?
|
||||
if loc = e.location
|
||||
@mutex.synchronize do
|
||||
output.printf "%s:%d:%d: %s: [%s] %s\n",
|
||||
|
|
|
@ -77,6 +77,7 @@ module Ameba::Formatter
|
|||
|
||||
source.issues.each do |e|
|
||||
next if e.disabled?
|
||||
next if e.correctable? && config[:autocorrect]?
|
||||
json_source.issues << AsJSON::Issue.new(e.rule.name, e.rule.severity.to_s, e.location, e.end_location, e.message)
|
||||
@result.summary.issues_count += 1
|
||||
end
|
||||
|
|
|
@ -42,6 +42,7 @@ module Ameba::Formatter
|
|||
Hash(Rule::Base, Array(Issue)).new.tap do |h|
|
||||
issues.each do |issue|
|
||||
next if issue.disabled? || issue.rule.is_a?(Rule::Lint::Syntax)
|
||||
next if issue.correctable? && config[:autocorrect]?
|
||||
(h[issue.rule] ||= Array(Issue).new) << issue
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue