reviewer 0.1.5 → 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 +39 -36
- data/CHANGELOG.md +81 -2
- data/LICENSE.txt +20 -4
- data/README.md +74 -22
- 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/exe/fmt +1 -1
- data/exe/rvw +1 -1
- data/lib/reviewer/arguments/files.rb +47 -20
- data/lib/reviewer/arguments/keywords.rb +52 -43
- data/lib/reviewer/arguments/options.rb +35 -0
- data/lib/reviewer/arguments/tags.rb +11 -11
- data/lib/reviewer/arguments.rb +78 -29
- data/lib/reviewer/batch/formatter.rb +97 -0
- data/lib/reviewer/batch.rb +33 -50
- data/lib/reviewer/capabilities.rb +99 -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 +53 -16
- data/lib/reviewer/command.rb +65 -10
- data/lib/reviewer/configuration/loader.rb +82 -0
- data/lib/reviewer/configuration.rb +6 -3
- data/lib/reviewer/context.rb +15 -0
- data/lib/reviewer/doctor/config_check.rb +57 -0
- data/lib/reviewer/doctor/discovery_check.rb +85 -0
- data/lib/reviewer/doctor/environment_check.rb +68 -0
- data/lib/reviewer/doctor/formatter.rb +169 -0
- data/lib/reviewer/doctor/keyword_check.rb +85 -0
- data/lib/reviewer/doctor/report.rb +155 -0
- data/lib/reviewer/doctor/tool_inventory.rb +58 -0
- data/lib/reviewer/doctor.rb +36 -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 +134 -0
- data/lib/reviewer/report.rb +144 -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 +228 -0
- data/lib/reviewer/runner/strategies/captured.rb +99 -24
- data/lib/reviewer/runner/strategies/passthrough.rb +2 -11
- data/lib/reviewer/runner.rb +126 -40
- data/lib/reviewer/session/formatter.rb +108 -0
- data/lib/reviewer/session.rb +224 -0
- data/lib/reviewer/setup/catalog.rb +244 -0
- data/lib/reviewer/setup/detector.rb +84 -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 +44 -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 +63 -0
- data/lib/reviewer/tool/settings.rb +90 -44
- data/lib/reviewer/tool/test_file_mapper.rb +73 -0
- data/lib/reviewer/tool/timing.rb +78 -0
- data/lib/reviewer/tool.rb +91 -69
- data/lib/reviewer/tools.rb +48 -34
- data/lib/reviewer/version.rb +1 -1
- data/lib/reviewer.rb +114 -51
- data/reviewer.gemspec +27 -25
- metadata +105 -160
- data/.alexignore +0 -1
- data/.flayignore +0 -1
- data/.github/workflows/main.yml +0 -26
- data/.gitignore +0 -13
- data/.inch.yml +0 -4
- data/.reviewer.future.yml +0 -221
- data/.reviewer.yml +0 -140
- data/.reviewer_stdout +0 -0
- data/.rubocop.yml +0 -20
- data/Gemfile +0 -8
- data/Gemfile.lock +0 -119
- data/Rakefile +0 -12
- data/bin/console +0 -15
- data/bin/setup +0 -8
- 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
- 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,42 +1,40 @@
|
|
|
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
|
-
#
|
|
6
|
-
# name:
|
|
7
|
-
# description:
|
|
8
|
-
# tags: [ruby, dependencies]
|
|
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]
|
|
9
8
|
# links:
|
|
10
|
-
# home:
|
|
11
|
-
# install:
|
|
12
|
-
#
|
|
13
|
-
#
|
|
14
|
-
# 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.
|
|
15
13
|
# commands:
|
|
16
|
-
# install:
|
|
17
|
-
# prepare:
|
|
18
|
-
# review:
|
|
19
|
-
# format:
|
|
20
|
-
#
|
|
21
|
-
# generate: // Optional. Command to generate artifacts from the tool for viewing separately.
|
|
22
|
-
# 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.
|
|
23
19
|
# files:
|
|
24
|
-
#
|
|
25
|
-
#
|
|
26
|
-
#
|
|
27
|
-
#
|
|
28
|
-
#
|
|
29
|
-
#
|
|
30
|
-
#
|
|
31
|
-
#
|
|
32
|
-
#
|
|
33
|
-
#
|
|
34
|
-
#
|
|
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.
|
|
35
33
|
|
|
36
34
|
|
|
37
|
-
#
|
|
35
|
+
# Complete supported example:
|
|
38
36
|
tool-name-key:
|
|
39
|
-
|
|
37
|
+
skip_in_batch: true
|
|
40
38
|
name: Tool
|
|
41
39
|
description: A tool that finds issues and fixes code.
|
|
42
40
|
tags: [syntax, security]
|
|
@@ -46,18 +44,23 @@ tool-name-key:
|
|
|
46
44
|
ignore_syntax: https://example.com/ignore
|
|
47
45
|
disable_syntax: https://example.com/disable
|
|
48
46
|
commands:
|
|
49
|
-
install: 'bundle install tool'
|
|
47
|
+
install: 'bundle exec gem install tool'
|
|
50
48
|
prepare: 'bundle exec tool update'
|
|
51
49
|
review: 'bundle exec tool'
|
|
52
50
|
format: 'bundle exec tool --format'
|
|
53
51
|
max_exit_status: 1
|
|
54
52
|
files:
|
|
55
|
-
|
|
53
|
+
review: 'bundle exec tool --files'
|
|
54
|
+
format: 'bundle exec tool --format --files'
|
|
55
|
+
flag: ''
|
|
56
56
|
separator: ','
|
|
57
|
+
pattern: '{lib,test}/**/*.rb'
|
|
58
|
+
map_to_tests: minitest
|
|
57
59
|
env:
|
|
58
60
|
report: false
|
|
59
61
|
flags:
|
|
60
62
|
format: json
|
|
61
63
|
verbose:
|
|
62
|
-
|
|
63
|
-
|
|
64
|
+
summary:
|
|
65
|
+
pattern: '(\d+) issues?'
|
|
66
|
+
label: '\1 issues'
|
data/CHANGELOG.md
CHANGED
|
@@ -1,7 +1,86 @@
|
|
|
1
1
|
## [Unreleased]
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
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
|
+
|
|
42
|
+
## [1.0.0] - 2026-02-03
|
|
43
|
+
|
|
44
|
+
### Added
|
|
45
|
+
- Git-aware file targeting: `staged`, `unstaged`, `modified`, `untracked` keywords resolve files from git status and pass only relevant files to each tool
|
|
46
|
+
- `failed` keyword: re-run only tools that failed in the previous run, scoped to their failed files
|
|
47
|
+
- `--json` / `-j` flag for structured JSON output (CI, scripting, agent integration)
|
|
48
|
+
- `--raw` / `-r` flag to force passthrough output (bypasses capturing)
|
|
49
|
+
- `--format` flag with streaming, summary, and json modes
|
|
50
|
+
- `--capabilities` / `-c` flag for agent discovery (outputs JSON describing tools, keywords, scenarios)
|
|
51
|
+
- `skip_in_batch` config option: exclude tools from `rvw` while keeping them available via `rvw tool_name`
|
|
52
|
+
- `files.pattern` config: glob pattern to filter which files are passed to each tool
|
|
53
|
+
- `files.map_to_tests` config: map source files to test files (`minitest` or `rspec` conventions)
|
|
54
|
+
- `files.review` / `files.format` config: alternative commands when files are scoped
|
|
55
|
+
- First-run experience: interactive setup when no `.reviewer.yml` exists
|
|
56
|
+
- `rvw init` command: auto-detect tools from Gemfile.lock and generate `.reviewer.yml`
|
|
57
|
+
- `rvw doctor` command: diagnostics for configuration, tools, keywords, and environment
|
|
58
|
+
- Keyword resolution summary: preview which tools and files will run before execution
|
|
59
|
+
- Spell-check suggestions for mistyped keywords
|
|
60
|
+
- Auto-detection catalog: bundler-audit, rubocop, standard, reek, flog, flay, brakeman, fasterer, minitest, rspec, eslint, prettier, stylelint, typescript, biome
|
|
61
|
+
- Progress bar for captured output with timing estimates
|
|
62
|
+
- PTY-based streaming capture for failed file extraction from single-tool runs
|
|
63
|
+
|
|
64
|
+
### Fixed
|
|
65
|
+
- Console width returns default in piped/CI contexts instead of 0
|
|
66
|
+
- `rvw failed` no longer crashes on empty tag objects
|
|
67
|
+
- MIT license restored in LICENSE.txt
|
|
68
|
+
- `--help` and `--version` exit immediately instead of running tool suite
|
|
69
|
+
- Valid JSON emitted for early exits (no matching tools, no files)
|
|
70
|
+
|
|
71
|
+
### Changed
|
|
72
|
+
- **Ruby 3.2+ required** (supports 3.2, 3.3, 3.4, and 4.0)
|
|
73
|
+
- Architecture refactor: full dependency injection, no global state in business logic
|
|
74
|
+
- Output decomposed into domain formatters (Runner, Batch, Session, Doctor, Setup, Report)
|
|
75
|
+
- Session class owns run lifecycle; Reviewer module is pure wiring
|
|
76
|
+
- Context struct threads shared dependencies through the call stack
|
|
77
|
+
- Tool timing extracted to Tool::Timing collaborator with injected history
|
|
78
|
+
- Result interpretation separated from Runner execution (Result.from_runner)
|
|
79
|
+
- Tests no longer depend on global state or require reset between runs
|
|
80
|
+
- Redesigned output: compact `↳ command` format, `✓ ~Xs` checkmark summaries
|
|
81
|
+
- ANSI color output guarded for TTY (clean output in CI and pipes)
|
|
82
|
+
- README rewritten with installation, usage, configuration, and workflow documentation
|
|
83
|
+
- `disabled` config key deprecated in favor of `skip_in_batch`
|
|
5
84
|
|
|
6
85
|
## [0.1.4] - 2021-07-08
|
|
7
86
|
|
data/LICENSE.txt
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
|
-
|
|
1
|
+
The MIT License (MIT)
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
Copyright (c) 2021 Garrett Dimon
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|
data/README.md
CHANGED
|
@@ -1,37 +1,89 @@
|
|
|
1
1
|
# [Reviewer](https://github.com/garrettdimon/reviewer)
|
|
2
|
-
by [Garrett Dimon](https://garrettdimon.com)
|
|
3
2
|
|
|
4
|
-
|
|
3
|
+
Frictionless code quality.
|
|
5
4
|
|
|
6
|
-
|
|
5
|
+
[](https://github.com/garrettdimon/reviewer/actions/workflows/main.yml)
|
|
6
|
+
[](https://codecov.io/gh/garrettdimon/reviewer)
|
|
7
|
+
[](https://rubygems.org/gems/reviewer)
|
|
8
|
+
|
|
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.
|
|
7
11
|
|
|
8
|
-
|
|
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.
|
|
9
14
|
|
|
10
|
-
|
|
15
|
+
## Before & After
|
|
11
16
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
**Before** — five separate commands, each with their own flags:
|
|
18
|
+
|
|
19
|
+
```console
|
|
20
|
+
bundle exec bundle-audit check --no-update
|
|
21
|
+
bundle exec rake test
|
|
22
|
+
bundle exec rubocop --parallel
|
|
23
|
+
bundle exec fasterer
|
|
24
|
+
bundle exec reek lib/
|
|
20
25
|
```
|
|
21
|
-
|
|
26
|
+
|
|
27
|
+
**After:**
|
|
28
|
+
|
|
29
|
+
```console
|
|
30
|
+
rvw
|
|
22
31
|
```
|
|
23
|
-
|
|
32
|
+
|
|
33
|
+
```text
|
|
34
|
+
Bundle Audit Review Gem Dependencies for Security Issues
|
|
35
|
+
↳ bundle exec bundle-audit check --no-update
|
|
36
|
+
Success 0.8s
|
|
37
|
+
|
|
38
|
+
Minitest Unit Tests & Coverage
|
|
39
|
+
↳ bundle exec rake test
|
|
40
|
+
Success 4.2s
|
|
41
|
+
|
|
42
|
+
RuboCop Review Ruby Syntax & Formatting for Consistency
|
|
43
|
+
↳ bundle exec rubocop --parallel
|
|
44
|
+
Success 1.1s
|
|
45
|
+
|
|
46
|
+
✓ ~6.1 seconds for 3 tools
|
|
24
47
|
```
|
|
25
48
|
|
|
26
|
-
|
|
49
|
+
## Install & Setup
|
|
27
50
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
51
|
+
Reviewer requires Ruby 3.2 or newer.
|
|
52
|
+
|
|
53
|
+
```console
|
|
54
|
+
gem install reviewer
|
|
55
|
+
rvw doctor
|
|
56
|
+
```
|
|
57
|
+
|
|
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:
|
|
60
|
+
|
|
61
|
+
```console
|
|
62
|
+
rvw doctor
|
|
63
|
+
rvw
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Or add `gem 'reviewer'` to the project's `Gemfile` before running `bundle install`.
|
|
67
|
+
|
|
68
|
+
See [Getting started](docs/getting-started.md) for the Doctor-guided setup workflow and first review.
|
|
69
|
+
|
|
70
|
+
## Configuration
|
|
71
|
+
|
|
72
|
+
See the [configuration reference](docs/configuration.md) for the supported `.reviewer.yml` schema,
|
|
73
|
+
command composition, and file targeting.
|
|
74
|
+
|
|
75
|
+
## Documentation
|
|
76
|
+
|
|
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)
|
|
32
82
|
|
|
33
83
|
## License
|
|
34
|
-
|
|
84
|
+
|
|
85
|
+
MIT License — see [LICENSE.txt](LICENSE.txt).
|
|
35
86
|
|
|
36
87
|
## Code of Conduct
|
|
37
|
-
|
|
88
|
+
|
|
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).
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
# Configuration
|
|
2
|
+
|
|
3
|
+
Reviewer reads `.reviewer.yml` from the current directory. The file maps a tool key to its settings;
|
|
4
|
+
only `commands.review` is required.
|
|
5
|
+
|
|
6
|
+
```yaml
|
|
7
|
+
rubocop:
|
|
8
|
+
commands:
|
|
9
|
+
review: bundle exec rubocop --parallel
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
Run that tool with `rvw rubocop`. Run every tool included in the default batch with `rvw`.
|
|
13
|
+
|
|
14
|
+
## Tool order and selection
|
|
15
|
+
|
|
16
|
+
Tools run in YAML order. Put checks that should stop the review near the beginning: Reviewer stops
|
|
17
|
+
after the first executed failure, while a missing executable is reported and the batch continues.
|
|
18
|
+
|
|
19
|
+
Set `skip_in_batch: true` to exclude a tool from bare `rvw` while keeping it available by an
|
|
20
|
+
explicit tool key. Tags select enabled tools that share a configured category.
|
|
21
|
+
|
|
22
|
+
```yaml
|
|
23
|
+
brakeman:
|
|
24
|
+
name: Brakeman
|
|
25
|
+
description: Scan a Rails application for security issues
|
|
26
|
+
tags: [ruby, security]
|
|
27
|
+
skip_in_batch: true
|
|
28
|
+
commands:
|
|
29
|
+
review: bundle exec brakeman --no-pager -q
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
`disabled` is deprecated. Existing configurations still treat `disabled: true` as
|
|
33
|
+
`skip_in_batch: true`, but `skip_in_batch` wins when both keys are present. Replace `disabled` when
|
|
34
|
+
editing a configuration.
|
|
35
|
+
|
|
36
|
+
## Commands
|
|
37
|
+
|
|
38
|
+
```yaml
|
|
39
|
+
bundle_audit:
|
|
40
|
+
commands:
|
|
41
|
+
install: bundle exec gem install bundler-audit
|
|
42
|
+
prepare: bundle exec bundle-audit update
|
|
43
|
+
review: bundle exec bundle-audit check --no-update
|
|
44
|
+
format: bundle exec bundle-audit update
|
|
45
|
+
max_exit_status: 0
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
| Setting | Behavior |
|
|
49
|
+
|---|---|
|
|
50
|
+
| `commands.review` | Required command used by `rvw` |
|
|
51
|
+
| `commands.format` | Command used by `fmt`; tools without one are skipped during formatting |
|
|
52
|
+
| `commands.prepare` | Runs before review or format at most once every six hours; failed attempts are cached too |
|
|
53
|
+
| `commands.install` | Recovery hint that Reviewer may display; Reviewer does not execute it |
|
|
54
|
+
| `commands.max_exit_status` | Highest review-command status considered successful; defaults to `0` |
|
|
55
|
+
|
|
56
|
+
Commands in `.reviewer.yml` are shell strings owned by the project. Reviewer preserves each saved
|
|
57
|
+
command as configured, then applies only the explicit composition settings below. `commands.install`
|
|
58
|
+
is display-only: Reviewer has no installer and never executes it. Projects may replace or pin any
|
|
59
|
+
saved command without changing Reviewer's behavior.
|
|
60
|
+
|
|
61
|
+
## Command composition
|
|
62
|
+
|
|
63
|
+
Reviewer builds an executable command in this order:
|
|
64
|
+
|
|
65
|
+
1. Environment assignments from `env`.
|
|
66
|
+
2. The selected base command.
|
|
67
|
+
3. Configured `flags` for review commands.
|
|
68
|
+
4. Resolved file arguments when file targeting applies.
|
|
69
|
+
|
|
70
|
+
The base command is preserved as configured. With targeted files, `files.review` or `files.format`
|
|
71
|
+
replaces the corresponding base command when present; Reviewer then appends the same configured flags
|
|
72
|
+
and file arguments.
|
|
73
|
+
|
|
74
|
+
```yaml
|
|
75
|
+
tests:
|
|
76
|
+
commands:
|
|
77
|
+
review: bundle exec rake test
|
|
78
|
+
files:
|
|
79
|
+
review: bundle exec ruby -Itest -e 'ARGV.each { |file| require File.expand_path(file) }'
|
|
80
|
+
pattern: "*_test.rb"
|
|
81
|
+
map_to_tests: minitest
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## File targeting
|
|
85
|
+
|
|
86
|
+
```yaml
|
|
87
|
+
rubocop:
|
|
88
|
+
commands:
|
|
89
|
+
review: bundle exec rubocop
|
|
90
|
+
format: bundle exec rubocop --autocorrect
|
|
91
|
+
files:
|
|
92
|
+
review: bundle exec rubocop
|
|
93
|
+
format: bundle exec rubocop --autocorrect
|
|
94
|
+
flag: ""
|
|
95
|
+
separator: " "
|
|
96
|
+
pattern: "*.rb"
|
|
97
|
+
map_to_tests: minitest
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
| Setting | Behavior |
|
|
101
|
+
|---|---|
|
|
102
|
+
| `files.review` | Replaces `commands.review` when files are targeted |
|
|
103
|
+
| `files.format` | Replaces `commands.format` when files are targeted |
|
|
104
|
+
| `files.flag` | Prefix before the resolved file list; empty means bare paths |
|
|
105
|
+
| `files.separator` | Joins multiple shell-escaped paths; defaults to one space |
|
|
106
|
+
| `files.pattern` | Keeps matching paths before the command runs |
|
|
107
|
+
| `files.map_to_tests` | Maps Ruby source paths to existing `minitest` or `rspec` test paths |
|
|
108
|
+
|
|
109
|
+
Only tools with a `files:` block receive resolved file arguments; tools without one run their
|
|
110
|
+
configured command unchanged.
|
|
111
|
+
|
|
112
|
+
Slashless patterns match each path's basename. Patterns containing `/` match normalized
|
|
113
|
+
repository-relative paths with pathname semantics. In path patterns, `**/` crosses directory
|
|
114
|
+
boundaries while bare `**` does not; brace alternatives such as `'{lib,test}/**/*.rb'` are
|
|
115
|
+
supported. Source-to-test mapping runs before filtering, nonexistent resolved paths are omitted,
|
|
116
|
+
and resolver output retains each matched path's original form. Reviewer shell-escapes each resolved
|
|
117
|
+
path when appending it to the command.
|
|
118
|
+
|
|
119
|
+
Source-to-test mapping recognizes Ruby files under `app/` and `lib/`, preserves matching test files,
|
|
120
|
+
and omits mapped paths that do not exist.
|
|
121
|
+
|
|
122
|
+
## Environment and flags
|
|
123
|
+
|
|
124
|
+
```yaml
|
|
125
|
+
tests:
|
|
126
|
+
commands:
|
|
127
|
+
review: bundle exec rake test
|
|
128
|
+
env:
|
|
129
|
+
testopts: --seed=$SEED
|
|
130
|
+
flags:
|
|
131
|
+
verbose:
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
Environment keys are uppercased and prepended as `KEY=value`. Values containing spaces are quoted.
|
|
135
|
+
`$SEED` is replaced with a consistent random seed that `rvw failed` reuses.
|
|
136
|
+
|
|
137
|
+
Flags apply only to review commands. A one-character key becomes a short flag such as `-v`; longer
|
|
138
|
+
keys become long flags such as `--verbose`. Empty values produce a switch, and values containing
|
|
139
|
+
spaces are quoted.
|
|
140
|
+
|
|
141
|
+
## Links and failure guidance
|
|
142
|
+
|
|
143
|
+
```yaml
|
|
144
|
+
rubocop:
|
|
145
|
+
links:
|
|
146
|
+
home: https://rubocop.org
|
|
147
|
+
install: https://docs.rubocop.org/rubocop/installation.html
|
|
148
|
+
ignore_syntax: https://docs.rubocop.org/rubocop/configuration.html
|
|
149
|
+
disable_syntax: https://docs.rubocop.org/rubocop/configuration.html
|
|
150
|
+
commands:
|
|
151
|
+
review: bundle exec rubocop
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
`links.ignore_syntax` and `links.disable_syntax` may be shown after a review failure. Link values are
|
|
155
|
+
informational and are never executed.
|
|
156
|
+
|
|
157
|
+
## Summary details
|
|
158
|
+
|
|
159
|
+
Summary output can extract a detail from captured standard output:
|
|
160
|
+
|
|
161
|
+
```yaml
|
|
162
|
+
tests:
|
|
163
|
+
commands:
|
|
164
|
+
review: bundle exec rake test
|
|
165
|
+
summary:
|
|
166
|
+
pattern: "(\\d+) tests?"
|
|
167
|
+
label: "\\1 tests"
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
`summary.pattern` is matched case-insensitively. `summary.label` is required when a pattern is
|
|
171
|
+
configured; numbered captures such as `\\1` are replaced with values from the match.
|
|
172
|
+
|
|
173
|
+
When extraction succeeds, `--format summary` prints the configured label after the tool's timing and
|
|
174
|
+
`--json` includes it as `detail_summary` in that tool's result. The JSON key is absent when the
|
|
175
|
+
configuration is incomplete or standard output does not match. This project-defined label is display
|
|
176
|
+
text for consumers to surface, not a structured value to parse.
|
|
177
|
+
|
|
178
|
+
## Complete example
|
|
179
|
+
|
|
180
|
+
The repository's [example configuration](../.reviewer.example.yml) is the copyable reference for all
|
|
181
|
+
supported settings. For task-oriented examples, see [recipes](recipes.md). Return to the
|
|
182
|
+
[documentation index](README.md).
|