reviewer 0.1.5 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/FUNDING.yml +3 -0
- data/.github/workflows/main.yml +79 -11
- data/.github/workflows/release.yml +98 -0
- data/.gitignore +1 -1
- data/.inch.yml +3 -1
- data/.reek.yml +175 -0
- data/.reviewer.example.yml +7 -2
- data/.reviewer.yml +166 -40
- data/.rubocop.yml +34 -2
- data/CHANGELOG.md +42 -2
- data/Gemfile +39 -1
- data/Gemfile.lock +291 -70
- data/LICENSE.txt +20 -4
- data/README.md +310 -21
- data/RELEASING.md +190 -0
- data/Rakefile +117 -0
- data/dependency_decisions.yml +61 -0
- data/exe/fmt +1 -1
- data/exe/rvw +1 -1
- data/lib/reviewer/arguments/files.rb +47 -20
- data/lib/reviewer/arguments/keywords.rb +34 -41
- data/lib/reviewer/arguments/tags.rb +11 -11
- data/lib/reviewer/arguments.rb +100 -29
- data/lib/reviewer/batch/formatter.rb +87 -0
- data/lib/reviewer/batch.rb +32 -48
- data/lib/reviewer/capabilities.rb +81 -0
- data/lib/reviewer/command/string/env.rb +12 -6
- data/lib/reviewer/command/string/flags.rb +2 -4
- data/lib/reviewer/command/string.rb +47 -12
- data/lib/reviewer/command.rb +65 -10
- data/lib/reviewer/configuration/loader.rb +70 -0
- data/lib/reviewer/configuration.rb +6 -3
- data/lib/reviewer/context.rb +15 -0
- data/lib/reviewer/doctor/config_check.rb +46 -0
- data/lib/reviewer/doctor/environment_check.rb +58 -0
- data/lib/reviewer/doctor/formatter.rb +75 -0
- data/lib/reviewer/doctor/keyword_check.rb +85 -0
- data/lib/reviewer/doctor/opportunity_check.rb +88 -0
- data/lib/reviewer/doctor/report.rb +63 -0
- data/lib/reviewer/doctor/tool_inventory.rb +41 -0
- data/lib/reviewer/doctor.rb +28 -0
- data/lib/reviewer/history.rb +10 -17
- data/lib/reviewer/output/formatting.rb +40 -0
- data/lib/reviewer/output/printer.rb +70 -9
- data/lib/reviewer/output.rb +37 -78
- data/lib/reviewer/prompt.rb +38 -0
- data/lib/reviewer/report/formatter.rb +124 -0
- data/lib/reviewer/report.rb +100 -0
- data/lib/reviewer/runner/failed_files.rb +66 -0
- data/lib/reviewer/runner/formatter.rb +103 -0
- data/lib/reviewer/runner/guidance.rb +79 -0
- data/lib/reviewer/runner/result.rb +150 -0
- data/lib/reviewer/runner/strategies/captured.rb +98 -23
- data/lib/reviewer/runner/strategies/passthrough.rb +2 -11
- data/lib/reviewer/runner.rb +126 -40
- data/lib/reviewer/session/formatter.rb +87 -0
- data/lib/reviewer/session.rb +208 -0
- data/lib/reviewer/setup/catalog.rb +233 -0
- data/lib/reviewer/setup/detector.rb +61 -0
- data/lib/reviewer/setup/formatter.rb +94 -0
- data/lib/reviewer/setup/gemfile_lock.rb +55 -0
- data/lib/reviewer/setup/generator.rb +54 -0
- data/lib/reviewer/setup/tool_block.rb +112 -0
- data/lib/reviewer/setup.rb +41 -0
- data/lib/reviewer/shell/result.rb +14 -15
- data/lib/reviewer/shell/timer.rb +40 -35
- data/lib/reviewer/shell.rb +41 -12
- data/lib/reviewer/tool/conversions.rb +20 -0
- data/lib/reviewer/tool/file_resolver.rb +54 -0
- data/lib/reviewer/tool/settings.rb +88 -44
- data/lib/reviewer/tool/test_file_mapper.rb +73 -0
- data/lib/reviewer/tool/timing.rb +78 -0
- data/lib/reviewer/tool.rb +88 -69
- data/lib/reviewer/tools.rb +47 -33
- data/lib/reviewer/version.rb +1 -1
- data/lib/reviewer.rb +109 -50
- data/reviewer.gemspec +16 -19
- metadata +101 -142
- data/lib/reviewer/conversions.rb +0 -16
- data/lib/reviewer/guidance.rb +0 -77
- data/lib/reviewer/keywords/git/staged.rb +0 -64
- data/lib/reviewer/keywords/git.rb +0 -14
- data/lib/reviewer/keywords.rb +0 -9
- data/lib/reviewer/loader.rb +0 -59
- data/lib/reviewer/output/scrubber.rb +0 -48
- data/lib/reviewer/output/token.rb +0 -85
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Reviewer
|
|
4
|
-
class Output
|
|
5
|
-
# Provides a structure interface for the results of running a command
|
|
6
|
-
class Scrubber
|
|
7
|
-
# A lot of tools are run via rake which inclues some unhelpful drive when there's a non-zero
|
|
8
|
-
# exit status. This is what it starts with so Reviewer can recognize and remove it.
|
|
9
|
-
RAKE_ABORTED_TEXT = <<~DRIVEL
|
|
10
|
-
rake aborted!
|
|
11
|
-
DRIVEL
|
|
12
|
-
|
|
13
|
-
attr_accessor :raw
|
|
14
|
-
|
|
15
|
-
# Creates a scrubber instance for the provided text content
|
|
16
|
-
# @param raw [String] the text to be scrubbed of unhelpful content
|
|
17
|
-
#
|
|
18
|
-
# @return [self]
|
|
19
|
-
def initialize(raw)
|
|
20
|
-
@raw = raw || ''
|
|
21
|
-
end
|
|
22
|
-
|
|
23
|
-
def clean
|
|
24
|
-
rake_aborted_text? ? preceding_text : raw
|
|
25
|
-
end
|
|
26
|
-
|
|
27
|
-
private
|
|
28
|
-
|
|
29
|
-
def rake_aborted_text?
|
|
30
|
-
raw.include?(RAKE_ABORTED_TEXT)
|
|
31
|
-
end
|
|
32
|
-
|
|
33
|
-
# Removes any unhelpful rake exit status details from $stderr. Reviewew uses `exit` when a
|
|
34
|
-
# command fails so that the resulting command-line exit status can be interpreted correctly
|
|
35
|
-
# in CI and similar environments. Without that exit status, those environments wouldn't
|
|
36
|
-
# recognize the failure. As a result, Rake almost always adds noise that begins with the value
|
|
37
|
-
# in RAKE_EXIT_DRIVEL when `exit` is called. Frequently, that RAKE_EXIT_DRIVEL is the only
|
|
38
|
-
# information in $stderr, and it's not helpful in the human-readable output, but other times
|
|
39
|
-
# when a valid exception occurs, there's useful error information preceding RAKE_EXIT_DRIVEL.
|
|
40
|
-
# So this ensures that the unhelpful part is always removed so the output is cluttered with
|
|
41
|
-
# red herrings since the command is designed to fail with an exit status of 1 under normal
|
|
42
|
-
# operation with tool failures.
|
|
43
|
-
def preceding_text
|
|
44
|
-
raw.split(RAKE_ABORTED_TEXT).first
|
|
45
|
-
end
|
|
46
|
-
end
|
|
47
|
-
end
|
|
48
|
-
end
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Reviewer
|
|
4
|
-
class Output
|
|
5
|
-
# Simple class for streamlining the output of 'tokens' representing a style and content
|
|
6
|
-
#
|
|
7
|
-
# @author [garrettdimon]
|
|
8
|
-
#
|
|
9
|
-
class Token
|
|
10
|
-
ESC = "\e["
|
|
11
|
-
|
|
12
|
-
attr_accessor :style, :content
|
|
13
|
-
|
|
14
|
-
def initialize(style, content)
|
|
15
|
-
@style = style
|
|
16
|
-
@content = content
|
|
17
|
-
end
|
|
18
|
-
|
|
19
|
-
def to_s
|
|
20
|
-
[
|
|
21
|
-
style_string,
|
|
22
|
-
content,
|
|
23
|
-
reset_string
|
|
24
|
-
].join
|
|
25
|
-
end
|
|
26
|
-
|
|
27
|
-
private
|
|
28
|
-
|
|
29
|
-
def style_string
|
|
30
|
-
"#{ESC}#{weight};#{color}m"
|
|
31
|
-
end
|
|
32
|
-
|
|
33
|
-
def reset_string
|
|
34
|
-
"#{ESC}0m"
|
|
35
|
-
end
|
|
36
|
-
|
|
37
|
-
def weight_key
|
|
38
|
-
style_components[0]
|
|
39
|
-
end
|
|
40
|
-
|
|
41
|
-
def color_key
|
|
42
|
-
style_components[1]
|
|
43
|
-
end
|
|
44
|
-
|
|
45
|
-
def weight
|
|
46
|
-
{
|
|
47
|
-
default: 0,
|
|
48
|
-
bold: 1,
|
|
49
|
-
light: 2,
|
|
50
|
-
italic: 3
|
|
51
|
-
}.fetch(weight_key)
|
|
52
|
-
end
|
|
53
|
-
|
|
54
|
-
def color
|
|
55
|
-
{
|
|
56
|
-
black: 30,
|
|
57
|
-
red: 31,
|
|
58
|
-
green: 32,
|
|
59
|
-
yellow: 33,
|
|
60
|
-
blue: 34,
|
|
61
|
-
magenta: 35,
|
|
62
|
-
cyan: 36,
|
|
63
|
-
gray: 37,
|
|
64
|
-
default: 39
|
|
65
|
-
}.fetch(color_key)
|
|
66
|
-
end
|
|
67
|
-
|
|
68
|
-
def style_components
|
|
69
|
-
{
|
|
70
|
-
success_bold: %i[bold green],
|
|
71
|
-
success: %i[default green],
|
|
72
|
-
success_light: %i[light green],
|
|
73
|
-
error: %i[bold red],
|
|
74
|
-
failure: %i[default red],
|
|
75
|
-
warning: %i[bold yellow],
|
|
76
|
-
warning_light: %i[light yellow],
|
|
77
|
-
source: %i[italic default],
|
|
78
|
-
bold: %i[default default],
|
|
79
|
-
default: %i[default default],
|
|
80
|
-
muted: %i[light gray]
|
|
81
|
-
}.fetch(style)
|
|
82
|
-
end
|
|
83
|
-
end
|
|
84
|
-
end
|
|
85
|
-
end
|