This is an archive of the discontinued LLVM Phabricator instance.

[clang-tidy][run-clang-tidy.py] Add --config-file=<string> option
ClosedPublic

Authored by SAtacker on Feb 22 2022, 8:32 AM.

Details

Summary

Details:

  • Added config_path variable within the python script which makes the required call to the clang-tidy binary with --config-file option.
  • If the config_path is None then config will be used.
  • No error is raised if both are given but silently chooses config_path over config

Signed-off-by: Shreyas Atre <shreyasatre16@gmail.com>

Diff Detail

Event Timeline

SAtacker created this revision.Feb 22 2022, 8:32 AM
SAtacker requested review of this revision.Feb 22 2022, 8:32 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 22 2022, 8:32 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
JonasToth added inline comments.Feb 22 2022, 2:51 PM
clang-tools-extra/clang-tidy/tool/run-clang-tidy.py
237

please ensure that those option exclude each other. right now it could be used with both options which is a contradiction for clang-tidy

SAtacker added a child revision: Restricted Differential Revision.Feb 22 2022, 9:00 PM
SAtacker removed a child revision: Restricted Differential Revision.Feb 22 2022, 10:07 PM
SAtacker updated this revision to Diff 410736.Feb 23 2022, 12:44 AM
SAtacker marked an inline comment as done.

Squash commits D120385, D120387 into D120331

@JonasToth Could you please review it?

clang-tools-extra/clang-tidy/tool/run-clang-tidy.py
237

Do you mean mutual exclusion? From the docs: https://docs.python.org/3/library/argparse.html#mutual-exclusion

JonasToth accepted this revision.EditedMar 2 2022, 3:41 AM

LGTM, but please adjust the naming nit to a better name.

do you have commit rights? Otherwise someone (e.g. me) could commit on your behalf, of course with a remark that its your contribution :)

(btw. go ahead and ping me again, I am busy with too many things right now :/)

clang-tools-extra/clang-tidy/tool/run-clang-tidy.py
228–229

nit: i think config_group or so would be better to show that its only config-related. This name is too generic i feel.

237

Yes, thanks :)

This revision is now accepted and ready to land.Mar 2 2022, 3:41 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 2 2022, 3:41 AM

LGTM, but please adjust the naming nit to a better name.

Thanks for the review again.
Will rename the group to config_group as you suggested and I feel that too.

do you have commit rights? Otherwise someone (e.g. me) could commit on your behalf, of course with a remark that its your contribution :)

(btw. go ahead and ping me again, I am busy with too many things right now :/)

I don't have the access to land this commit into the llvm-project. Until then I shall trust this wonderful process :)

SAtacker updated this revision to Diff 412397.Mar 2 2022, 6:35 AM

[clang-tidy][run-clang-tidy.py] Rename group to config_group

Signed-off-by: Shreyas Atre <shreyasatre16@gmail.com>

SAtacker marked an inline comment as done.Mar 7 2022, 11:45 AM

Gentle ping @alexfh @JonasToth
Thank you.

clang-tools-extra/clang-tidy/tool/run-clang-tidy.py
228–229

Thanks, done.

SAtacker marked an inline comment as done.EditedMar 15 2022, 10:51 PM

Gentle reminder to commit on my behalf
@JonasToth
@alexfh
@aaron.ballman
@njames93
@LegalizeAdulthood

Thank you

aaron.ballman closed this revision.Mar 17 2022, 4:31 AM

Gentle reminder to commit on my behalf
@JonasToth
@alexfh
@aaron.ballman
@njames93
@LegalizeAdulthood

Thank you

Thanks for the reminder -- I've commit on your behalf in 9e1f4f13984186984ba37513372c1b7e0c4ba4fd, thank you for the patch!