Commit 863ebc7
authored
Fix misleading error message when CODEOWNERS is out of date (#164)
* Fix misleading error message when CODEOWNERS is out of date
When running `codeownership validate --skip-autocorrect` with an
out-of-date CODEOWNERS file, the error from codeowners-rs says to run
`codeowners generate`, which is the standalone Rust CLI and not
available to users of this gem. Rewrite the message to point to
`bin/codeownership validate` instead.
Fixes #155
* Replace Ruby-level error rewrite with fix at source in codeowners-rs
Instead of rescuing RuntimeError in validate! and doing a fragile
gsub on the error message string, pass executable_name to RunConfig
so codeowners-rs generates the correct message directly.
This requires a companion change in codeowners-rs that changes
executable_name to hold the full command (e.g. "codeowners generate")
rather than just the binary name, so the format string no longer
hardcodes the " generate" subcommand.
* Add spec for validate! error message referencing bin/codeownership validate
Verifies that when CODEOWNERS is out of date and validate! is called with
autocorrect: false, the error message references bin/codeownership validate
rather than the standalone codeowners generate CLI command.1 parent 739a83c commit 863ebc7
3 files changed
Lines changed: 25 additions & 1 deletion
File tree
- ext/code_ownership/src
- lib/code_ownership
- spec/lib
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
119 | | - | |
| 119 | + | |
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
| |||
Binary file not shown.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
555 | 555 | | |
556 | 556 | | |
557 | 557 | | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
558 | 582 | | |
0 commit comments