This is an archive of the discontinued LLVM Phabricator instance.

[clang-tidy] insert release notes for new checkers alphabetically
ClosedPublic

Authored by MyDeveloperDay on Dec 10 2018, 5:55 AM.

Details

Summary

Almost all code review comments on new checkers D55433: [clang-tidy] Adding a new modernize use nodiscard checker D48866: [clang-tidy] Add incorrect-pointer-cast checker D54349: [clang-tidy] new check 'readability-redundant-preprocessor' seem to ask for the release notes to be added alphabetically, plus I've seen commits by @Eugene.Zelenko reordering the lists

Make add_new_check.py add those release notes alphabetically based on checker name

If include-fixer section is seen add it at the end

Minor change in the message format to prevent double newlines added before the checker.

Do the tools themselves have unit tests? (sorry new to this game)

  • Tested adding new checker at the beginning
  • Tested on adding new checker in the middle
  • Tested on empty ReleasesNotes.rst (as we would see after RC)

Diff Detail

Repository
rL LLVM

Event Timeline

MyDeveloperDay created this revision.Dec 10 2018, 5:55 AM
Eugene.Zelenko edited reviewers, added: hokein; removed: Eugene.Zelenko.Dec 10 2018, 6:01 AM
Eugene.Zelenko set the repository for this revision to rCTE Clang Tools Extra.
Eugene.Zelenko added a subscriber: cfe-commits.
MyDeveloperDay edited the summary of this revision. (Show Details)Dec 10 2018, 6:01 AM
MyDeveloperDay removed rCTE Clang Tools Extra as the repository for this revision.

Thank you for this fix!

MyDeveloperDay edited the summary of this revision. (Show Details)Dec 10 2018, 6:05 AM
MyDeveloperDay added a comment.EditedDec 10 2018, 6:09 AM

Thank you for this fix!

You are welcome, I was reviewing other revisions to try and get up to speed, and I saw you giving someone else the same comment you gave mine! I'm no python expert so this could possible be done a better way, but I hope this at least give some relief.

JonasToth added inline comments.Dec 10 2018, 8:02 AM
clang-tidy/add_new_check.py
213 ↗(On Diff #177491)

I think it would be better to compile the regular expression and match with the compiled version.

218 ↗(On Diff #177491)

Please add whitespace around =

233 ↗(On Diff #177491)

what do you mean with the &? Is this intended as bit-operator?

a if header_found and add_note_here: is better for logical expressions in python.

Fix review comments

I think this patch is fine, AFAIK these utility scripts are not tested directly but are just adjusted if they dont work as expected :)

Did you test it with a fake new-check? If it does what we expect its fine :)

MyDeveloperDay marked 3 inline comments as done.Dec 10 2018, 10:17 AM

I think this patch is fine, AFAIK these utility scripts are not tested directly but are just adjusted if they dont work as expected :)

Did you test it with a fake new-check? If it does what we expect its fine :)

I tested it with both a couple of new fake checks, but also removed everything back to how the docs/ReleaseNotes.rst would be after the release branches, i.e. with just "The improvements are..."

JonasToth accepted this revision.Dec 10 2018, 10:18 AM

LGTM. Do you have commit access?

This revision is now accepted and ready to land.Dec 10 2018, 10:18 AM

LGTM. Do you have commit access?

I do not I'm afraid

LGTM. Do you have commit access?

I do not I'm afraid

I will commit for you.

This revision was automatically updated to reflect the committed changes.

By the word, will be good idea to have script which check alphabetical order and use it during build. Sometimes alphabetical order may be violated after merge with trunk.

By the word, will be good idea to have script which check alphabetical order and use it during build. Sometimes alphabetical order may be violated after merge with trunk.

I think that should be in the validate-check.py proposed in the other patch. If we just add it to the normal testing/documentation generation it would be best. I think it is like a unit-test in spirit.