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.
Files changed (96) hide show
  1. checksums.yaml +4 -4
  2. data/.reviewer.example.yml +39 -36
  3. data/CHANGELOG.md +81 -2
  4. data/LICENSE.txt +20 -4
  5. data/README.md +74 -22
  6. data/docs/CONTRIBUTING.md +60 -0
  7. data/docs/README.md +20 -0
  8. data/docs/configuration.md +182 -0
  9. data/docs/getting-started.md +179 -0
  10. data/docs/recipes.md +91 -0
  11. data/docs/usage.md +216 -0
  12. data/exe/fmt +1 -1
  13. data/exe/rvw +1 -1
  14. data/lib/reviewer/arguments/files.rb +47 -20
  15. data/lib/reviewer/arguments/keywords.rb +52 -43
  16. data/lib/reviewer/arguments/options.rb +35 -0
  17. data/lib/reviewer/arguments/tags.rb +11 -11
  18. data/lib/reviewer/arguments.rb +78 -29
  19. data/lib/reviewer/batch/formatter.rb +97 -0
  20. data/lib/reviewer/batch.rb +33 -50
  21. data/lib/reviewer/capabilities.rb +99 -0
  22. data/lib/reviewer/command/string/env.rb +12 -6
  23. data/lib/reviewer/command/string/flags.rb +2 -4
  24. data/lib/reviewer/command/string.rb +53 -16
  25. data/lib/reviewer/command.rb +65 -10
  26. data/lib/reviewer/configuration/loader.rb +82 -0
  27. data/lib/reviewer/configuration.rb +6 -3
  28. data/lib/reviewer/context.rb +15 -0
  29. data/lib/reviewer/doctor/config_check.rb +57 -0
  30. data/lib/reviewer/doctor/discovery_check.rb +85 -0
  31. data/lib/reviewer/doctor/environment_check.rb +68 -0
  32. data/lib/reviewer/doctor/formatter.rb +169 -0
  33. data/lib/reviewer/doctor/keyword_check.rb +85 -0
  34. data/lib/reviewer/doctor/report.rb +155 -0
  35. data/lib/reviewer/doctor/tool_inventory.rb +58 -0
  36. data/lib/reviewer/doctor.rb +36 -0
  37. data/lib/reviewer/history.rb +10 -17
  38. data/lib/reviewer/output/formatting.rb +40 -0
  39. data/lib/reviewer/output/printer.rb +70 -9
  40. data/lib/reviewer/output.rb +37 -78
  41. data/lib/reviewer/prompt.rb +38 -0
  42. data/lib/reviewer/report/formatter.rb +134 -0
  43. data/lib/reviewer/report.rb +144 -0
  44. data/lib/reviewer/runner/failed_files.rb +66 -0
  45. data/lib/reviewer/runner/formatter.rb +103 -0
  46. data/lib/reviewer/runner/guidance.rb +79 -0
  47. data/lib/reviewer/runner/result.rb +228 -0
  48. data/lib/reviewer/runner/strategies/captured.rb +99 -24
  49. data/lib/reviewer/runner/strategies/passthrough.rb +2 -11
  50. data/lib/reviewer/runner.rb +126 -40
  51. data/lib/reviewer/session/formatter.rb +108 -0
  52. data/lib/reviewer/session.rb +224 -0
  53. data/lib/reviewer/setup/catalog.rb +244 -0
  54. data/lib/reviewer/setup/detector.rb +84 -0
  55. data/lib/reviewer/setup/formatter.rb +94 -0
  56. data/lib/reviewer/setup/gemfile_lock.rb +55 -0
  57. data/lib/reviewer/setup/generator.rb +54 -0
  58. data/lib/reviewer/setup/tool_block.rb +112 -0
  59. data/lib/reviewer/setup.rb +44 -0
  60. data/lib/reviewer/shell/result.rb +14 -15
  61. data/lib/reviewer/shell/timer.rb +40 -35
  62. data/lib/reviewer/shell.rb +41 -12
  63. data/lib/reviewer/tool/conversions.rb +20 -0
  64. data/lib/reviewer/tool/file_resolver.rb +63 -0
  65. data/lib/reviewer/tool/settings.rb +90 -44
  66. data/lib/reviewer/tool/test_file_mapper.rb +73 -0
  67. data/lib/reviewer/tool/timing.rb +78 -0
  68. data/lib/reviewer/tool.rb +91 -69
  69. data/lib/reviewer/tools.rb +48 -34
  70. data/lib/reviewer/version.rb +1 -1
  71. data/lib/reviewer.rb +114 -51
  72. data/reviewer.gemspec +27 -25
  73. metadata +105 -160
  74. data/.alexignore +0 -1
  75. data/.flayignore +0 -1
  76. data/.github/workflows/main.yml +0 -26
  77. data/.gitignore +0 -13
  78. data/.inch.yml +0 -4
  79. data/.reviewer.future.yml +0 -221
  80. data/.reviewer.yml +0 -140
  81. data/.reviewer_stdout +0 -0
  82. data/.rubocop.yml +0 -20
  83. data/Gemfile +0 -8
  84. data/Gemfile.lock +0 -119
  85. data/Rakefile +0 -12
  86. data/bin/console +0 -15
  87. data/bin/setup +0 -8
  88. data/lib/reviewer/conversions.rb +0 -16
  89. data/lib/reviewer/guidance.rb +0 -77
  90. data/lib/reviewer/keywords/git/staged.rb +0 -64
  91. data/lib/reviewer/keywords/git.rb +0 -14
  92. data/lib/reviewer/keywords.rb +0 -9
  93. data/lib/reviewer/loader.rb +0 -59
  94. data/lib/reviewer/output/scrubber.rb +0 -48
  95. data/lib/reviewer/output/token.rb +0 -85
  96. data/structure.svg +0 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4269dc4784c9a22232bd47db41cff0bf7d57b023ee50dc5fc455a650fb138b2a
4
- data.tar.gz: 73d9261188abd69db6aa23aa7db6f76a59696b1dac3e35eb1a5615e013b40354
3
+ metadata.gz: 8d918dfc0f53f9d2283d846207fc760f0aa0cafaa2d9db0f2225396935cdbd38
4
+ data.tar.gz: 2f8635ce31fee7646608c5dd591c277190e918b3c940b773d04731254c3ea707
5
5
  SHA512:
6
- metadata.gz: 66894ea63a67d4964e93a5ab83ce92b95e0757d38af05a1587e136d0cc2d61fcf146d2c30534ce3f58aa4f08ed406e328ecad1293a617df73b2d1167c6146782
7
- data.tar.gz: 0614f40cbd184e0e20aad58a8f4c320af3a5db358078cecdfac236047a0c85060b15b7dccbade7c599c4ebc030ea0eb4348d239fbbf3f25a48079f6f3a0464f7
6
+ metadata.gz: fc770176795e88d1c88e56903eb1ce3d756f0f46176edc1d1a280bff14069b0739a27a4aefa6ca04313c08f1324e3f9d45da86860c9563c97f7a82472005f7ca
7
+ data.tar.gz: dbfdb47cbc0c321bc2338251b4a16242d976d4b6fb893019e7dc5578d875bfc85ef4124297864fa50cbe52cf7189471e6fc2ece940e114cf92fe8ab0e429e369
@@ -1,42 +1,40 @@
1
- # Quick overview of the options configuration for command-line tools.
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
- # <command_key>: // ex. 'rubocop', 'bundler-audit', etc.
5
- # disabled: true // Optional. Tools are enabled by default
6
- # name: // Optional. Will use the `command_key` if name isn't provided.
7
- # description: // Optional. Serves as a handy reminder for the purpose of the command.
8
- # 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]
9
8
  # links:
10
- # home: // Optional. A link to the home page for the tool.
11
- # install: // Optional. A link to the installation instructions for the tool.
12
- # usage: // Optional. A link to the general usage instructions for the tool.
13
- # ignore_syntax: // Optional. A link to the syntax for ignoring some rules for small sections of code.
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: // Optional. Command to run to install the tool.
17
- # prepare: // Optional. Command to run prior to the review phase. ex. 'bundle exec bundle-audit update'
18
- # review: // Required. The only truly required field because this is the whole point.
19
- # format: // Optional. Command to auto-update rule violations when possible.
20
- # serve: // Optional. Command to start a local server with reports generated by the tool.
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
- # flag: // Optional, defaults to '' (empty string). The name of the flag used to pass subsets of files to the command.
25
- # separator: // Optional, defaults to ' ' (single space). The character used to separate lists of files and directories.
26
- # env: // Optional. A way to specify necessary environment variables for the tools commands. The key is the variable name, and the value is, well, the value.
27
- # example_one: value // - The names will automatically be capitalized, so you can freely use lower-case here.
28
- # example_one: value // - Reviewer is smart enough to handle string values with spaces and automatically quote them.
29
- # flags: // Optional. A way to specify flags *only for the review command*. The key is the flag name, and the value is, well, the value.
30
- # example_one: value // - Reviewer is smart enough to handle single-letter (-f) and multi-letter (--format) flags.
31
- # example_two: value // - It's highly-recommended to use the longer-name format for flags when possible to serve as self-documentation.
32
- # example_three: // - If the flag doesn't need or have a value, leaving it blank will translate it to a flag without a value.
33
- # other: // Optional. A way to specify paramters that don't follow the standard flags conventions.
34
- # description: value // - The key (ex. 'description') only serves as documentation and won't be used. Instead, the raw value will be applied
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
- # In practice, a configuration block would look something like the block below.
35
+ # Complete supported example:
38
36
  tool-name-key:
39
- disabled: true
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
- flag: 'files'
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
- other:
63
- example: '--example | other'
64
+ summary:
65
+ pattern: '(\d+) issues?'
66
+ label: '\1 issues'
data/CHANGELOG.md CHANGED
@@ -1,7 +1,86 @@
1
1
  ## [Unreleased]
2
2
 
3
- - TODO: Improve and streamline installation
4
- - TODO: Add support for targeting specific files
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
- Copyright (c) Garrett Dimon
1
+ The MIT License (MIT)
2
2
 
3
- Reviewer is an Open Source project licensed under the terms of
4
- the LGPLv3 license. Please see <http://www.gnu.org/licenses/lgpl-3.0.html>
5
- for license text.
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
- **Note:** As of December 2021, Reviewer is a work in progress. While it's working great reviewing its own code, it's not quite ready for wider usage. Once, it's ready, it will provide more helpful installation and usage details.
5
+ [![build](https://github.com/garrettdimon/reviewer/actions/workflows/main.yml/badge.svg?branch=main)](https://github.com/garrettdimon/reviewer/actions/workflows/main.yml)
6
+ [![coverage](https://img.shields.io/codecov/c/github/garrettdimon/reviewer?token=UuXUlQAA2e)](https://codecov.io/gh/garrettdimon/reviewer)
7
+ [![gem version](https://img.shields.io/gem/v/reviewer)](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
- *With Reviewer, you can seamlessly use multiple automated code review tools with orders of magnitude less friction so you can use them more frequently and consistently.*
15
+ ## Before & After
11
16
 
12
- So instead of remembering and typing...
13
- ```bash
14
- $ yarn audit --level moderate
15
- $ bundle exec bundle-audit check --no-update
16
- $ bundle exec rubocop --parallel
17
- $ bundle exec erblint --lint-all --enable-all-linters
18
- $ yarn stylelint .
19
- $ yarn eslint .
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
- ...you could just type...
26
+
27
+ **After:**
28
+
29
+ ```console
30
+ rvw
22
31
  ```
23
- $ rvw
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
- That's just the tip of the iceberg, though. For the full story on Reviewer's capabilities and benefits, the [Overview](https://github.com/garrettdimon/reviewer/wiki/Overview) is the best place to start. Or if you'd like to see how it's configured under the hood, the [Configuration Instructions](https://github.com/garrettdimon/reviewer/wiki/Configuration) go even deeper.
49
+ ## Install & Setup
27
50
 
28
- [![build](https://github.com/garrettdimon/reviewer/actions/workflows/main.yml/badge.svg?branch=main)](https://github.com/garrettdimon/reviewer/actions/workflows/main.yml)
29
- [![coverage](https://img.shields.io/codecov/c/github/garrettdimon/reviewer?token=UuXUlQAA2e)](https://codecov.io/gh/garrettdimon/reviewer)
30
- [![last commit](https://img.shields.io/github/last-commit/garrettdimon/reviewer/main)](https://github.com/garrettdimon/reviewer/commits/main)
31
- [![gem version](https://img.shields.io/gem/v/reviewer)](https://rubygems.org/gems/reviewer)
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
- The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
84
+
85
+ MIT License — see [LICENSE.txt](LICENSE.txt).
35
86
 
36
87
  ## Code of Conduct
37
- Everyone interacting in the Reviewer project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/reviewer/blob/master/CODE_OF_CONDUCT.md).
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).