From 9bd38b9199720a28ae41dc8ea5c340e3fafd61bf Mon Sep 17 00:00:00 2001 From: Piotr Murach Date: Sat, 20 Jan 2018 18:41:55 +0100 Subject: [PATCH] Fix empty lines printing --- lib/queen/cli.rb | 5 ++++- lib/queen/rules/word_spelling.rb | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/queen/cli.rb b/lib/queen/cli.rb index 5082c79..7959bab 100644 --- a/lib/queen/cli.rb +++ b/lib/queen/cli.rb @@ -5,6 +5,7 @@ require_relative 'rule' require_relative 'rules/word_spelling' +require_relative 'rules/profanity' require_relative 'reporter' require_relative 'version' @@ -60,7 +61,9 @@ def run(*args) rule = rule_class.new rule.check(source) total_reprimands += rule.reprimands.count - puts reporter.report(file, rule) + if rule.reprimands.count.nonzero? + puts reporter.report(file, rule) + end end end diff --git a/lib/queen/rules/word_spelling.rb b/lib/queen/rules/word_spelling.rb index 97eb835..d1d30b3 100644 --- a/lib/queen/rules/word_spelling.rb +++ b/lib/queen/rules/word_spelling.rb @@ -6,6 +6,8 @@ module Queen module Rules + # Spell check words in a source. + # @api public class WordSpelling < Queen::Rule register 'word_spelling', WordSpelling