Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove cruft from the ArgSplitter. #21812

Merged
merged 1 commit into from
Jan 8, 2025

Conversation

benjyw
Copy link
Contributor

@benjyw benjyw commented Jan 8, 2025

In #21811 we removed some unneeded logic from ArgSplitter.

This PR cleans up some cruft remaining from that change.

@benjyw benjyw added the category:internal CI, fixes for not-yet-released features, etc. label Jan 8, 2025
@benjyw benjyw requested review from tdyas and huonw January 8, 2025 16:54
@@ -247,22 +234,6 @@ def _consume_flags(self) -> list[str]:
flags.append(flag)
return flags

def _descope_flag(self, flag: str, default_scope: str) -> tuple[str, str]:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is no longer called anywhere.

@@ -97,19 +97,6 @@ def __init__(self, known_scope_infos: Iterable[ScopeInfo], buildroot: str) -> No
# We store in reverse order, for efficient popping off the end.
self._unconsumed_args: list[str] = []

# We allow --scope-flag-name anywhere on the cmd line, as an alternative to ...
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was only used in _descope_flag() below, which is no longer called.

@@ -228,22 +212,6 @@ def test_passthru_args(splitter: ArgSplitter) -> None:
)


def test_subsystem_flags(splitter: ArgSplitter) -> None:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We no longer use ArgSplitter to extract flags (we only use it to figure out goals and specs), so this test now just recapitulates other tests in this file.

@benjyw benjyw merged commit f152256 into pantsbuild:main Jan 8, 2025
24 checks passed
@benjyw benjyw deleted the arg_splitting_cruft branch January 8, 2025 17:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:internal CI, fixes for not-yet-released features, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants