Skip to content

Issue #1483 dump config full: Print every resolved setting under dump-config --full - #4732

Open
ravivats wants to merge 3 commits into
facebook:mainfrom
ravivats:issue_#1483_dump_config_full
Open

Issue #1483 dump config full: Print every resolved setting under dump-config --full#4732
ravivats wants to merge 3 commits into
facebook:mainfrom
ravivats:issue_#1483_dump_config_full

Conversation

@ravivats

Copy link
Copy Markdown

Summary

Print every resolved setting under dump-config --full

Fixes #1483

Problem

dump-config is 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 under Resolving imports from: are deliberately omitted so that --full adds information rather than repeating it.

The rendering lives in pyrefly_config beside structured_import_lookup_path, mirroring that pattern, because several ConfigBase settings are crate-private and unreadable from dump_config.rs. Error severities are sorted on the way out
because ErrorDisplayConfig wraps a HashMap.

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/--verbose on every subcommand (commands/util.rs) that raises log verbosity, and clap rejects a duplicate. I used --full to keep config output independent of log
noise.

Testing

  • New end-to-end test in test/config.md
  • cargo test (8227 passed), cargo clippy, cargo fmt all clean
  • The existing dump-config golden tests in test/config.md and
    test/interpreter.md pass unchanged, confirming default outp

AI usage disclosure

I have worked on this issue for things like setting up the pyrefly repository 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.

`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.
@meta-cla

meta-cla Bot commented Aug 30, 2026

Copy link
Copy Markdown

Hi @ravivats!

Thank you for your pull request and welcome to our community.

Action Required

In 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.

Process

In 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 CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!

@meta-cla

meta-cla Bot commented Aug 30, 2026

Copy link
Copy Markdown

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

@meta-cla meta-cla Bot added the cla signed label Aug 30, 2026
@meta-cla

meta-cla Bot commented Aug 30, 2026

Copy link
Copy Markdown

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Verbose output for pyrefly dump-config

2 participants