Issue #1483 dump config full: Print every resolved setting under dump-config --full - #4732
Issue #1483 dump config full: Print every resolved setting under dump-config --full#4732ravivats wants to merge 3 commits into
Conversation
`dump-config` reports only the interpreter and the paths imports resolve from, so there is no way to see what any other setting resolved to. Someone debugging a config that appears to be ignored has nothing to inspect. This adds the end-to-end test for a `--full` flag that prints the rest of the resolved settings, ahead of implementing it. The config under test sets a path-scoped override, two error severities written out of alphabetical order, and a misspelled key, so the test pins down the sort order and the reporting of unrecognized keys as well as the overall shape of the output.
Users are pointed at `dump-config` to work out why a config is not behaving the way they expect, but it only reports the interpreter and the paths imports resolve from. Every other setting is invisible, and a key Pyrefly did not recognize is dropped silently, which is exactly the case the command is reached for. `--full` prints the rest of the resolved configuration in the indented, prose-labelled style the command already uses. Default output is untouched, so the existing behaviour and its tests still hold. The rendering lives in `pyrefly_config` next to `structured_import_lookup_path` because several `ConfigBase` settings are crate-private and unreadable from the command, which only prints the lines it is handed. Settings the import lookup path already covers are left out so that `--full` adds information rather than repeating it, and the error severities are sorted on the way out because they are stored in a `HashMap`.
The import resolution guide is where users are sent to debug configuration problems, so the new flag is described alongside the command it belongs to.
|
Hi @ravivats! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
|
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks! |
|
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks! |
Summary
Print every resolved setting under dump-config --full
Fixes #1483
Problem
dump-configis what the docs point people at to debug configuration, but it reports only the interpreter and the paths imports resolve from. Every other resolved setting is invisible, and a config key Pyrefly did not recognize is dropped silently, which is exactly the case people reach for this command to diagnose.Approach
Adds
--full, which prints the rest of the resolved configuration in the same indented, prose-labelled style the command already uses. Default output is unchanged.As per the comment on the issue, the file-list output is untouched since
--max-filesalready covers it. Settings that already appear underResolving imports from:are deliberately omitted so that--fulladds information rather than repeating it.The rendering lives in
pyrefly_configbesidestructured_import_lookup_path, mirroring that pattern, because severalConfigBasesettings are crate-private and unreadable fromdump_config.rs. Error severities are sorted on the way outbecause
ErrorDisplayConfigwraps aHashMap.On the flag name (--full instead of --verbose as suggested in the issue description)
The issue says "when
--verbose", but there is already a global-v/--verboseon every subcommand (commands/util.rs) that raises log verbosity, and clap rejects a duplicate. I used--fullto keep config output independent of lognoise.
Testing
test/config.mdcargo test(8227 passed),cargo clippy,cargo fmtall cleandump-configgolden tests intest/config.mdandtest/interpreter.mdpass unchanged, confirming default outpAI usage disclosure
I have worked on this issue for things like setting up the
pyreflyrepository as well as understanding the code and current dump-config output etc. using Claude, but I have done partially the implementation by hand, and I have reviewed and verified the implementation, the tests, and edited this description.