-
Notifications
You must be signed in to change notification settings - Fork 10.8k
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
[clang-apply-replacements] Apply format only if --format is specified #70801
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please add a testcase?
clang-apply-replacements is now applying format even when --format is specified. This because, methods like createReplacementsForHeaders only takes the Spec.Style and would re-order the headers even when it was not requested. The fix is to set up Spec.Style only if --format is provided.
3fd4b8e
to
ac5aae4
Compare
Does this PR address a bug I logged? I'm not sure why you've requested my input. |
Sorry for not being clear. I was tagging developers who touched this part of the codebase to see if you can review this change. |
I haven't touched this code in 10 years. I don't think I'm a good candidate for providing a review. |
|
ping @AaronBallman ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes LGTM but we should probably add a release note to https://github.com/llvm/llvm-project/blob/main/clang-tools-extra/docs/ReleaseNotes.rst?plain=1 so users know about the fix.
@kuganv do you have cycles to work on this issue? If not, I can commandeer this pull requests and update release notes. Please let me know what is your preference. |
clang-apply-replacements used to apply format even without --format is specified. This because, methods like createReplacementsForHeaders only takes the Spec.Style and would re-order the headers even when it was not requested. The fix is to set up Spec.Style only if --format is provided. Also added note to ReleaseNotes.rst Based on llvm#70801
clang-apply-replacements used to apply format even without --format is specified. This because, methods like createReplacementsForHeaders only takes the Spec.Style and would re-order the headers even when it was not requested. The fix is to set up Spec.Style only if --format is provided. Also added note to ReleaseNotes.rst Based on #70801 --------- Co-authored-by: Kugan <34810920+kuganv@users.noreply.github.com> Co-authored-by: Aaron Ballman <aaron@aaronballman.com>
Pushed as #79466 |
clang-apply-replacements used to apply format even without --format is specified. This because, methods like createReplacementsForHeaders only takes the Spec.Style and would re-order the headers even when it was not requested. The fix is to set up Spec.Style only if --format is provided. Also added note to ReleaseNotes.rst Based on llvm#70801 --------- Co-authored-by: Kugan <34810920+kuganv@users.noreply.github.com> Co-authored-by: Aaron Ballman <aaron@aaronballman.com>
clang-apply-replacements is now applying format even when --format is not specified. Methods like createReplacementsForHeaders only takes the Spec.Style and would re-order the headers even when it was not requested. The fix is to set up Spec.Style only if --format is provided.