[SERVER-68247] Support mongo-authored clang-tidy plugins in Evergreen Created: 23/Jul/22  Updated: 01/Dec/22  Resolved: 01/Dec/22

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Billy Donahue Assignee: Daniel Moody
Resolution: Duplicate Votes: 2
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-70052 Investigate static analysis mechanism... Closed
is related to WT-5577 Add custom clang tidy check for alpha... Backlog
is related to SERVER-68246 change calls to `boost::optional` mem... Closed
is related to SERVER-68867 Use linter to prevent new instances o... Closed
is related to SERVER-71732 Support mongo-authored clang-tidy plu... Closed
is related to SERVER-71733 Add mongo-authored clang-tidy plugins... Closed
Participants:

 Description   

Put us in a position to finally replace Python and regexes with real C++ tooling.

As part of Skunkworks 2022, I wrote an out-of-source clang-tidy plugin to restrict our uses of boost::optional to the API that's supported by std::optional.
Example plugin code: https://github.com/BillyDonahue/mongo_std_optional_migration/blob/master/tool/lib/MongoStdOptionalMigration.cpp

For the migration I was trying to do, I put clang-tidy into --fix mode, but the plugin can just emit warnings instead.

These small files could be hosted in the mongo server code tree the way we host our python-based cpplinter patterns now, but they would obviously have far more capability.

I think the stock set of clang-tidy checks that we are enabling in Evergreen right now are often useful but not quite right for our codebase, and we could do much better by dynamically loading in our own checks that are hosted inside the codebase upon which they operate.



 Comments   
Comment by Alex Neben [ 01/Dec/22 ]

I'm closing this ticket in favor of splitting this into two requests SERVER-71732 and SERVER-71733

Comment by Andrew Morrow (Inactive) [ 29/Sep/22 ]

billy.donahue@mongodb.com - That's really exciting that you were able to do that. It has been something I wanted to try for a long time. Were you able to build your plugin against the headers and libraries that the mongodbtoolchain provided? Something else?

Generated at Thu Feb 08 06:10:17 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.