Add pants pyrefly-dump-config diagnostic goal#1
Merged
Conversation
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>
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.
Part 1 of 3 for the 0.3.0 release.
Adds a
pants pyrefly-dump-configgoal 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'sdump-configsubcommand. 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",))andpyrefly_determine_partitions. Prints each partition's config under its own heading when targets span multiple resolves/interpreter constraints.Note: The planned
append_file_listknob on_setup_pyrefly_processwas dropped —pyrefly dump-config --helpconfirms it accepts[FILES]..., so passing the argfile (mirroringcheck) is correct andrules.pyis left untouched. This PR is purely additive.Verification
pants lint check✓ (plugin dogfoods Pyrefly on itself: 0 errors)pants test ::✓ — newtest_dump_config_goalruns the real Pyrefly binarypants pyrefly-dump-config testprojects/src/example::prints the resolved config with Pants' injected search-path + venv interpreter