reviewer 0.1.4 → 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.
Files changed (93) hide show
  1. checksums.yaml +4 -4
  2. data/.alexignore +1 -0
  3. data/.github/FUNDING.yml +3 -0
  4. data/.github/workflows/main.yml +81 -11
  5. data/.github/workflows/release.yml +98 -0
  6. data/.gitignore +1 -1
  7. data/.inch.yml +3 -1
  8. data/.reek.yml +175 -0
  9. data/.reviewer.example.yml +27 -12
  10. data/.reviewer.future.yml +221 -0
  11. data/.reviewer.yml +191 -28
  12. data/.reviewer_stdout +0 -0
  13. data/.rubocop.yml +34 -1
  14. data/CHANGELOG.md +42 -2
  15. data/Gemfile +39 -1
  16. data/Gemfile.lock +294 -72
  17. data/README.md +315 -7
  18. data/RELEASING.md +190 -0
  19. data/Rakefile +117 -0
  20. data/dependency_decisions.yml +61 -0
  21. data/exe/fmt +1 -1
  22. data/exe/rvw +1 -1
  23. data/lib/reviewer/arguments/files.rb +60 -27
  24. data/lib/reviewer/arguments/keywords.rb +39 -43
  25. data/lib/reviewer/arguments/tags.rb +21 -14
  26. data/lib/reviewer/arguments.rb +107 -29
  27. data/lib/reviewer/batch/formatter.rb +87 -0
  28. data/lib/reviewer/batch.rb +46 -35
  29. data/lib/reviewer/capabilities.rb +81 -0
  30. data/lib/reviewer/command/string/env.rb +16 -6
  31. data/lib/reviewer/command/string/flags.rb +14 -5
  32. data/lib/reviewer/command/string.rb +53 -24
  33. data/lib/reviewer/command.rb +69 -39
  34. data/lib/reviewer/configuration/loader.rb +70 -0
  35. data/lib/reviewer/configuration.rb +14 -4
  36. data/lib/reviewer/context.rb +15 -0
  37. data/lib/reviewer/doctor/config_check.rb +46 -0
  38. data/lib/reviewer/doctor/environment_check.rb +58 -0
  39. data/lib/reviewer/doctor/formatter.rb +75 -0
  40. data/lib/reviewer/doctor/keyword_check.rb +85 -0
  41. data/lib/reviewer/doctor/opportunity_check.rb +88 -0
  42. data/lib/reviewer/doctor/report.rb +63 -0
  43. data/lib/reviewer/doctor/tool_inventory.rb +41 -0
  44. data/lib/reviewer/doctor.rb +28 -0
  45. data/lib/reviewer/history.rb +36 -12
  46. data/lib/reviewer/output/formatting.rb +40 -0
  47. data/lib/reviewer/output/printer.rb +105 -0
  48. data/lib/reviewer/output.rb +54 -65
  49. data/lib/reviewer/prompt.rb +38 -0
  50. data/lib/reviewer/report/formatter.rb +124 -0
  51. data/lib/reviewer/report.rb +100 -0
  52. data/lib/reviewer/runner/failed_files.rb +66 -0
  53. data/lib/reviewer/runner/formatter.rb +103 -0
  54. data/lib/reviewer/runner/guidance.rb +79 -0
  55. data/lib/reviewer/runner/result.rb +150 -0
  56. data/lib/reviewer/runner/strategies/captured.rb +232 -0
  57. data/lib/reviewer/runner/strategies/{verbose.rb → passthrough.rb} +15 -24
  58. data/lib/reviewer/runner.rb +179 -35
  59. data/lib/reviewer/session/formatter.rb +87 -0
  60. data/lib/reviewer/session.rb +208 -0
  61. data/lib/reviewer/setup/catalog.rb +233 -0
  62. data/lib/reviewer/setup/detector.rb +61 -0
  63. data/lib/reviewer/setup/formatter.rb +94 -0
  64. data/lib/reviewer/setup/gemfile_lock.rb +55 -0
  65. data/lib/reviewer/setup/generator.rb +54 -0
  66. data/lib/reviewer/setup/tool_block.rb +112 -0
  67. data/lib/reviewer/setup.rb +41 -0
  68. data/lib/reviewer/shell/result.rb +25 -11
  69. data/lib/reviewer/shell/timer.rb +47 -27
  70. data/lib/reviewer/shell.rb +46 -21
  71. data/lib/reviewer/tool/conversions.rb +20 -0
  72. data/lib/reviewer/tool/file_resolver.rb +54 -0
  73. data/lib/reviewer/tool/settings.rb +107 -56
  74. data/lib/reviewer/tool/test_file_mapper.rb +73 -0
  75. data/lib/reviewer/tool/timing.rb +78 -0
  76. data/lib/reviewer/tool.rb +88 -47
  77. data/lib/reviewer/tools.rb +47 -33
  78. data/lib/reviewer/version.rb +1 -1
  79. data/lib/reviewer.rb +114 -54
  80. data/reviewer.gemspec +21 -20
  81. data/structure.svg +1 -0
  82. metadata +113 -148
  83. data/.ruby-version +0 -1
  84. data/lib/reviewer/command/string/verbosity.rb +0 -51
  85. data/lib/reviewer/command/verbosity.rb +0 -65
  86. data/lib/reviewer/conversions.rb +0 -27
  87. data/lib/reviewer/guidance.rb +0 -73
  88. data/lib/reviewer/keywords/git/staged.rb +0 -48
  89. data/lib/reviewer/keywords/git.rb +0 -14
  90. data/lib/reviewer/keywords.rb +0 -9
  91. data/lib/reviewer/loader.rb +0 -59
  92. data/lib/reviewer/printer.rb +0 -25
  93. data/lib/reviewer/runner/strategies/quiet.rb +0 -90
@@ -0,0 +1,221 @@
1
+ # This represents the long-term vision for reviewer. It's a sort of documentation-driven design, but
2
+ # it's also heavily based on the initial exploration and iteration to determine what's possible and
3
+ # what's practical based on testing out a variety of command types and structures.
4
+
5
+ # Options for `rvw` command
6
+ # -c <file>, --config=<file>
7
+ # -f <file>,<file>..., --files=<file>,<file>...
8
+ # -t <tag>,<tag>..., --tags=<tag>,<tag>...
9
+ # -l <tool_key>,<tool_key>..., --tools=<tool_key>,<tool_key>...
10
+ # -c <command>, --command=<command>
11
+ # -k, --keywords
12
+ # -s, --settings
13
+ # -h, --help
14
+ # -v, --version
15
+ # <keyword>
16
+
17
+ # Implicit Keywords:
18
+ # - every <tag>
19
+ # - every <tool_key>
20
+ # - <tool_key>:settings
21
+ # - <tool_key>:links
22
+ # - every <tool_key>:<link>
23
+ # - <tool_key>:commands
24
+ # - every <tool_key>:<command>
25
+
26
+ # Reserved Keywords:
27
+ # - every link type
28
+ # - every command type
29
+ # - staged // currently staged git files
30
+ # - untracked // currently untracked git files
31
+ # - fresh // untracked files updated in last 5 minutes
32
+ # - fresh_15 // ... 15 minutes
33
+ # - fresh_30 // ... 30 minutes
34
+ # - fresh_60 // ... 60 minutes
35
+ # - stale // untracked files updated more than 5 minutes ago
36
+ # - stale_15 // ... 15 minutes
37
+ # - stale_30 // ... 30 minutes
38
+ # - stale_60 // ... 60 minutes
39
+ # - branch|diff // All files created or updated on the current branch
40
+ # - last_commit // All files created or updated in the last commit
41
+ # - current // alias for branch or diff?
42
+
43
+ # Command Examples:
44
+
45
+ # The Basics
46
+ # - rvw // runs :review command for all enabled tools
47
+ # - rvw <command> // runs <command> for all enabled tools (not disabled or solo)
48
+ # - rvw <keyword> // runs :review command for all enabled tools and translates the <keyword>
49
+ # - rvw <tag> // runs :review command for all enabled tools tagged with <tag>
50
+
51
+ # Tools
52
+ # - rvw <tool_key> // shortcut for `rvw <tool_key>:review`
53
+ # - rvw <tool_key>:<command> // runs <command> for <tool_key> in passthrough mode
54
+ # - rvw <tool_key>:<link> // opens the <link> via `open <link>` if present, otherwise, shares that it's not configured
55
+ # - rvw <tool_key>:settings // displays all settings for <tool_key>
56
+ # - rvw <tool_key>:commands // displays all configured commands for <tool_key>
57
+ # - rvw <tool_key>:links // displays all configured links for <tool_key>
58
+
59
+ # Combos
60
+ # - rvw <keyword> <tag> // ex. `rvw staged ruby` -> `rvw review staged ruby`
61
+ # - rvw <command> <tag> // ex. `rvw format ruby` -> `rvw format ruby`
62
+ # - rvw <command> <reserved_keyword> // ex. `rvw install ruby`
63
+ # - rvw <command> <reserved_keyword> <tag> // ex. `rvw format last_commit ruby`
64
+ # - rvw <command> <reserved_keyword> <tag> <tag> // ex. `rvw format last_commit ruby erb`
65
+
66
+ reviewer:
67
+ # Whether to run tools consecutively or in parallel if available
68
+ # :linear - It would suck if your first command is `bundle audit` and fails but 6 other tools
69
+ # are running in parallel but will take time to fail. So :linear with :stop as the behavior
70
+ # ensures you don't attepmt commands.
71
+ # :parallel - Reviewer will attempt to run commands on multiple threads/processors for more speed.
72
+ # Best used when groups of commands are not dependent on each other.
73
+ default_batch_mode: <:linear|:safe, :parallel|:fast>
74
+
75
+ # Fallback failure behavior for all commands where it isn't explicitly defined. Applies to
76
+ # linear runs independent of each other. So if you have two batches (ex. ruby, javascript), and
77
+ # one batch fails immediately, the remaining commands willn ot be run. But the other batch will
78
+ # safely continue independently.
79
+ # Optional. Defaults to :fast.
80
+ # :stop - Don't run any additional commands in that batch.
81
+ # :continue - Keep running the other commands.
82
+ default_command_failure_behavior_in_batch: <:stop, :continue>
83
+
84
+ # Fallback install behavior for all commands where it isn't explicitly defined.
85
+ # Maybe if the install command is present, `:auto` is implied?
86
+ # Optional. Defaults to :guidance.
87
+ # - :guidance shows the installation command and/or link for manual installation.
88
+ # - :auto attempts to automatically install if the command is missing
89
+ # - :skip quietly moves on without worrying about it
90
+ default_install_behavior: <:guidance, :auto, :skip>
91
+
92
+ # Fallback behavior for displaying results.
93
+ # Optional. Defaults to :full
94
+ # - :full - Re-run the command directly so you see the full output
95
+ # - :fast - Show the results, but potentially lose colorizing and some formatting
96
+ default_results_behavior: <:full, :fast, :timer>
97
+
98
+ # Fallback definition for determining whether a command is slow.
99
+ # Only used if :default_results_behavior is :timer
100
+ # Optional. Defaults to 10 seconds
101
+ default_slow_window: <integer seconds>
102
+
103
+ # Fallback defintion for determining whether a command needs to be prepped again.
104
+ # Optional. Defaults to 6 hours
105
+ default_prep_window: <integer hours>
106
+
107
+ # Primarily for debugging/improving performance of reviewer. But if low-level performance info is
108
+ # interesting, it can be enabled.
109
+ # Optional. Defaults to :min
110
+ # :min - Shows simply the total time for each command. Breaks out install/prep % if relevant.
111
+ timer_detail: <:min, :max>
112
+
113
+ # Custom-defined keywords for shortcuts
114
+ keywords:
115
+ # Compact version
116
+ mgc: 'format last_commit ruby erb'
117
+ # Long-form version of `mgc` (a little more self-documenting and explicit)
118
+ magic: '--command=format --keywords=last_commit --tags=ruby,erb'
119
+ # Long-form of `mgc` (most self-documentating and explicit)
120
+ magic:
121
+ - '--command=format'
122
+ - '--keywords=last_commit'
123
+ - '--tags=ruby,erb'
124
+
125
+ # The real core of the configuration for each individual tool.
126
+ tools:
127
+ <tool_key>: # Required. ex. 'rubocop', 'bundler-audit', etc.
128
+ status: <:enabled, :disabled, :solo> # Optional. Tools are enabled by default
129
+ name: # Optional. Defaults to <tool_key> capitalized
130
+ description: # Optional. Remind folks of the specific task this tool performs.
131
+ tags: [one, two, three] # Optional. For running groups of commands.
132
+ batch: # Optional. Only used if run in batch mode. ex. Run ruby commands on one thread and yarn commands on another.
133
+ install_behavior: <:auto, :guidance> # Optional. Defaults to Reviewer default.
134
+ failure_behavior: <:continue, :fast, :informative> # Optional
135
+ links:
136
+ home:
137
+ repo:
138
+ support:
139
+ install:
140
+ usage:
141
+ options:
142
+ syntax:
143
+ ignore:
144
+ disable:
145
+ files_syntax:
146
+ flag:
147
+ separator:
148
+ quotes:
149
+ shared_options: # Optional. Used for all commands.
150
+ prefix: 'bundle exec'
151
+ stale: <hours>
152
+ base: '<command>'
153
+ quiet: '--quiet'
154
+ max_exit_status:
155
+ flags:
156
+ <flag>: '<value>'
157
+ env:
158
+ <env_var>: '<value>'
159
+ raw:
160
+ - '<value>'
161
+ commands:
162
+ install:
163
+ desc:
164
+ stale:
165
+ prefix:
166
+ base:
167
+ quiet:
168
+ max_exit_status:
169
+ flags:
170
+ env:
171
+ raw:
172
+ prepare:
173
+ desc:
174
+ stale:
175
+ prefix:
176
+ base:
177
+ quiet:
178
+ max_exit_status:
179
+ flags:
180
+ env:
181
+ raw:
182
+ review:
183
+ desc:
184
+ stale:
185
+ prefix:
186
+ base:
187
+ quiet:
188
+ max_exit_status:
189
+ flags:
190
+ env:
191
+ raw:
192
+ format:
193
+ desc:
194
+ stale:
195
+ prefix:
196
+ base:
197
+ quiet:
198
+ max_exit_status:
199
+ flags:
200
+ env:
201
+ raw:
202
+ serve:
203
+ desc:
204
+ stale:
205
+ prefix:
206
+ base:
207
+ quiet:
208
+ max_exit_status:
209
+ flags:
210
+ env:
211
+ raw:
212
+ generate:
213
+ desc:
214
+ stale:
215
+ prefix:
216
+ base:
217
+ quiet:
218
+ max_exit_status:
219
+ flags:
220
+ env:
221
+ raw:
data/.reviewer.yml CHANGED
@@ -1,33 +1,42 @@
1
1
  bundle_audit:
2
2
  name: Bundle Audit
3
3
  description: Review Gem Dependencies for Security Issues
4
- tags: [critical, dependencies, ruby, dev]
4
+ tags: [critical, security, dependencies, ruby, dev]
5
5
  links:
6
6
  home: https://github.com/rubysec/bundler-audit
7
7
  install: https://github.com/rubysec/bundler-audit#install
8
8
  commands:
9
- install: 'bundle exec gem install bundler-audit'
10
- prepare: 'bundle exec bundle-audit update'
11
- review: 'bundle exec bundle-audit check --no-update'
12
- quiet_option: '--quiet'
9
+ install: "bundle exec gem install bundler-audit"
10
+ prepare: "bundle exec bundle-audit update"
11
+ review: "bundle exec bundle-audit check --no-update"
13
12
 
14
13
  tests:
15
14
  name: Minitest
16
15
  description: Unit Tests & Coverage
17
16
  tags: [ruby, tests, dev]
17
+ summary:
18
+ pattern: '(\d+)\s+tests?'
19
+ label: '\1 tests'
18
20
  links:
19
21
  home:
20
22
  commands:
21
- review: "bundle exec rake TESTOPTS='--seed=$SEED'"
22
- quiet_option: '--silent'
23
+ review: "bundle exec rake"
24
+ files:
25
+ review: "bundle exec ruby -Itest"
26
+ flag: ""
27
+ separator: " "
28
+ pattern: "*_test.rb"
29
+ map_to_tests: "minitest"
23
30
  reports:
24
31
  open_on_fail: true
25
32
  local_file: coverage/index.html
26
- local_uri: 'file:///Users/garrettdimon/Code/reviewer/coverage/index.html#_AllFiles'
33
+ local_uri: "file:///Users/garrettdimon/Code/reviewer/coverage/index.html#_AllFiles"
27
34
  env:
28
- coverage: true
35
+ testopts: --seed=$SEED
36
+ # coverage: false
29
37
 
30
38
  reek:
39
+ # skip_in_batch: true # Reek provides guidance and is generally run solo
31
40
  name: Reek
32
41
  description: Examine Ruby Classes for Code Smells
33
42
  tags: [ruby, quality, dev]
@@ -35,14 +44,18 @@ reek:
35
44
  home: https://github.com/troessner/reek
36
45
  install: https://github.com/troessner/reek#quickstart
37
46
  commands:
38
- install: 'bundle exec gem install reek'
39
- review: 'bundle exec reek'
47
+ install: "bundle exec gem install reek"
48
+ review: "bundle exec reek --config .reek.yml lib/"
49
+ files:
50
+ flag: ""
51
+ separator: " "
52
+ pattern: "*.rb"
40
53
  flags:
41
54
  color:
42
55
  documentation:
43
56
 
44
57
  flog:
45
- disabled: true # Flog provides guidance and is generally run solo
58
+ # skip_in_batch: true # Flog provides guidance and is generally run solo
46
59
  name: Flog
47
60
  description: Reports your most tortured ruby code in an easy to read pain report.
48
61
  tags: [ruby, quality, dev]
@@ -50,15 +63,15 @@ flog:
50
63
  home: https://ruby.sadi.st/Flog.html
51
64
  install: https://ruby.sadi.st/Flog.html
52
65
  commands:
53
- install: 'bundle exec gem install flog'
54
- review: 'bundle exec flog -g lib'
66
+ install: "bundle exec gem install flog"
67
+ review: "bundle exec flog -g lib"
55
68
  flags:
56
69
  threshold: 10 # Percentage. i.e. Show the most concerning 10% of results
57
70
  group:
58
71
  methods-only:
59
72
 
60
73
  flay:
61
- disabled: true # Flay provides guidance and is generally run solo
74
+ # skip_in_batch: true # Flay provides guidance and is generally run solo
62
75
  name: Flay
63
76
  description: Review ruby code for structural similarities and refactoring opportunities.
64
77
  tags: [ruby, quality, dev]
@@ -66,38 +79,188 @@ flay:
66
79
  home: https://ruby.sadi.st/Flay.html
67
80
  install: https://ruby.sadi.st/Flay.html
68
81
  commands:
69
- install: 'bundle exec gem install flay'
70
- review: 'bundle exec flay ./lib'
82
+ install: "bundle exec gem install flay"
83
+ review: "bundle exec flay ./lib"
71
84
  flags:
72
85
  liberal:
73
86
  summary:
74
87
 
75
-
76
88
  rubocop:
77
89
  name: Rubocop
78
90
  description: Review Ruby Syntax & Formatting for Consistency
79
- tags: [ruby, syntax]
91
+ tags: [ruby, syntax, dev]
92
+ summary:
93
+ pattern: '(\d+)\s+offenses?'
94
+ label: '\1 offenses'
80
95
  links:
81
96
  home: https://rubocop.org
82
97
  install: https://docs.rubocop.org/rubocop/1.13/installation.html
83
98
  ignore_syntax: https://docs.rubocop.org/rubocop/configuration.html#ignoredmethods
84
99
  disable_syntax: https://docs.rubocop.org/rubocop/configuration.html#disabling-cops-within-source-code
85
100
  commands:
86
- install: 'bundle exec gem install rubocop'
87
- review: 'bundle exec rubocop --parallel'
88
- format: 'bundle exec rubocop --auto-correct'
89
- quiet_option: '--format q'
90
- files_flag: ''
91
- files_list_separator: ' '
101
+ install: "bundle exec gem install rubocop"
102
+ review: "bundle exec rubocop --parallel"
103
+ format: "bundle exec rubocop --auto-correct"
104
+ files:
105
+ flag: ""
106
+ separator: " "
107
+ pattern: "*.rb"
92
108
  flags:
93
109
  color:
94
110
 
111
+ # The YARD Parser can also come in handy:
112
+ # https://yardoc.org/types
95
113
  inch:
114
+ # skip_in_batch: true
96
115
  tags: [docs, ruby, dev]
97
116
  name: Inch
98
- description: Review Ruby Documentation
117
+ description: Review Ruby Documentation Quality
99
118
  links:
100
119
  home: https://rrrene.org/inch/
120
+ usage: https://www.rubydoc.info/gems/yard/file/docs/Tags.md
121
+ commands:
122
+ install: "bundle exec gem install inch"
123
+ review: "bundle exec inch"
124
+
125
+ yard:
126
+ # skip_in_batch: true
127
+ tags: [docs, ruby, dev]
128
+ name: Yard
129
+ description: Generates Documentation
130
+ links:
131
+ home: https://yardoc.org
132
+ usage: https://www.rubydoc.info/gems/yard/file/docs/GettingStarted.md#using
133
+ install: https://github.com/lsegal/yard#installing
134
+ commands:
135
+ install: "bundle exec gem install yard"
136
+ prepare: "yard doc 'lib/**/*.rb'"
137
+ review: "yard stats"
138
+ serve: "yard server --reload && open http://0.0.0.0:8808"
139
+ generate:
140
+ quiet_flag: "--quiet"
141
+
142
+ alex:
143
+ skip_in_batch: true
144
+ tags: [language, docs]
145
+ name: Alex
146
+ description: Catch insensitive, inconsiderate writing
147
+ links:
148
+ home: https://alexjs.com
149
+ commands:
150
+ install: "yarn global add alex"
151
+ review: "alex ."
152
+
153
+ # New tools for expanded testing coverage
154
+
155
+ brakeman:
156
+ skip_in_batch: true # Requires Rails application, not applicable to gems
157
+ name: Brakeman
158
+ description: Static analysis security scanner for Ruby
159
+ tags: [security, ruby, dev]
160
+ links:
161
+ home: https://brakemanscanner.org
162
+ install: https://brakemanscanner.org/docs/install/
163
+ commands:
164
+ install: "bundle exec gem install brakeman"
165
+ review: "bundle exec brakeman --no-pager -q"
166
+
167
+ fasterer:
168
+ name: Fasterer
169
+ description: Suggest performance improvements for Ruby code
170
+ tags: [ruby, quality, performance, dev]
171
+ links:
172
+ home: https://github.com/DamirSvrtan/fasterer
173
+ commands:
174
+ install: "bundle exec gem install fasterer"
175
+ review: "bundle exec fasterer"
176
+ files:
177
+ flag: ""
178
+ separator: " "
179
+ pattern: "*.rb"
180
+
181
+ debride:
182
+ skip_in_batch: true # Broken on Ruby 3.4 (missing require for Racc, Timeout)
183
+ name: Debride
184
+ description: Find potentially unused methods and classes
185
+ tags: [ruby, quality, dev]
186
+ links:
187
+ home: https://github.com/seattlerb/debride
188
+ commands:
189
+ install: "bundle exec gem install debride"
190
+ review: "bundle exec debride lib/"
191
+
192
+ rubycritic:
193
+ skip_in_batch: true # Generates HTML reports, best run manually
194
+ name: RubyCritic
195
+ description: Code quality analysis with HTML reports
196
+ tags: [ruby, quality, dev]
197
+ links:
198
+ home: https://github.com/whitesmith/rubycritic
199
+ commands:
200
+ install: "bundle exec gem install rubycritic"
201
+ review: "bundle exec rubycritic lib/ --no-browser -f console"
202
+
203
+ metric_fu:
204
+ skip_in_batch: true # Meta-tool that runs many others, slow
205
+ name: MetricFu
206
+ description: Aggregate code metrics from multiple tools
207
+ tags: [ruby, quality, dev]
208
+ links:
209
+ home: https://github.com/metricfu/metric_fu
210
+ commands:
211
+ install: "bundle exec gem install metric_fu"
212
+ review: "bundle exec metric_fu"
213
+
214
+ yardstick:
215
+ # skip_in_batch: true # Documentation coverage measurement
216
+ name: Yardstick
217
+ description: Measure YARD documentation coverage
218
+ tags: [docs, ruby, dev]
219
+ links:
220
+ home: https://github.com/dkubb/yardstick
221
+ commands:
222
+ install: "bundle exec gem install yardstick"
223
+ review: "bundle exec yardstick lib/"
224
+
225
+ standard:
226
+ skip_in_batch: true # Conflicts with existing RuboCop configuration
227
+ name: Standard
228
+ description: Zero-configuration Ruby linter
229
+ tags: [ruby, syntax, dev]
230
+ links:
231
+ home: https://github.com/standardrb/standard
232
+ commands:
233
+ install: "bundle exec gem install standard"
234
+ review: "bundle exec standardrb"
235
+ format: "bundle exec standardrb --fix"
236
+
237
+ rufo:
238
+ skip_in_batch: true # Alternative formatter to RuboCop
239
+ name: Rufo
240
+ description: Ruby code formatter
241
+ tags: [ruby, syntax, dev]
242
+ links:
243
+ home: https://github.com/ruby-formatter/rufo
244
+ commands:
245
+ install: "bundle exec gem install rufo"
246
+ review: "bundle exec rufo --check lib/"
247
+ format: "bundle exec rufo lib/"
248
+
249
+ license_finder:
250
+ skip_in_batch: true # Slow - run manually with: rvw license_finder
251
+ name: License Finder
252
+ description: Check dependency licenses for compliance
253
+ tags: [dependencies, compliance, slow, dev]
254
+ links:
255
+ home: https://github.com/pivotal/LicenseFinder
256
+ commands:
257
+ install: "bundle exec gem install license_finder"
258
+ review: "bundle exec license_finder --decisions-file=./dependency_decisions.yml"
259
+
260
+ notes:
261
+ name: Notes
262
+ description: Find TODO, FIXME, HACK, and OPTIMIZE comments
263
+ tags: [quality, dev]
101
264
  commands:
102
- install: 'bundle exec gem install inch'
103
- review: 'bundle exec inch'
265
+ review: "grep -rn --include='*.rb' -E '(TODO|FIXME|HACK|OPTIMIZE|XXX):?' lib/ test/ || true"
266
+ max_exit_status: 1
data/.reviewer_stdout ADDED
Binary file
data/.rubocop.yml CHANGED
@@ -1,5 +1,7 @@
1
1
  AllCops:
2
+ TargetRubyVersion: 3.2
2
3
  NewCops: enable
4
+ SuggestExtensions: false
3
5
  UseCache: true
4
6
  CacheRootDirectory: './'
5
7
  Exclude:
@@ -11,9 +13,40 @@ Layout/LineLength:
11
13
 
12
14
  # One case statement in a single method isn't complex.
13
15
  Metrics/CyclomaticComplexity:
14
- IgnoredMethods: ['case']
16
+ AllowedMethods: ['case']
17
+
18
+ # Development dependencies in gemspec is fine for this gem
19
+ Gemspec/DevelopmentDependencies:
20
+ Enabled: false
21
+
22
+ # Keyword arguments are self-documenting at call sites, so they don't
23
+ # create the readability problem that long positional lists do.
24
+ Metrics/ParameterLists:
25
+ CountKeywordArgs: false
26
+
27
+ # The CLI entry point is a routing method with one guard clause per line.
28
+ # Each branch is a single method call — the structure is as clear as it gets.
29
+ Metrics/AbcSize:
30
+ AllowedMethods: ['handle_early_exits']
15
31
 
16
32
  # 10 is a good goal but a little draconian
17
33
  Metrics/MethodLength:
18
34
  CountAsOne: ['array', 'hash', 'heredoc']
19
35
  Max: 15
36
+
37
+ # Test classes naturally grow with coverage (see test/.rubocop.yml for higher limit)
38
+ Metrics/ClassLength:
39
+ CountAsOne: ['array', 'hash', 'heredoc']
40
+ Max: 150
41
+
42
+ Metrics/ModuleLength:
43
+ CountAsOne: ['array', 'hash', 'heredoc']
44
+ Max: 150
45
+
46
+ # Fasterer prefers yield over block.call for performance
47
+ Style/ExplicitBlockArgument:
48
+ Enabled: false
49
+
50
+ # Fasterer prefers fetch with block over second argument for performance
51
+ Style/RedundantFetchBlock:
52
+ Enabled: false
data/CHANGELOG.md CHANGED
@@ -1,7 +1,47 @@
1
1
  ## [Unreleased]
2
2
 
3
- - TODO: Improve and streamline installation
4
- - TODO: Add support for targeting specific files
3
+ ## [1.0.0] - 2026-02-03
4
+
5
+ ### Added
6
+ - Git-aware file targeting: `staged`, `unstaged`, `modified`, `untracked` keywords resolve files from git status and pass only relevant files to each tool
7
+ - `failed` keyword: re-run only tools that failed in the previous run, scoped to their failed files
8
+ - `--json` / `-j` flag for structured JSON output (CI, scripting, agent integration)
9
+ - `--raw` / `-r` flag to force passthrough output (bypasses capturing)
10
+ - `--format` flag with streaming, summary, and json modes
11
+ - `--capabilities` / `-c` flag for agent discovery (outputs JSON describing tools, keywords, scenarios)
12
+ - `skip_in_batch` config option: exclude tools from `rvw` while keeping them available via `rvw tool_name`
13
+ - `files.pattern` config: glob pattern to filter which files are passed to each tool
14
+ - `files.map_to_tests` config: map source files to test files (`minitest` or `rspec` conventions)
15
+ - `files.review` / `files.format` config: alternative commands when files are scoped
16
+ - First-run experience: interactive setup when no `.reviewer.yml` exists
17
+ - `rvw init` command: auto-detect tools from Gemfile.lock and generate `.reviewer.yml`
18
+ - `rvw doctor` command: diagnostics for configuration, tools, keywords, and environment
19
+ - Keyword resolution summary: preview which tools and files will run before execution
20
+ - Spell-check suggestions for mistyped keywords
21
+ - Auto-detection catalog: bundler-audit, rubocop, standard, reek, flog, flay, brakeman, fasterer, minitest, rspec, eslint, prettier, stylelint, typescript, biome
22
+ - Progress bar for captured output with timing estimates
23
+ - PTY-based streaming capture for failed file extraction from single-tool runs
24
+
25
+ ### Fixed
26
+ - Console width returns default in piped/CI contexts instead of 0
27
+ - `rvw failed` no longer crashes on empty tag objects
28
+ - MIT license restored in LICENSE.txt
29
+ - `--help` and `--version` exit immediately instead of running tool suite
30
+ - Valid JSON emitted for early exits (no matching tools, no files)
31
+
32
+ ### Changed
33
+ - **Ruby 3.2+ required** (supports 3.2, 3.3, 3.4, and 4.0)
34
+ - Architecture refactor: full dependency injection, no global state in business logic
35
+ - Output decomposed into domain formatters (Runner, Batch, Session, Doctor, Setup, Report)
36
+ - Session class owns run lifecycle; Reviewer module is pure wiring
37
+ - Context struct threads shared dependencies through the call stack
38
+ - Tool timing extracted to Tool::Timing collaborator with injected history
39
+ - Result interpretation separated from Runner execution (Result.from_runner)
40
+ - Tests no longer depend on global state or require reset between runs
41
+ - Redesigned output: compact `↳ command` format, `✓ ~Xs` checkmark summaries
42
+ - ANSI color output guarded for TTY (clean output in CI and pipes)
43
+ - README rewritten with installation, usage, configuration, and workflow documentation
44
+ - `disabled` config key deprecated in favor of `skip_in_batch`
5
45
 
6
46
  ## [0.1.4] - 2021-07-08
7
47
 
data/Gemfile CHANGED
@@ -5,4 +5,42 @@ source 'https://rubygems.org'
5
5
  # Specify your gem's dependencies in reviewer.gemspec
6
6
  gemspec
7
7
 
8
- gem 'rake', '~> 13.0'
8
+ gem 'rake', '~> 13.2'
9
+
10
+ # Security auditing - always run in CI
11
+ gem 'bundler-audit'
12
+
13
+ # Self-review tools - not required for running tests
14
+ # Install with: bundle config set --local with lint && bundle install
15
+ group :lint, optional: true do
16
+ # Ruby 3.4+ requires explicit racc (no longer a default gem)
17
+ gem 'racc'
18
+
19
+ # Style & Linting
20
+ gem 'rubocop'
21
+ gem 'rubocop-minitest'
22
+ gem 'rubocop-rake'
23
+ gem 'standard', '>= 1.35.1'
24
+
25
+ # Code Quality & Complexity
26
+ gem 'debride'
27
+ gem 'fasterer'
28
+ gem 'flay'
29
+ gem 'flog'
30
+ gem 'metric_fu'
31
+ gem 'reek'
32
+ gem 'rubycritic'
33
+
34
+ # Security
35
+ gem 'brakeman'
36
+
37
+ # Documentation
38
+ gem 'inch'
39
+ gem 'yardstick'
40
+
41
+ # Formatting
42
+ gem 'rufo'
43
+
44
+ # Compliance
45
+ gem 'license_finder'
46
+ end