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

[Call-by-name] cc.lint.clang-format migration #21071

Merged
merged 3 commits into from
Jun 19, 2024

Conversation

sureshjoshi
Copy link
Member

This PR was intended to be part of the cc migration (#21043), but I left it commented out from the backend packages by accident.

See issue #21065 for tracking list.

@sureshjoshi sureshjoshi requested review from kaos and benjyw June 16, 2024 23:57
@sureshjoshi sureshjoshi added the category:internal CI, fixes for not-yet-released features, etc. label Jun 16, 2024
output_files=request.files,
description=f"Run clang-format on {pluralize(len(request.files), 'file')}.",
level=LogLevel.DEBUG,
argv = (
Copy link
Member Author

Choose a reason for hiding this comment

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

This was required to fix a migration warning, where the AST isn't smart enough to perform the migration when there are comments inline.

Using libcst or something (#21040) is the way.

*request.files,
)
result = await fallible_to_exec_result_or_raise(
**implicitly(
Copy link
Member Author

Choose a reason for hiding this comment

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

This solves a rule-graph error, where fallible_to... isn't expecting a PexProcess.
As per @stuhood https://pantsbuild.slack.com/archives/C0D7TNJHL/p1718575366615099?thread_ts=1718115214.921379&cid=C0D7TNJHL

if any sort of argument conversion is supposed to happen, then it should not be a positional argument: rather an **implicitly(PexProcess(..))
you call the function whose result you want, but you implicitly convert the arguments

@sureshjoshi sureshjoshi enabled auto-merge (squash) June 17, 2024 00:39
@sureshjoshi sureshjoshi merged commit 96c644e into pantsbuild:main Jun 19, 2024
25 checks passed
@sureshjoshi sureshjoshi deleted the call-by-name-clangformat branch June 25, 2024 12:11
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