Skip to content

Commit

Permalink
Fix: get things running again.
Browse files Browse the repository at this point in the history
  • Loading branch information
garrettdimon committed Sep 15, 2023
1 parent e839283 commit d3bf30f
Show file tree
Hide file tree
Showing 37 changed files with 117 additions and 48 deletions.
8 changes: 8 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

39 changes: 39 additions & 0 deletions .idea/reviewer.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 0 additions & 4 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ AllCops:
Layout/LineLength:
Enabled: false

# One case statement in a single method isn't complex.
Metrics/CyclomaticComplexity:
IgnoredMethods: ['case']

# 10 is a good goal but a little draconian
Metrics/MethodLength:
CountAsOne: ['array', 'hash', 'heredoc']
Expand Down
17 changes: 17 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,20 @@ source 'https://rubygems.org'
gemspec

gem 'rake', '~> 13.0'

group :development do
gem 'bundler-audit'
gem 'codecov'
gem 'flay'
gem 'flog'
gem 'inch'
gem 'minitest'
gem 'minitest-heat'
gem 'psych'
gem 'reek'
gem 'rubocop'
gem 'rubocop-minitest'
gem 'rubocop-rake'
gem 'simplecov'
gem 'yard'
end
2 changes: 1 addition & 1 deletion lib/reviewer/command/string/env.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def to_a
def env(key, value)
return nil if key.to_s.strip.empty? || value.to_s.strip.empty?

value = needs_quotes?(value) ? "'#{value}'" : value
value = "'#{value}'" if needs_quotes?(value)

"#{key.to_s.strip.upcase}=#{value.to_s.strip}"
end
Expand Down
2 changes: 1 addition & 1 deletion lib/reviewer/command/string/flags.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def to_a
def flag(key, value)
dash = key.to_s.size == 1 ? '-' : '--'

value = needs_quotes?(value) ? "'#{value}'" : value
value = "'#{value}'" if needs_quotes?(value)

"#{dash}#{key} #{value}".strip
end
Expand Down
2 changes: 1 addition & 1 deletion lib/reviewer/output.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module Reviewer
# Friendly API for printing nicely-formatted output to the console
class Output
DEFAULT_CONSOLE_WIDTH = 120
DIVIDER = '·'
DIVIDER = '.'

attr_reader :printer

Expand Down
6 changes: 5 additions & 1 deletion lib/reviewer/runner/strategies/captured.rb
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,11 @@ def display_progress(command, &block) # rubocop:disable Metrics/AbcSize
#
# @return [Boolean] true if either stdout or stderr contain printable content
def usable_output_captured?
[runner.stdout, runner.stderr].reject { |value| value.nil? || value.strip.empty? }.any?
[runner.stdout, runner.stderr].reject do |value|
value.nil? || value.strip.empty?
end.any?
rescue Encoding::CompatibilityError
false
end

# Prints "Success" and the resulting timing details before moving on to the next tool
Expand Down
15 changes: 0 additions & 15 deletions reviewer.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,4 @@ Gem::Specification.new do |spec|

spec.add_dependency 'rainbow'
spec.add_dependency 'slop'

spec.add_development_dependency 'bundler-audit'
spec.add_development_dependency 'codecov'
spec.add_development_dependency 'flay'
spec.add_development_dependency 'flog'
spec.add_development_dependency 'inch'
spec.add_development_dependency 'minitest'
spec.add_development_dependency 'minitest-heat'
spec.add_development_dependency 'psych'
spec.add_development_dependency 'reek'
spec.add_development_dependency 'rubocop'
spec.add_development_dependency 'rubocop-minitest'
spec.add_development_dependency 'rubocop-rake'
spec.add_development_dependency 'simplecov'
spec.add_development_dependency 'yard'
end
2 changes: 1 addition & 1 deletion test/reviewer/arguments/files_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

module Reviewer
class Arguments
class FilesTest < MiniTest::Test
class FilesTest < Minitest::Test
def test_array_casting
assert_equal [], Files.new.to_a
assert_equal ['*.css', '*.rb'], Files.new(provided: ['*.rb', '*.css'], keywords: []).to_a
Expand Down
2 changes: 1 addition & 1 deletion test/reviewer/arguments/keywords_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

module Reviewer
class Arguments
class KeywordsTest < MiniTest::Test
class KeywordsTest < Minitest::Test
def test_initializes_from_multiple_argument_formats
keywords = Keywords.new('one')
assert_equal ['one'], keywords.provided
Expand Down
2 changes: 1 addition & 1 deletion test/reviewer/arguments/tags_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

module Reviewer
class Arguments
class TagsTest < MiniTest::Test
class TagsTest < Minitest::Test
def test_array_casting
assert_equal [], Tags.new.to_a
assert_equal %w[css html ruby], Tags.new(provided: %w[css], keywords: %w[ruby html]).to_a
Expand Down
2 changes: 1 addition & 1 deletion test/reviewer/arguments_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
require 'test_helper'

module Reviewer
class ArgumentsTest < MiniTest::Test
class ArgumentsTest < Minitest::Test
def test_has_an_empty_array_of_tags_by_default
args = %w[]
arguments = Arguments.new(args)
Expand Down
2 changes: 1 addition & 1 deletion test/reviewer/batch_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
require 'test_helper'

module Reviewer
class BatchTest < MiniTest::Test
class BatchTest < Minitest::Test
def setup
@result = nil
end
Expand Down
2 changes: 1 addition & 1 deletion test/reviewer/command/string/env_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
module Reviewer
module Commands
class String
class EnvTest < MiniTest::Test
class EnvTest < Minitest::Test
def setup
@env_pairs = {
environment: 'production',
Expand Down
2 changes: 1 addition & 1 deletion test/reviewer/command/string/flags_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
module Reviewer
class Command
class String
class FlagsTest < MiniTest::Test
class FlagsTest < Minitest::Test
def setup
@flag_pairs = {
f: true,
Expand Down
2 changes: 1 addition & 1 deletion test/reviewer/command/string_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

module Reviewer
class Command
class StringTest < MiniTest::Test
class StringTest < Minitest::Test
def setup
@settings = ::Reviewer::Tool::Settings.new(:enabled_tool)
end
Expand Down
2 changes: 1 addition & 1 deletion test/reviewer/command_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
require 'test_helper'

module Reviewer
class CommandTest < MiniTest::Test
class CommandTest < Minitest::Test
def setup
@command = Reviewer::Command.new(:enabled_tool, :review)
end
Expand Down
2 changes: 1 addition & 1 deletion test/reviewer/conversions_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
require 'test_helper'

module Reviewer
class ConversionsTest < MiniTest::Test
class ConversionsTest < Minitest::Test
include Conversions

def test_tool_from_tool_instance
Expand Down
2 changes: 1 addition & 1 deletion test/reviewer/guidance_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
require 'test_helper'

module Reviewer
class GuidanceTest < MiniTest::Test
class GuidanceTest < Minitest::Test
def setup
@output = Output.new
end
Expand Down
2 changes: 1 addition & 1 deletion test/reviewer/history_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
require 'test_helper'

module Reviewer
class HistoryTest < MiniTest::Test
class HistoryTest < Minitest::Test
def setup
@history = History.new
end
Expand Down
4 changes: 3 additions & 1 deletion test/reviewer/keywords/git/staged_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def exitstatus
end
end

class StagedTest < MiniTest::Test
class StagedTest < Minitest::Test
def test_lists_staged_files_via_class_method
assert_equal Staged.new.list, Staged.list
end
Expand All @@ -26,8 +26,10 @@ def test_lists_staged_files
end

def test_parses_empty_git_command_output
# rubocop:disable Style/EmptyHeredoc
empty_staged_files_list = <<~EMPTY_GIT_OUTPUT
EMPTY_GIT_OUTPUT
# rubocop:enable Style/EmptyHeredoc

# Instead of staging files, stub the Open3 call.
Open3.stub :capture3, [empty_staged_files_list, nil, ProcessStatus.new(true)] do
Expand Down
2 changes: 1 addition & 1 deletion test/reviewer/loader_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
require 'test_helper'

module Reviewer
class LoaderTest < MiniTest::Test
class LoaderTest < Minitest::Test
def test_reads_the_yaml_configuration_file
loader = Loader.new
assert loader.configuration.is_a? Hash
Expand Down
2 changes: 1 addition & 1 deletion test/reviewer/output/printer_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

module Reviewer
class Output
class PrinterTest < MiniTest::Test
class PrinterTest < Minitest::Test
def setup
@printer = Printer.new
end
Expand Down
2 changes: 1 addition & 1 deletion test/reviewer/output/scrubber_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

module Reviewer
class Output
class ScrubberTest < MiniTest::Test
class ScrubberTest < Minitest::Test
def test_scrubs_rake_aborted_content
raw_stderr = <<~STDERR
some text before
Expand Down
2 changes: 1 addition & 1 deletion test/reviewer/output_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
require 'test_helper'

module Reviewer
class OutputTest < MiniTest::Test
class OutputTest < Minitest::Test
def setup
@output = Output.new
end
Expand Down
2 changes: 1 addition & 1 deletion test/reviewer/runner/strategies/captured_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
module Reviewer
class Runner
module Strategies
class CapturedTest < MiniTest::Test
class CapturedTest < Minitest::Test
def setup
@strategy = Runner::Strategies::Captured
end
Expand Down
2 changes: 1 addition & 1 deletion test/reviewer/runner/strategies/passthrough_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
module Reviewer
class Runner
module Strategies
class PassthroughTest < MiniTest::Test
class PassthroughTest < Minitest::Test
def setup
@strategy = Runner::Strategies::Passthrough
end
Expand Down
2 changes: 1 addition & 1 deletion test/reviewer/runner_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
require 'test_helper'

module Reviewer
class RunnerTest < MiniTest::Test
class RunnerTest < Minitest::Test
def test_determines_success_based_on_configured_max_exit_status_for_review
runner = Runner.new(:enabled_tool, :review)
max_exit_status = 3
Expand Down
2 changes: 1 addition & 1 deletion test/reviewer/shell/result_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

module Reviewer
class Shell
class ResultTest < MiniTest::Test
class ResultTest < Minitest::Test
def setup
@process_status = MockProcessStatus.new(exitstatus: 0, pid: 123)
end
Expand Down
2 changes: 1 addition & 1 deletion test/reviewer/shell/timer_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

module Reviewer
class Shell
class TimerTest < MiniTest::Test
class TimerTest < Minitest::Test
def test_records_prep_time
timer = Timer.new
assert timer.prep.nil?
Expand Down
2 changes: 1 addition & 1 deletion test/reviewer/shell_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
require 'test_helper'

module Reviewer
class ShellTest < MiniTest::Test
class ShellTest < Minitest::Test
def setup
@shell = Shell.new
end
Expand Down
2 changes: 1 addition & 1 deletion test/reviewer/tool/settings_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

module Reviewer
class Tool
class SettingsTest < MiniTest::Test
class SettingsTest < Minitest::Test
def setup
@tool = :example
@config = {
Expand Down
Loading

0 comments on commit d3bf30f

Please sign in to comment.