diff --git a/CHANGELOG.md b/CHANGELOG.md index 9debea5f..b85f2d0b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,8 +5,10 @@ * Relax multi-line block rules, moving away from enforcing semantic blocks to instead allowing code to adhere to whatever multi-line format the author deems best [#263](https://github.com/testdouble/standard/pull/263) -* Allow a `standard:disable` comment directive in addition to `rubocop:disable` +* Allow a `standard:disable` comment directive in addition to `rubocop:disable` [#186](https://github.com/testdouble/standard/pull/186) +* Remove the banner text that standard outputs after failure + [#264](https://github.com/testdouble/standard/pull/264) ## 0.13.0 diff --git a/Gemfile.lock b/Gemfile.lock index 56aa5878..1f4b5a95 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -13,7 +13,7 @@ GEM docile (1.3.5) gimme (0.5.0) method_source (1.0.0) - minitest (5.14.3) + minitest (5.14.4) parallel (1.20.1) parser (3.0.0.0) ast (~> 2.4.1) @@ -22,7 +22,7 @@ GEM method_source (~> 1.0) rainbow (3.0.0) rake (13.0.3) - regexp_parser (2.0.3) + regexp_parser (2.1.1) rexml (3.2.4) rubocop (1.10.0) parallel (~> 1.10) @@ -58,6 +58,3 @@ DEPENDENCIES rake (~> 13.0) simplecov standard! - -BUNDLED WITH - 2.2.6 diff --git a/README.md b/README.md index 222d26ab..fc6ae647 100644 --- a/README.md +++ b/README.md @@ -60,12 +60,6 @@ can look at Standard's current base configuration in significant changes to the configuration will be documented as [GitHub release notes](https://github.com/testdouble/standard/releases). -**[NOTE: until StandardRB hits 1.0.0, we consider this configuration to be a -non-final work in progress and we encourage you to submit your opinions (and -reasoned arguments) for the addition, removal, or change to a rule by [opening -an issue](https://github.com/testdouble/standard/issues/new). If you start using -Standard, don't be shocked if things change a bit!]** - ## Usage Once you've installed Standard, you should be able to use the `standardrb` diff --git a/docs/RELEASE.md b/docs/RELEASE.md index 6c23ca9c..219cd2a7 100644 --- a/docs/RELEASE.md +++ b/docs/RELEASE.md @@ -23,7 +23,7 @@ really the only one we'll need for releasing the gem to 1. Make sure git is up to date and `bundle exec rake` exits cleanly 2. If you upgraded a Rubocop dependency, be sure to lock it down in - `standard.gemspec`. Until Rubocop hits 1.0, we're going to stick to exact + `standard.gemspec`. To avoid being broken transitively, we stick to exact release dependencies (e.g. "0.91.0" instead of "~> 0.91") 3. Bump the appropriate version segment in `lib/standard/version.rb` (basic semantic versioning rules apply; if the release updates Rubocop, follow its diff --git a/lib/standard/formatter.rb b/lib/standard/formatter.rb index e276431e..87ff5327 100644 --- a/lib/standard/formatter.rb +++ b/lib/standard/formatter.rb @@ -8,11 +8,6 @@ class Formatter < RuboCop::Formatter::BaseFormatter standard: Use Ruby Standard Style (https://github.com/testdouble/standard) MSG - CALL_TO_ACTION_MESSAGE = <<-MSG.gsub(/^ {6}/, "") - Notice: Disagree with these rules? While StandardRB is pre-1.0.0, feel free to submit suggestions to: - https://github.com/testdouble/standard/issues/new - MSG - def self.fixable_error_message(command) <<-MSG.gsub(/^ {8}/, "") standard: Run `#{command}` to automatically fix some problems. @@ -24,7 +19,6 @@ def initialize(*args) @detects_fixability = DetectsFixability.new @header_printed_already = false @fix_suggestion_printed_already = false - @any_uncorrected_offenses = false end def started(_target_files) @@ -33,7 +27,6 @@ def started(_target_files) def file_finished(file, offenses) return unless (uncorrected_offenses = offenses.reject(&:corrected?)).any? - @any_uncorrected_offenses = true print_header_once print_fix_suggestion_once(uncorrected_offenses) @@ -43,10 +36,6 @@ def file_finished(file, offenses) end end - def finished(_) - print_call_for_feedback if @any_uncorrected_offenses - end - private def print_header_once @@ -90,11 +79,6 @@ def path_to(file) Pathname.new(file).relative_path_from(Pathname.new(Dir.pwd)) end - def print_call_for_feedback - output.print "\n" - output.print CALL_TO_ACTION_MESSAGE - end - def auto_correct_option_provided? options[:auto_correct] || options[:safe_auto_correct] end diff --git a/test/standard/cli_test.rb b/test/standard/cli_test.rb index 597f21b4..c2570b83 100644 --- a/test/standard/cli_test.rb +++ b/test/standard/cli_test.rb @@ -24,8 +24,6 @@ def test_unfixable_broken assert_equal <<-OUTPUT.gsub(/^ {6}/, ""), fake_out.string #{standard_greeting} test/fixture/cli/unfixable-bad.rb:3:12: Lint/AssignmentInCondition: Wrap assignment in parentheses if intentional - - #{call_to_action_message} OUTPUT end diff --git a/test/standard/comment_directive_test.rb b/test/standard/comment_directive_test.rb index 57778f32..72b9aa62 100644 --- a/test/standard/comment_directive_test.rb +++ b/test/standard/comment_directive_test.rb @@ -13,14 +13,6 @@ def test_comment_directive standard: Use Ruby Standard Style (https://github.com/testdouble/standard) standard: Run `standardrb --fix` to automatically fix some problems. test/fixture/comment_directive_test/disabled.rb:11:1: Layout/IndentationWidth: Use 2 (not 4) spaces for indentation. - - #{call_to_action_message} OUTPUT end - - private - - def call_to_action_message - Standard::Formatter::CALL_TO_ACTION_MESSAGE.chomp - end end diff --git a/test/standard/formatter_test.rb b/test/standard/formatter_test.rb index 12e50ea3..d8dfeea9 100644 --- a/test/standard/formatter_test.rb +++ b/test/standard/formatter_test.rb @@ -32,8 +32,6 @@ def test_does_not_print_fix_command_if_run_with_fix assert_equal <<-MESSAGE.gsub(/^ {6}/, ""), @io.string #{standard_greeting} Gemfile:42:13: Neat - - #{call_to_action_message} MESSAGE end @@ -45,8 +43,6 @@ def test_prints_uncorrected_offenses #{standard_greeting} #{fixable_error_message} Gemfile:42:13: Neat - - #{call_to_action_message} MESSAGE end @@ -63,8 +59,6 @@ def test_prints_header_and_fix_suggestion_exactly_once #{fixable_error_message} Gemfile:42:13: Neat Gemfile:43:14: Super - - #{call_to_action_message} MESSAGE end @@ -79,8 +73,6 @@ def test_prints_rake_message #{standard_greeting} #{fixable_error_message("rake standard:fix")} Gemfile:42:13: Neat - - #{call_to_action_message} MESSAGE $PROGRAM_NAME = og_name @@ -96,8 +88,6 @@ def test_prints_call_for_feedback #{fixable_error_message} Gemfile:42:13: Neat Gemfile:43:14: Super - - #{call_to_action_message} MESSAGE end @@ -114,8 +104,6 @@ def test_does_not_print_fix_command_if_offense_not_autocorrectable assert_equal <<-MESSAGE.gsub(/^ {6}/, ""), @io.string #{standard_greeting} Gemfile:42:13: Neat - - #{call_to_action_message} MESSAGE end diff --git a/test/standardrb_test.rb b/test/standardrb_test.rb index 326c45a7..bff2412f 100644 --- a/test/standardrb_test.rb +++ b/test/standardrb_test.rb @@ -11,8 +11,6 @@ def test_project_a_failure_output lib/foo/do_lint.rb:1:1: Lint/UselessAssignment: Useless assignment to variable - `useless_assignment`. lib/foo/tmp/do_lint.rb:1:1: Lint/UselessAssignment: Useless assignment to variable - `useless_assignment`. lib/do_lint.rb:1:1: Lint/UselessAssignment: Useless assignment to variable - `useless_assignment`. - - #{call_to_action_message} MSG end @@ -31,8 +29,6 @@ def test_project_with_cwd_in_nested_path #{standard_greeting} do_lint.rb:1:1: Lint/UselessAssignment: Useless assignment to variable - `useless_assignment`. tmp/do_lint.rb:1:1: Lint/UselessAssignment: Useless assignment to variable - `useless_assignment`. - - #{call_to_action_message} MSG end diff --git a/test/test_helper.rb b/test/test_helper.rb index 29cf5717..2eb7c3bb 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -50,8 +50,4 @@ def standard_greeting def fixable_error_message(command = "standardrb --fix") Standard::Formatter.fixable_error_message(command).chomp end - - def call_to_action_message - Standard::Formatter::CALL_TO_ACTION_MESSAGE.chomp - end end