Skip to content

Add pants pyrefly-dump-config diagnostic goal#1

Merged
tague merged 1 commit into
mainfrom
tague/pyrefly-dump-config
Jul 17, 2026
Merged

Add pants pyrefly-dump-config diagnostic goal#1
tague merged 1 commit into
mainfrom
tague/pyrefly-dump-config

Conversation

@tague

@tague tague commented Jul 17, 2026

Copy link
Copy Markdown
Owner

Part 1 of 3 for the 0.3.0 release.

Adds a pants pyrefly-dump-config goal that prints the effective Pyrefly configuration Pants assembles for the targeted sources — first-party --search-paths, the resolved interpreter used for third-party imports, and the config file in effect — by running Pyrefly's dump-config subcommand. Diagnostic only; it does not type-check. Useful for debugging import/interpreter resolution.

Follows the existing goal pattern, reusing _setup_pyrefly_process(subcommand=("dump-config",)) and pyrefly_determine_partitions. Prints each partition's config under its own heading when targets span multiple resolves/interpreter constraints.

Note: The planned append_file_list knob on _setup_pyrefly_process was dropped — pyrefly dump-config --help confirms it accepts [FILES]..., so passing the argfile (mirroring check) is correct and rules.py is left untouched. This PR is purely additive.

Verification

  • pants lint check ✓ (plugin dogfoods Pyrefly on itself: 0 errors)
  • pants test :: ✓ — new test_dump_config_goal runs the real Pyrefly binary
  • Live: pants pyrefly-dump-config testprojects/src/example:: prints the resolved config with Pants' injected search-path + venv interpreter

Wraps Pyrefly's `dump-config` subcommand to print the effective configuration
Pants assembles for the targeted sources — the first-party `--search-path`s, the
resolved interpreter used for third-party imports, and the config file in effect.
Diagnostic only; it does not type-check. Useful for debugging import or
interpreter resolution.

Follows the existing goal pattern (GoalSubsystem + Goal(LOCAL_ONLY) + @goal_rule),
reusing `_setup_pyrefly_process(subcommand=("dump-config",))` and
`pyrefly_determine_partitions`. Prints each partition's config under its own
heading when targets span multiple resolves/interpreter constraints.

Includes an integration test, a README "Diagnostics" section, and a
0.3.0 (unreleased) changelog entry.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@tague
tague merged commit acb7aa4 into main Jul 17, 2026
4 checks passed
@tague
tague deleted the tague/pyrefly-dump-config branch July 17, 2026 17:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant