reviewer 1.0.0 → 1.1.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/.reviewer.example.yml +37 -39
- data/CHANGELOG.md +39 -0
- data/README.md +27 -264
- data/docs/CONTRIBUTING.md +60 -0
- data/docs/README.md +20 -0
- data/docs/configuration.md +182 -0
- data/docs/getting-started.md +179 -0
- data/docs/recipes.md +91 -0
- data/docs/usage.md +216 -0
- data/lib/reviewer/arguments/keywords.rb +19 -3
- data/lib/reviewer/arguments/options.rb +35 -0
- data/lib/reviewer/arguments.rb +3 -25
- data/lib/reviewer/batch/formatter.rb +10 -0
- data/lib/reviewer/batch.rb +13 -14
- data/lib/reviewer/capabilities.rb +23 -5
- data/lib/reviewer/command/string.rb +8 -6
- data/lib/reviewer/command.rb +1 -1
- data/lib/reviewer/configuration/loader.rb +13 -1
- data/lib/reviewer/doctor/config_check.rb +22 -11
- data/lib/reviewer/doctor/discovery_check.rb +85 -0
- data/lib/reviewer/doctor/environment_check.rb +19 -9
- data/lib/reviewer/doctor/formatter.rb +123 -29
- data/lib/reviewer/doctor/report.rb +96 -4
- data/lib/reviewer/doctor/tool_inventory.rb +24 -7
- data/lib/reviewer/doctor.rb +13 -5
- data/lib/reviewer/report/formatter.rb +28 -18
- data/lib/reviewer/report.rb +59 -15
- data/lib/reviewer/runner/result.rb +103 -25
- data/lib/reviewer/runner/strategies/captured.rb +2 -2
- data/lib/reviewer/session/formatter.rb +21 -0
- data/lib/reviewer/session.rb +49 -33
- data/lib/reviewer/setup/catalog.rb +14 -3
- data/lib/reviewer/setup/detector.rb +34 -11
- data/lib/reviewer/setup.rb +4 -1
- data/lib/reviewer/shell/timer.rb +2 -2
- data/lib/reviewer/tool/file_resolver.rb +14 -5
- data/lib/reviewer/tool/settings.rb +4 -2
- data/lib/reviewer/tool.rb +5 -2
- data/lib/reviewer/tools.rb +3 -3
- data/lib/reviewer/version.rb +1 -1
- data/lib/reviewer.rb +11 -7
- data/reviewer.gemspec +11 -6
- metadata +11 -25
- data/.alexignore +0 -1
- data/.flayignore +0 -1
- data/.github/FUNDING.yml +0 -3
- data/.github/workflows/main.yml +0 -94
- data/.github/workflows/release.yml +0 -98
- data/.gitignore +0 -13
- data/.inch.yml +0 -6
- data/.reek.yml +0 -175
- data/.reviewer.future.yml +0 -221
- data/.reviewer.yml +0 -266
- data/.reviewer_stdout +0 -0
- data/.rubocop.yml +0 -52
- data/Gemfile +0 -46
- data/Gemfile.lock +0 -340
- data/RELEASING.md +0 -190
- data/Rakefile +0 -129
- data/bin/console +0 -15
- data/bin/setup +0 -8
- data/dependency_decisions.yml +0 -61
- data/lib/reviewer/doctor/opportunity_check.rb +0 -88
- data/structure.svg +0 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 8d918dfc0f53f9d2283d846207fc760f0aa0cafaa2d9db0f2225396935cdbd38
|
|
4
|
+
data.tar.gz: 2f8635ce31fee7646608c5dd591c277190e918b3c940b773d04731254c3ea707
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: fc770176795e88d1c88e56903eb1ce3d756f0f46176edc1d1a280bff14069b0739a27a4aefa6ca04313c08f1324e3f9d45da86860c9563c97f7a82472005f7ca
|
|
7
|
+
data.tar.gz: dbfdb47cbc0c321bc2338251b4a16242d976d4b6fb893019e7dc5578d875bfc85ef4124297864fa50cbe52cf7189471e6fc2ece940e114cf92fe8ab0e429e369
|
data/.reviewer.example.yml
CHANGED
|
@@ -1,43 +1,38 @@
|
|
|
1
|
-
#
|
|
2
|
-
# It can be handy to leave this section in your configuration file as a convenient reference.
|
|
1
|
+
# Copy the settings a tool needs into `.reviewer.yml`. Only `commands.review` is required.
|
|
3
2
|
#
|
|
4
|
-
# <
|
|
5
|
-
# skip_in_batch: true
|
|
6
|
-
#
|
|
7
|
-
#
|
|
8
|
-
#
|
|
9
|
-
# tags: [ruby, dependencies] // Optional. Lets you run commands tagged with the same word.
|
|
3
|
+
# <tool-key>:
|
|
4
|
+
# skip_in_batch: true # Exclude from bare `rvw`; keep available by key.
|
|
5
|
+
# name: # Defaults to the tool key.
|
|
6
|
+
# description:
|
|
7
|
+
# tags: [ruby, dependencies]
|
|
10
8
|
# links:
|
|
11
|
-
# home:
|
|
12
|
-
# install:
|
|
13
|
-
#
|
|
14
|
-
#
|
|
15
|
-
# disable_syntax: // Optional. A link to the syntax for disabling entire rules for a tool.
|
|
9
|
+
# home:
|
|
10
|
+
# install:
|
|
11
|
+
# ignore_syntax: # Shown after review failures.
|
|
12
|
+
# disable_syntax: # Shown after review failures.
|
|
16
13
|
# commands:
|
|
17
|
-
# install:
|
|
18
|
-
# prepare:
|
|
19
|
-
# review:
|
|
20
|
-
# format:
|
|
21
|
-
#
|
|
22
|
-
# generate: // Optional. Command to generate artifacts from the tool for viewing separately.
|
|
23
|
-
# max_exit_status: // Optional, defaults to 0. Some tools like Yarn Audit essentially won't return less than a 3. This specifies the threshold that's still considered passing.
|
|
14
|
+
# install: # Displayed as guidance; never executed.
|
|
15
|
+
# prepare: # Attempted at most once every six hours, regardless of exit status.
|
|
16
|
+
# review: # Required.
|
|
17
|
+
# format: # Used by `fmt`.
|
|
18
|
+
# max_exit_status: # Defaults to 0 for review commands.
|
|
24
19
|
# files:
|
|
25
|
-
#
|
|
26
|
-
#
|
|
27
|
-
#
|
|
28
|
-
#
|
|
29
|
-
#
|
|
30
|
-
#
|
|
31
|
-
#
|
|
32
|
-
#
|
|
33
|
-
#
|
|
34
|
-
#
|
|
35
|
-
#
|
|
36
|
-
#
|
|
37
|
-
#
|
|
20
|
+
# review: # Replaces `commands.review` for targeted files.
|
|
21
|
+
# format: # Replaces `commands.format` for targeted files.
|
|
22
|
+
# flag: # Defaults to an empty string for bare paths.
|
|
23
|
+
# separator: # Defaults to one space.
|
|
24
|
+
# pattern: # Slashless patterns match basenames; slashes match repository paths.
|
|
25
|
+
# map_to_tests: # `minitest` or `rspec`.
|
|
26
|
+
# env:
|
|
27
|
+
# key: value
|
|
28
|
+
# flags: # Applied only to review commands.
|
|
29
|
+
# verbose:
|
|
30
|
+
# summary:
|
|
31
|
+
# pattern:
|
|
32
|
+
# label: # Supports numbered captures.
|
|
38
33
|
|
|
39
34
|
|
|
40
|
-
#
|
|
35
|
+
# Complete supported example:
|
|
41
36
|
tool-name-key:
|
|
42
37
|
skip_in_batch: true
|
|
43
38
|
name: Tool
|
|
@@ -49,20 +44,23 @@ tool-name-key:
|
|
|
49
44
|
ignore_syntax: https://example.com/ignore
|
|
50
45
|
disable_syntax: https://example.com/disable
|
|
51
46
|
commands:
|
|
52
|
-
install: 'bundle install tool'
|
|
47
|
+
install: 'bundle exec gem install tool'
|
|
53
48
|
prepare: 'bundle exec tool update'
|
|
54
49
|
review: 'bundle exec tool'
|
|
55
50
|
format: 'bundle exec tool --format'
|
|
56
51
|
max_exit_status: 1
|
|
57
52
|
files:
|
|
58
|
-
|
|
53
|
+
review: 'bundle exec tool --files'
|
|
54
|
+
format: 'bundle exec tool --format --files'
|
|
55
|
+
flag: ''
|
|
59
56
|
separator: ','
|
|
60
|
-
pattern: '
|
|
57
|
+
pattern: '{lib,test}/**/*.rb'
|
|
61
58
|
map_to_tests: minitest
|
|
62
59
|
env:
|
|
63
60
|
report: false
|
|
64
61
|
flags:
|
|
65
62
|
format: json
|
|
66
63
|
verbose:
|
|
67
|
-
|
|
68
|
-
|
|
64
|
+
summary:
|
|
65
|
+
pattern: '(\d+) issues?'
|
|
66
|
+
label: '\1 issues'
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,44 @@
|
|
|
1
1
|
## [Unreleased]
|
|
2
2
|
|
|
3
|
+
## [1.1.0] - 2026-08-28
|
|
4
|
+
|
|
5
|
+
Reviewer 1.1 makes review outcomes more precise and dependable for people and automated consumers.
|
|
6
|
+
Every tool result now has an authoritative state, aggregate summaries account for every outcome, and
|
|
7
|
+
schema-versioned JSON exposes complete run details without requiring agents or integrations to parse
|
|
8
|
+
human-readable output or infer meaning from a success boolean.
|
|
9
|
+
|
|
10
|
+
File-scoped runs now select valid files for each tool independently and preserve failed-review
|
|
11
|
+
history across non-review runs. Structured Doctor reports make setup and diagnostics inspectable by
|
|
12
|
+
people and agents, while `rvw init` begins its transition toward explicit, project-owned
|
|
13
|
+
configuration.
|
|
14
|
+
|
|
15
|
+
### Upgrade notes
|
|
16
|
+
- Unknown positional and `-t` selectors now stop before running tools and exit 2. Check scripts that relied on an unknown selector falling through to a batch run.
|
|
17
|
+
- Reviewer now exits 0 for a successful review, 1 for a failed review, and 2 for an invocation error instead of forwarding a tool's exit status.
|
|
18
|
+
- Skipped results now report `state: "skipped"`, `success: false`, and null execution fields. Integrations should use `state` to interpret each result.
|
|
19
|
+
- `rvw init` remains available with its existing generation behavior for one deprecation cycle, but now prints a warning. Use `rvw doctor` to inspect project discoveries before creating or editing `.reviewer.yml`; existing configurations require no migration.
|
|
20
|
+
|
|
21
|
+
### Added
|
|
22
|
+
- Top-level tags and the `failed` keyword to the capabilities payload
|
|
23
|
+
- Schema-versioned JSON with authoritative result states, complete state totals, empty and error envelopes, and tool-provided `detail_summary` values
|
|
24
|
+
- Structured Doctor output for configuration findings, configured tools, project discoveries, environment checks, and summary totals
|
|
25
|
+
- Repository-relative and brace-alternative matching for `files.pattern`
|
|
26
|
+
|
|
27
|
+
### Changed
|
|
28
|
+
- Moved long-form guidance into version-controlled repository documentation; setup output and gem metadata now link to it
|
|
29
|
+
- Doctor separates configured tools from sourced project discoveries in human and JSON reports
|
|
30
|
+
- `rvw init` now prints a deprecation warning directing setup work through `rvw doctor`
|
|
31
|
+
- `rvw failed` preserves the last executed review across skipped tools, missing tools, formatting runs, and fail-fast tails; a successful retry clears the failure
|
|
32
|
+
- File targeting applies each tool's scope independently, supports mixed file types, filters nonexistent paths, and passes shell-sensitive filenames without interpretation
|
|
33
|
+
- Development dependencies are separated from optional dogfood tools; `bin/setup` enables the local dogfood bundle group
|
|
34
|
+
|
|
35
|
+
### Fixed
|
|
36
|
+
- `rvw init` generates a configuration instead of exiting with an `ArgumentError` backtrace
|
|
37
|
+
- Generated Reek configuration now distinguishes full-project and file-scoped review commands
|
|
38
|
+
- Generated Minitest configuration now executes every file in a scoped review
|
|
39
|
+
- Result summaries now total every state accurately and avoid claiming all-missing runs passed
|
|
40
|
+
- Recognized empty JSON requests now return a documented envelope instead of no output
|
|
41
|
+
|
|
3
42
|
## [1.0.0] - 2026-02-03
|
|
4
43
|
|
|
5
44
|
### Added
|
data/README.md
CHANGED
|
@@ -6,15 +6,17 @@ Frictionless code quality.
|
|
|
6
6
|
[](https://codecov.io/gh/garrettdimon/reviewer)
|
|
7
7
|
[](https://rubygems.org/gems/reviewer)
|
|
8
8
|
|
|
9
|
-
Reviewer wraps your code quality tools — tests, linters, security audits, formatters — into a single
|
|
9
|
+
Reviewer wraps your code quality tools — tests, linters, security audits, formatters — into a single
|
|
10
|
+
command with a consistent interface. Configure once, run everywhere.
|
|
10
11
|
|
|
11
|
-
Reviewer works with any command-line tool but is built for Ruby projects.
|
|
12
|
+
Reviewer works with any command-line tool but is built for Ruby projects. Doctor can inspect a
|
|
13
|
+
project for known tool signals, and file mapping supports Minitest and RSpec conventions.
|
|
12
14
|
|
|
13
15
|
## Before & After
|
|
14
16
|
|
|
15
17
|
**Before** — five separate commands, each with their own flags:
|
|
16
18
|
|
|
17
|
-
```
|
|
19
|
+
```console
|
|
18
20
|
bundle exec bundle-audit check --no-update
|
|
19
21
|
bundle exec rake test
|
|
20
22
|
bundle exec rubocop --parallel
|
|
@@ -24,11 +26,11 @@ bundle exec reek lib/
|
|
|
24
26
|
|
|
25
27
|
**After:**
|
|
26
28
|
|
|
27
|
-
```
|
|
29
|
+
```console
|
|
28
30
|
rvw
|
|
29
31
|
```
|
|
30
32
|
|
|
31
|
-
```
|
|
33
|
+
```text
|
|
32
34
|
Bundle Audit Review Gem Dependencies for Security Issues
|
|
33
35
|
↳ bundle exec bundle-audit check --no-update
|
|
34
36
|
Success 0.8s
|
|
@@ -46,281 +48,42 @@ Success 1.1s
|
|
|
46
48
|
|
|
47
49
|
## Install & Setup
|
|
48
50
|
|
|
49
|
-
|
|
50
|
-
gem install reviewer
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
Or add to your Gemfile:
|
|
51
|
+
Reviewer requires Ruby 3.2 or newer.
|
|
54
52
|
|
|
55
|
-
```
|
|
56
|
-
gem
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
**Requires Ruby 3.2+**
|
|
60
|
-
|
|
61
|
-
Then auto-generate `.reviewer.yml` from your `Gemfile.lock`:
|
|
62
|
-
|
|
63
|
-
```bash
|
|
64
|
-
rvw init
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
```
|
|
68
|
-
Created .reviewer.yml
|
|
69
|
-
|
|
70
|
-
Detected tools:
|
|
71
|
-
Bundle Audit bundler-audit in Gemfile.lock
|
|
72
|
-
RuboCop rubocop in Gemfile.lock, .rubocop.yml
|
|
73
|
-
Minitest minitest in Gemfile.lock, test/ directory
|
|
74
|
-
|
|
75
|
-
Configure further: https://github.com/garrettdimon/reviewer#configuration
|
|
76
|
-
Run `rvw` to review your code.
|
|
53
|
+
```console
|
|
54
|
+
gem install reviewer
|
|
55
|
+
rvw doctor
|
|
77
56
|
```
|
|
78
57
|
|
|
79
|
-
|
|
58
|
+
Use Doctor's configured-tool inventory and project discoveries to write the commands the project
|
|
59
|
+
owns in `.reviewer.yml`, then inspect and run them:
|
|
80
60
|
|
|
81
|
-
```
|
|
61
|
+
```console
|
|
62
|
+
rvw doctor
|
|
82
63
|
rvw
|
|
83
64
|
```
|
|
84
65
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
### Run a single tool without remembering its flags
|
|
88
|
-
|
|
89
|
-
```bash
|
|
90
|
-
rvw rubocop
|
|
91
|
-
```
|
|
92
|
-
|
|
93
|
-
Instead of `bundle exec rubocop --parallel`, use the YAML key. Reviewer applies your configured flags and options automatically.
|
|
94
|
-
|
|
95
|
-
### Run a subset of tools by tag
|
|
96
|
-
|
|
97
|
-
```bash
|
|
98
|
-
rvw security
|
|
99
|
-
```
|
|
100
|
-
|
|
101
|
-
Instead of maintaining lists of which tools to run in which context, tag them in `.reviewer.yml` and filter on the fly:
|
|
102
|
-
|
|
103
|
-
```
|
|
104
|
-
rvw security ─── bundle-audit check --no-update
|
|
105
|
-
└── brakeman --no-pager -q
|
|
106
|
-
```
|
|
107
|
-
|
|
108
|
-
Tags work as positional args or with `-t ruby`. Tag ideas: language (`ruby`, `css`), purpose (`security`, `syntax`), speed (`fast`, `slow`), context (`ci`, `pr`).
|
|
66
|
+
Or add `gem 'reviewer'` to the project's `Gemfile` before running `bundle install`.
|
|
109
67
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
```bash
|
|
113
|
-
rvw staged
|
|
114
|
-
```
|
|
115
|
-
|
|
116
|
-
Instead of figuring out each tool's syntax for targeting files, use a keyword. Reviewer resolves git status, filters by each tool's file pattern, maps source files to test files, and applies each tool's file-passing syntax:
|
|
117
|
-
|
|
118
|
-
```
|
|
119
|
-
rvw staged ─── rubocop lib/reviewer.rb lib/reviewer/batch.rb
|
|
120
|
-
├── rake test TEST=test/reviewer_test.rb test/reviewer/batch_test.rb
|
|
121
|
-
└── fasterer lib/reviewer.rb lib/reviewer/batch.rb
|
|
122
|
-
```
|
|
123
|
-
|
|
124
|
-
One command. Three tools. Each gets only its relevant files in its expected format.
|
|
125
|
-
|
|
126
|
-
Also: `unstaged`, `modified`, `untracked`.
|
|
127
|
-
|
|
128
|
-
### Target specific files
|
|
129
|
-
|
|
130
|
-
```bash
|
|
131
|
-
rvw -f app/models/user.rb,test/models/user_test.rb
|
|
132
|
-
```
|
|
133
|
-
|
|
134
|
-
Pass files once. Reviewer handles whether the tool expects a flag, a bare path, or something else.
|
|
135
|
-
|
|
136
|
-
### Re-run only what failed
|
|
137
|
-
|
|
138
|
-
```bash
|
|
139
|
-
rvw failed
|
|
140
|
-
```
|
|
141
|
-
|
|
142
|
-
Reviewer tracks which tools failed. Fix the issue, re-run only those.
|
|
143
|
-
|
|
144
|
-
### Combine everything
|
|
145
|
-
|
|
146
|
-
```bash
|
|
147
|
-
rvw rubocop staged
|
|
148
|
-
rvw -t ruby modified
|
|
149
|
-
rvw tests -f test/models/user_test.rb
|
|
150
|
-
```
|
|
151
|
-
|
|
152
|
-
Tools, tags, keywords, and files compose naturally.
|
|
153
|
-
|
|
154
|
-
### Auto-fix with formatters
|
|
155
|
-
|
|
156
|
-
```bash
|
|
157
|
-
fmt
|
|
158
|
-
fmt rubocop staged
|
|
159
|
-
```
|
|
160
|
-
|
|
161
|
-
Same interface as `rvw`, but runs the `format` command for each tool. Only tools with a `format` command configured will run.
|
|
162
|
-
|
|
163
|
-
### Output formats
|
|
164
|
-
|
|
165
|
-
| Flag | Format | Use case |
|
|
166
|
-
|------|--------|----------|
|
|
167
|
-
| _(default)_ | Streaming | Development — see output as it runs |
|
|
168
|
-
| `--format summary` | Summary | Quick pass/fail with timing per tool |
|
|
169
|
-
| `-j` / `--json` | JSON | CI, scripting, agent integration |
|
|
170
|
-
| `-r` / `--raw` | Raw | Force direct output, no capturing |
|
|
68
|
+
See [Getting started](docs/getting-started.md) for the Doctor-guided setup workflow and first review.
|
|
171
69
|
|
|
172
70
|
## Configuration
|
|
173
71
|
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
The only requirement is a `review` command:
|
|
177
|
-
|
|
178
|
-
```yaml
|
|
179
|
-
rubocop:
|
|
180
|
-
commands:
|
|
181
|
-
review: bundle exec rubocop --parallel
|
|
182
|
-
```
|
|
183
|
-
|
|
184
|
-
### Full example
|
|
185
|
-
|
|
186
|
-
```yaml
|
|
187
|
-
rubocop:
|
|
188
|
-
name: RuboCop
|
|
189
|
-
description: Review Ruby syntax and formatting for consistency
|
|
190
|
-
tags: [ruby, syntax]
|
|
191
|
-
commands:
|
|
192
|
-
install: bundle exec gem install rubocop
|
|
193
|
-
prepare: bundle exec rubocop --regenerate-todo
|
|
194
|
-
review: bundle exec rubocop --parallel
|
|
195
|
-
format: bundle exec rubocop --auto-correct
|
|
196
|
-
files:
|
|
197
|
-
flag: ""
|
|
198
|
-
separator: " "
|
|
199
|
-
pattern: "*.rb"
|
|
200
|
-
map_to_tests: minitest
|
|
201
|
-
links:
|
|
202
|
-
home: https://rubocop.org
|
|
203
|
-
install: https://docs.rubocop.org/rubocop/installation.html
|
|
204
|
-
env:
|
|
205
|
-
RUBOCOP_OPTS: --color
|
|
206
|
-
flags:
|
|
207
|
-
color:
|
|
208
|
-
```
|
|
209
|
-
|
|
210
|
-
### Options reference
|
|
211
|
-
|
|
212
|
-
| Option | Description |
|
|
213
|
-
|--------|-------------|
|
|
214
|
-
| `name` | Display name |
|
|
215
|
-
| `description` | What the tool does |
|
|
216
|
-
| `tags` | Categories for filtering (`[ruby, security]`) |
|
|
217
|
-
| `skip_in_batch` | Set `true` to exclude from `rvw` but still run with `rvw tool_name` |
|
|
218
|
-
| `commands.review` | Command to run for `rvw` **(required)** |
|
|
219
|
-
| `commands.format` | Command to run for `fmt` |
|
|
220
|
-
| `commands.install` | Command to install the tool |
|
|
221
|
-
| `commands.prepare` | Command to run before review (cached 6 hours) |
|
|
222
|
-
| `commands.max_exit_status` | Treat exit codes up to this value as success |
|
|
223
|
-
| `files.review` | Command to use instead of `commands.review` when files are scoped |
|
|
224
|
-
| `files.format` | Command to use instead of `commands.format` when files are scoped |
|
|
225
|
-
| `files.flag` | CLI flag for passing files (empty string = bare paths) |
|
|
226
|
-
| `files.separator` | How to join multiple file paths (default: space) |
|
|
227
|
-
| `files.pattern` | Glob pattern to filter files (e.g., `*.rb`) |
|
|
228
|
-
| `files.map_to_tests` | Map source files to test files (`minitest` or `rspec`) |
|
|
229
|
-
| `links.home` | Project homepage |
|
|
230
|
-
| `links.install` | Installation instructions |
|
|
231
|
-
| `env` | Environment variables to set when running |
|
|
232
|
-
| `flags` | CLI flags to append to the review command |
|
|
233
|
-
|
|
234
|
-
### File-scoped commands
|
|
235
|
-
|
|
236
|
-
Some tools use different commands for running the full suite vs. targeting specific files. Use `files.review` (or `files.format`) to specify an alternative command when files are passed:
|
|
237
|
-
|
|
238
|
-
```yaml
|
|
239
|
-
tests:
|
|
240
|
-
commands:
|
|
241
|
-
review: bundle exec rake test
|
|
242
|
-
files:
|
|
243
|
-
review: bundle exec ruby -Itest
|
|
244
|
-
pattern: "*_test.rb"
|
|
245
|
-
map_to_tests: minitest
|
|
246
|
-
```
|
|
247
|
-
|
|
248
|
-
`rvw` runs `bundle exec rake test` (full suite). `rvw staged` or `rvw tests -f test/models/user_test.rb` runs `bundle exec ruby -Itest` with the resolved files appended. The standard `files.flag` and `files.separator` still apply when appending files to the file-scoped command.
|
|
249
|
-
|
|
250
|
-
### Notes
|
|
251
|
-
|
|
252
|
-
- **Tool ordering** — Tools run in the order they appear in `.reviewer.yml`. Put fast tools first for quicker feedback.
|
|
253
|
-
- **Environment variables** — Use `env` for things like `TESTOPTS: --seed=$SEED`. The `$SEED` placeholder is replaced with a consistent random seed across runs.
|
|
254
|
-
- **Flags** — Keys with no value become boolean flags (`color:` becomes `--color`). Keys with values become `--key value`.
|
|
255
|
-
- **Prepare caching** — The `prepare` command only runs if it hasn't been run in the last 6 hours, saving time on commands like `bundle-audit update`.
|
|
256
|
-
|
|
257
|
-
## Workflows
|
|
258
|
-
|
|
259
|
-
### Pre-commit
|
|
260
|
-
|
|
261
|
-
Review only what you're about to commit:
|
|
262
|
-
|
|
263
|
-
```bash
|
|
264
|
-
rvw staged
|
|
265
|
-
```
|
|
266
|
-
|
|
267
|
-
### Pull request
|
|
72
|
+
See the [configuration reference](docs/configuration.md) for the supported `.reviewer.yml` schema,
|
|
73
|
+
command composition, and file targeting.
|
|
268
74
|
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
```bash
|
|
272
|
-
rvw modified
|
|
273
|
-
```
|
|
274
|
-
|
|
275
|
-
### CI
|
|
276
|
-
|
|
277
|
-
Full review with JSON output for parsing:
|
|
278
|
-
|
|
279
|
-
```bash
|
|
280
|
-
rvw --json
|
|
281
|
-
```
|
|
282
|
-
|
|
283
|
-
Reviewer exits `0` when all tools pass, or with the highest exit status from any failing tool. Skipped and missing tools don't affect the exit code. This means `rvw` works directly as a CI gate — no wrapper script needed.
|
|
284
|
-
|
|
285
|
-
### Development
|
|
286
|
-
|
|
287
|
-
Run the full suite:
|
|
288
|
-
|
|
289
|
-
```bash
|
|
290
|
-
rvw
|
|
291
|
-
```
|
|
292
|
-
|
|
293
|
-
### Hotfix
|
|
294
|
-
|
|
295
|
-
Run just security and tests on changed files:
|
|
296
|
-
|
|
297
|
-
```bash
|
|
298
|
-
rvw -t security modified
|
|
299
|
-
rvw tests modified
|
|
300
|
-
```
|
|
301
|
-
|
|
302
|
-
### After a failure
|
|
303
|
-
|
|
304
|
-
Fix the issue, then re-run only what failed:
|
|
305
|
-
|
|
306
|
-
```bash
|
|
307
|
-
rvw failed
|
|
308
|
-
```
|
|
309
|
-
|
|
310
|
-
## Agent Integration
|
|
311
|
-
|
|
312
|
-
For AI agents and automation tools, use `--capabilities` to discover available tools:
|
|
313
|
-
|
|
314
|
-
```bash
|
|
315
|
-
rvw --capabilities
|
|
316
|
-
```
|
|
75
|
+
## Documentation
|
|
317
76
|
|
|
318
|
-
|
|
77
|
+
- [Documentation index](docs/README.md)
|
|
78
|
+
- [Usage](docs/usage.md)
|
|
79
|
+
- [Recipes](docs/recipes.md)
|
|
80
|
+
- [Contributing](docs/CONTRIBUTING.md)
|
|
81
|
+
- [Ruby API reference](https://www.rubydoc.info/gems/reviewer)
|
|
319
82
|
|
|
320
83
|
## License
|
|
321
84
|
|
|
322
|
-
MIT License — see [LICENSE.txt](LICENSE.txt)
|
|
85
|
+
MIT License — see [LICENSE.txt](LICENSE.txt).
|
|
323
86
|
|
|
324
87
|
## Code of Conduct
|
|
325
88
|
|
|
326
|
-
See [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md)
|
|
89
|
+
See [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md).
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# Contributing to Reviewer
|
|
2
|
+
|
|
3
|
+
Bug reports and pull requests are welcome on [GitHub](https://github.com/garrettdimon/reviewer).
|
|
4
|
+
Participation in the project follows the [Code of Conduct](../CODE_OF_CONDUCT.md).
|
|
5
|
+
|
|
6
|
+
## Project philosophy
|
|
7
|
+
|
|
8
|
+
- Reduce the friction of running multiple code-quality tools.
|
|
9
|
+
- Keep frequent reviews fast and their output focused.
|
|
10
|
+
- Preserve a project's commands and configuration instead of imposing tool policy.
|
|
11
|
+
- Make defaults simple while allowing each project to tune its workflow.
|
|
12
|
+
- Run tools in a predictable order and stop after an actionable failure.
|
|
13
|
+
- Report observations without turning Reviewer into a quality score.
|
|
14
|
+
|
|
15
|
+
## Development setup
|
|
16
|
+
|
|
17
|
+
This guide describes the [repository checkout](https://github.com/garrettdimon/reviewer), not the
|
|
18
|
+
installed gem. The commands below run from a clone.
|
|
19
|
+
|
|
20
|
+
Reviewer requires Ruby 3.2 or newer. Clone the repository, then install the development and dogfood
|
|
21
|
+
dependencies:
|
|
22
|
+
|
|
23
|
+
```console
|
|
24
|
+
bin/setup
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Use `bin/console` for an interactive Ruby session. Run the local executable with `exe/rvw` when
|
|
28
|
+
exercising the CLI from the repository.
|
|
29
|
+
|
|
30
|
+
## Tests
|
|
31
|
+
|
|
32
|
+
Reviewer uses Minitest. Run only the test file covering the code you changed:
|
|
33
|
+
|
|
34
|
+
```console
|
|
35
|
+
bundle exec rvw tests -f test/reviewer/setup_test.rb
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Write a failing test first, confirm the expected failure, make the minimum change, and rerun that
|
|
39
|
+
focused file. Prefer the fixtures under `test/fixtures/` to factories or ad hoc configuration data.
|
|
40
|
+
|
|
41
|
+
Before committing, use the repository's configured review gate on the staged changes:
|
|
42
|
+
|
|
43
|
+
```console
|
|
44
|
+
bundle exec rvw staged
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Pull requests
|
|
48
|
+
|
|
49
|
+
Keep each pull request to one logical change. Explain why the change is needed, include the focused
|
|
50
|
+
test evidence, and update user-facing documentation when behavior or configuration changes.
|
|
51
|
+
|
|
52
|
+
Do not mix release preparation into a feature or fix. Maintainers release Reviewer using the
|
|
53
|
+
[release guide](https://github.com/garrettdimon/reviewer/blob/main/RELEASING.md).
|
|
54
|
+
|
|
55
|
+
## API documentation
|
|
56
|
+
|
|
57
|
+
Public Ruby classes and methods are documented in the
|
|
58
|
+
[Reviewer API reference](https://www.rubydoc.info/gems/reviewer).
|
|
59
|
+
|
|
60
|
+
Return to the [documentation index](README.md).
|
data/docs/README.md
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Reviewer documentation
|
|
2
|
+
|
|
3
|
+
Reviewer runs a project's tests, linters, security audits, formatters, and other command-line review
|
|
4
|
+
tools through one consistent interface. The project keeps its own commands in `.reviewer.yml`;
|
|
5
|
+
Reviewer selects, composes, and runs them.
|
|
6
|
+
|
|
7
|
+
## Start here
|
|
8
|
+
|
|
9
|
+
- [Getting started](getting-started.md) — inspect the project, write a configuration, and run the
|
|
10
|
+
first review.
|
|
11
|
+
- [Usage](usage.md) — select tools and files, format code, choose output, and use Reviewer in common
|
|
12
|
+
workflows.
|
|
13
|
+
- [Configuration](configuration.md) — the complete `.reviewer.yml` reference and command-composition
|
|
14
|
+
rules.
|
|
15
|
+
- [Recipes](recipes.md) — small configurations for common workflows.
|
|
16
|
+
- [Contributing](CONTRIBUTING.md) — develop and contribute to Reviewer.
|
|
17
|
+
|
|
18
|
+
For Ruby classes and methods, see the [Reviewer API reference](https://www.rubydoc.info/gems/reviewer).
|
|
19
|
+
|
|
20
|
+
Return to the [project README](../README.md).
|