From fe703138ee0006bc55648cc89d3a73e43d9191ec Mon Sep 17 00:00:00 2001 From: NaotoSuzuki Date: Fri, 1 Apr 2022 10:57:08 +0900 Subject: [PATCH] Use `correctable?` for branching build_suggestions see https://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Offense#correctable%3F-instance_method --- rdjson_formatter/rdjson_formatter.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rdjson_formatter/rdjson_formatter.rb b/rdjson_formatter/rdjson_formatter.rb index 2026a5d..c3607eb 100644 --- a/rdjson_formatter/rdjson_formatter.rb +++ b/rdjson_formatter/rdjson_formatter.rb @@ -56,7 +56,7 @@ def build_diagnostic(file, offense) original_output: offense.to_s } - diagnostic[:suggestions] = build_suggestions(offense) if offense.corrector + diagnostic[:suggestions] = build_suggestions(offense) if offense.correctable? diagnostic end