fix(cli): forward --config flag to all load_config call sites - #478
Merged
Merged
Conversation
The global --config flag (CORA_CONFIG env) was silently ignored by 5 commands because they called load_config(None, ...) instead of forwarding the user-provided config path. Affected commands: - cora config show (config_cmd.rs) - cora config validate (config_cmd.rs) - cora debt (debt.rs) - cora index (main.rs - skip pattern loading) - cora dead-code (main.rs - entry_point_patterns) Fix: thread cli.global.config.as_deref() through every call site. DebtOptions gains a config_path field to receive the global flag.
ajianaz
force-pushed
the
fix/config-flag-not-forwarded
branch
from
August 4, 2026 10:10
c844421 to
d70fd2b
Compare
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.
What
The global
--configflag (CORA_CONFIGenv) was silently ignored by 5 commands because they calledload_config(None, ...)instead of forwarding the user-provided config path.Why
Users running
cora config show --config /path/to/custom.yamlwould get default config instead of their specified file — a silent failure with no error message. Same forconfig validate,debt,index, anddead-code.Root cause:
GlobalOptions.configwas defined as aglobal = trueclap flag (main.rs:54), but multiple match arms inmain()and helper functions inconfig_cmd.rs/debt.rshardcodedNonefor thecli_config_pathparameter.Changes
config_cmd.rs:execute_config_show()andexecute_config_validate()now acceptconfig_path: Option<&str>. Validate also uses--configpath for raw file inspection (fixes cora review finding).debt.rs:DebtOptionsgainsconfig_pathfield.execute_debt()forwards it toload_config.main.rs: All 5 call sites now forwardcli.global.config.as_deref():cora config showcora config validatecora debtcora index(skip pattern loading)cora dead-code(entry_point_patterns)Testing
cargo test --bin cora— 776 passed, 0 failedcargo test --test *— 22 passed, 0 failedcargo clippy -- -D warnings— cleancora review(pre-commit) — No issues foundcora config validate --config /tmp/test.yamlcorrectly reads custom config (Model: test-model-from-config vs default glm-5.2)