feat(tidy): add fairmq-performance-channel-lookup-in-loop

- Report GetChannel() and GetChannels() calls in an override of
  ConditionalRun() or in a loop in an override of Run(). Each call
  looks up the channel name in a map.
- Skip the short form Send(msg, "name"): it is the usual style.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Claude
2026-11-09 23:14:01 +00:00
parent 349573fb5f
commit 4ccf75fa47
6 changed files with 179 additions and 0 deletions

View File

@@ -6,6 +6,7 @@
* copied verbatim in the file "LICENSE" *
********************************************************************************/
#include <fairmq/tidy/ChannelLookupInLoopCheck.h>
#include <fairmq/tidy/ChannelsAccessCheck.h>
#include <fairmq/tidy/DeprecatedFunctionsCheck.h>
#include <fairmq/tidy/DeprecatedHeadersCheck.h>
@@ -42,6 +43,7 @@ class Module : public clang::tidy::ClangTidyModule
factories.registerCheck<PartsApiCheck>("fairmq-modernize-parts-api");
factories.registerCheck<ProgOptionsAccessorsCheck>("fairmq-modernize-progoptions-accessors");
factories.registerCheck<RunDeviceCheck>("fairmq-modernize-run-device");
factories.registerCheck<ChannelLookupInLoopCheck>("fairmq-performance-channel-lookup-in-loop");
factories.registerCheck<TransferCodeCheck>("fairmq-readability-transfer-code");
}
};