Module: Reviewer

Defined in:
lib/reviewer.rb,
lib/reviewer/tool.rb,
lib/reviewer/batch.rb,
lib/reviewer/shell.rb,
lib/reviewer/tools.rb,
lib/reviewer/loader.rb,
lib/reviewer/output.rb,
lib/reviewer/runner.rb,
lib/reviewer/command.rb,
lib/reviewer/history.rb,
lib/reviewer/version.rb,
lib/reviewer/guidance.rb,
lib/reviewer/arguments.rb,
lib/reviewer/conversions.rb,
lib/reviewer/shell/timer.rb,
lib/reviewer/keywords/git.rb,
lib/reviewer/output/token.rb,
lib/reviewer/shell/result.rb,
lib/reviewer/configuration.rb,
lib/reviewer/tool/settings.rb,
lib/reviewer/arguments/tags.rb,
lib/reviewer/command/string.rb,
lib/reviewer/output/printer.rb,
lib/reviewer/arguments/files.rb,
lib/reviewer/output/scrubber.rb,
lib/reviewer/arguments/keywords.rb,
lib/reviewer/command/string/env.rb,
lib/reviewer/keywords/git/staged.rb,
lib/reviewer/command/string/flags.rb,
lib/reviewer/runner/strategies/captured.rb,
lib/reviewer/runner/strategies/passthrough.rb

Overview

Primary interface for the reviewer tools

Defined Under Namespace

Modules: Conversions, Keywords Classes: Arguments, Batch, Command, Configuration, Error, Guidance, History, Loader, Output, Runner, Shell, Tool, Tools

Constant Summary collapse

VERSION =
'0.1.5'

Class Method Summary collapse

Class Method Details

.argumentsReviewer::Arguments

The collection of arguments that were passed via the command line.

Returns:



55
56
57
# File 'lib/reviewer.rb', line 55

def arguments
  @arguments ||= Arguments.new
end

.configurationReviewer::Configuration

Exposes the configuration options for Reviewer.

Returns:



85
86
87
# File 'lib/reviewer.rb', line 85

def configuration
  @configuration ||= Configuration.new
end

.configure {|configuration| ... } ⇒ Reviewer::Configuration

A block approach to configuring Reviewer.

Examples:

Set configuration file path

Reviewer.configure do |config|
  config.file = '~/configuration.yml'
end

Yields:

Returns:



97
98
99
# File 'lib/reviewer.rb', line 97

def configure
  yield(configuration)
end

.format(clear_screen: false) ⇒ void

This method returns an undefined value.

Runs the ‘format` command for the specified tools/files for which it is configured.

Parameters:

  • clear_screen (boolean) (defaults to: false)

    clears the screen to reduce noise when true



48
49
50
# File 'lib/reviewer.rb', line 48

def format(clear_screen: false)
  perform(:format, clear_screen: clear_screen)
end

.historyReviewer::History

A file store for sharing information across runs

Returns:



78
79
80
# File 'lib/reviewer.rb', line 78

def history
  @history ||= History.new
end

.outputReviewer::Output

The primary output method for Reviewer to consistently display success/failure details for a

unique run of each tool and the collective summary when relevant.

Returns:



71
72
73
# File 'lib/reviewer.rb', line 71

def output
  @output ||= Output.new
end

.reset!Object

Resets the loaded tools



31
32
33
# File 'lib/reviewer.rb', line 31

def reset!
  @tools = nil
end

.review(clear_screen: false) ⇒ void

This method returns an undefined value.

Runs the ‘review` command for the specified tools/files. Reviewer expects all configured

commands that are not disabled to have an entry for the `review` command.

Parameters:

  • clear_screen (boolean) (defaults to: false)

    clears the screen to reduce noise when true



40
41
42
# File 'lib/reviewer.rb', line 40

def review(clear_screen: false)
  perform(:review, clear_screen: clear_screen)
end

.toolsReviewer::Tools

An interface for the collection of configured tools for accessing subsets of tools

based on enabled/disabled, tags, keywords, etc.

Returns:

  • (Reviewer::Tools)

    exposes the set of tools to be run in a given context



63
64
65
# File 'lib/reviewer.rb', line 63

def tools
  @tools ||= Tools.new
end