This is an archive of the discontinued LLVM Phabricator instance.

[clang-tidy] Fix add_new_check.py to generate correct list.rst autofix column from relative path
ClosedPublic

Authored by mattbeardsley on Sep 27 2021, 5:15 PM.

Details

Summary

Previously, the code in add_new_check.py that looks for fixit keywords in check source files when generating list.rst assumed that the script would only be called from its own path. That means it doesn't find any source files for the checks it's attempting to scan for, and it defaults to writing out nothing in the "Offers fixes" column for all checks. Other parts of add_new_check.py work from other paths, just not this part.

After this fix, add_new_check.py's "offers fixes" column generation for list.rst will be consistent regardless of what path it's called from by using the caller path that's deduced elsewhere already from sys.argv[0].

Diff Detail

Event Timeline

mattbeardsley created this revision.Sep 27 2021, 5:15 PM
mattbeardsley requested review of this revision.Sep 27 2021, 5:15 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 27 2021, 5:15 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
kbobyrev accepted this revision.Oct 3 2021, 11:48 PM

LGTTM, thanks!

This revision is now accepted and ready to land.Oct 3 2021, 11:48 PM

Thanks! Could you help me commit again when you have time? (same info as here)

Sure! I'm just using the credentials from the arc, mostly, i.e. arc patch --nobranch D110600 && git push.

This revision was landed with ongoing or failed builds.Oct 5 2021, 9:10 AM
This revision was automatically updated to reflect the committed changes.

Works for me! 🙂 I didn't realize you can pull the info automatically from arc. Thanks!

You're welcome :) Yeah, I think there's even arc land that's _intended_
for this but I'm just using the patch option. And it pulls from Phabricator
(name, email etc).