Change executable_name to hold the full command string#101
Open
Change executable_name to hold the full command string#101
Conversation
- Remove pre-fix bug description block from test_validate_files_respects_owned_globs_with_excluded_extensions; replace with a concise description of what the test verifies - Correct the simplified owned_globs pattern in the comment to match the actual fixture config - Replace "THIS ASSERTION WILL FAIL ON MAIN" prose with a one-line summary - Update matches_globs doc comment to describe the function rather than its callsites - Replace brittle project_builder.rs:172 line-number reference with a description of intent - Add missing `use std::path::Path` import (compile error introduced in #89)
The bare `cargo check` job only checked the lib/bin crates and was strictly less thorough than the existing Test Suite and Lints jobs, both of which compile all targets. The redundant job also introduced a stale-cache risk: if its artifacts were reused from a prior run, compile errors in source files could go undetected. Removing it so that Test Suite (cargo test) and Lints (cargo clippy --all-targets) are the authoritative compile checks.
Uses Swatinem/rust-cache@v2 in the Check, Test Suite, and Lints jobs. Setting cache-on-failure: false (the default) ensures that a failed build never writes a stale cache entry, which is how a missing import in #89 was able to pass CI despite being a compile error. Restores the cargo check job that was removed in the prior commit, since it gives a clearer signal for compile errors than a mixed test/lint failure.
This reverts commit 2050667.
This reverts commit d2679fa.
Previously, executable_name held just the binary name and the error
message hardcoded " generate" as the subcommand:
format!("CODEOWNERS out of date. Run `{} generate` ...", executable_name)
This made it impossible for wrappers (like the code_ownership Ruby gem)
to show the correct command in the error message, since their update
command is not "<binary> generate".
Now executable_name holds the full command to run. The format string
no longer appends " generate". The default changes from "codeowners"
to "codeowners generate" so existing behavior is preserved for users
who do not customize the field.
Users with a custom executable_name in config/code_ownership.yml will
need to append their subcommand — e.g. change:
executable_name: my-tool
to:
executable_name: my-tool generate
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
executable_namefield was used as just the binary name, withgeneratehardcoded as the subcommand in the error message format string. This made it impossible for wrappers to specify the correct update command when their subcommand isn'tgenerate.executable_namenow holds the full command to run (e.g."codeowners generate","bin/codeownership validate"). Thegeneratesuffix is removed from the format string."codeowners"→"codeowners generate"so all existing behavior is preserved for users who do not customize the field.Migration for custom
executable_namein config:This is a companion change to rubyatscale/code_ownership#164, which fixes the misleading error message users of the Ruby gem see (rubyatscale/code_ownership#155).
Test plan
cargo test)cargo clippy,cargo test, andcargo fmt --check✅🤖 Generated with Claude Code