Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
7 changes: 2 additions & 5 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down Expand Up @@ -58,6 +58,3 @@ DEPENDENCIES
rake (~> 13.0)
simplecov
standard!

BUNDLED WITH
2.2.6
6 changes: 0 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
2 changes: 1 addition & 1 deletion docs/RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 0 additions & 16 deletions lib/standard/formatter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions test/standard/cli_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
8 changes: 0 additions & 8 deletions test/standard/comment_directive_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
12 changes: 0 additions & 12 deletions test/standard/formatter_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -45,8 +43,6 @@ def test_prints_uncorrected_offenses
#{standard_greeting}
#{fixable_error_message}
Gemfile:42:13: Neat

#{call_to_action_message}
MESSAGE
end

Expand All @@ -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

Expand All @@ -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
Expand All @@ -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

Expand All @@ -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

Expand Down
4 changes: 0 additions & 4 deletions test/standardrb_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand Down
4 changes: 0 additions & 4 deletions test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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