clang-tidy: modernize-use-using - #13613
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR modernizes legacy typedef declarations across ATS core headers and multiple plugins by replacing them with using aliases or named struct/enum declarations, and enables modernize-use-using in the clang-tidy CI configuration to prevent regressions.
Changes:
- Convert
typedef structpatterns tousingaliases or namedstructdeclarations in several plugins and internal headers. - Convert
typedef enumpatterns to namedenumdeclarations in multiple plugin sources and a session-sharing SDK header. - Enable
modernize-use-usingin.clang-tidy-ci.
File summaries
| File | Description |
|---|---|
| plugins/remap_purge/remap_purge.cc | Replaces a typedef struct alias with a using+struct form for the purge instance type. |
| plugins/regex_revalidate/regex_revalidate.cc | Modernizes typedef struct into using+struct for invalidate list/state types. |
| plugins/lua/ts_lua.cc | Converts a typedef struct into a named struct for Lua plugin stats. |
| plugins/lua/ts_lua_stat.cc | Converts typedef enum into named enum declarations for Lua stat constants. |
| plugins/lua/ts_lua_remap.cc | Converts typedef enum into a named enum for remap status mapping. |
| plugins/lua/ts_lua_package.cc | Converts a typedef struct into a named struct for package path entries. |
| plugins/lua/ts_lua_http.cc | Converts typedef enum into named enum declarations for Lua HTTP constants. |
| plugins/lua/ts_lua_http_txn_info.cc | Converts typedef enum into a named enum for txn info key mapping. |
| plugins/lua/ts_lua_http_milestone.cc | Converts typedef enum into a named enum for milestone mapping. |
| plugins/lua/ts_lua_http_config.cc | Converts typedef enum into named enum declarations for config/timeouts. |
| plugins/lua/ts_lua_http_cntl.cc | Converts typedef enum into a named enum for HTTP control mapping. |
| plugins/lua/ts_lua_hook.cc | Converts typedef enum into a named enum for hook ID mapping. |
| plugins/lua/ts_lua_fetch.h | Converts fetch-related typedef struct types into named struct / using forms. |
| plugins/lua/ts_lua_coroutine.h | Converts function pointer typedef and several typedef struct types into using/named struct forms. |
| plugins/lua/ts_lua_common.h | Converts multiple typedef struct declarations into named struct types used throughout the Lua plugin. |
| plugins/lua/ts_lua_client_request.cc | Converts typedef enum into a named enum for PP info keys. |
| plugins/libloader/libloader.cc | Converts a typedef struct alias into a using+struct form for link handles. |
| plugins/healthchecks/healthchecks.cc | Converts a typedef struct alias into a using+struct form for directory entries. |
| include/tscore/ink_queue.h | Converts a conditional typedef pair to using in the 128-bit CAS branch. |
| include/iocore/net/SessionSharingAPIEnums.h | Converts SDK-facing typedef enum declarations into named enum declarations. |
| include/iocore/net/NetVConnection.h | Converts a typedef enum into a named enum for net VC context. |
| include/iocore/eventsystem/VConnection.h | Converts an opaque-pointer typedef to a using alias. |
| .clang-tidy-ci | Enables the modernize-use-using clang-tidy check in CI. |
Review details
Suppressed comments (2)
include/iocore/net/SessionSharingAPIEnums.h:51
- Same C-compatibility issue as above: add a C-only typedef after this enum so C plugins can continue to use
TSServerSessionSharingMatchMaskwithout prefixingenum.
};
include/iocore/net/SessionSharingAPIEnums.h:59
- Same C-compatibility issue as above: add a C-only typedef after this enum so C plugins can continue to use
TSServerSessionSharingPoolTypewithout prefixingenum.
};
- Files reviewed: 23/23 changed files
- Comments generated: 2
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
6c3dd76 to
ac8ab69
Compare
cmcfarlen
left a comment
There was a problem hiding this comment.
Strange mix of adding using and renaming structs in this PR. We should just name the struct imo.
Legacy typedef declarations obscure complex aliases and preserve C-era declaration patterns in ATS and its plugins. This patch replaces the existing findings with named C++ declarations or using aliases and enables the check in CI to keep new code consistent.
ac8ab69 to
6703c41
Compare
There was a problem hiding this comment.
🟢 Approval recommended
The changes are mechanical, preserve existing semantics in the reviewed contexts, and the CI enforcement aligns with the stated goal of preventing new legacy typedef patterns.
Review details
- Files reviewed: 23/23 changed files
- Comments generated: 0 new
- Review effort level: Lite
Legacy typedef declarations obscure complex aliases and preserve C-era
declaration patterns in ATS and its plugins. This patch replaces the
existing findings with named C++ declarations or using aliases and enables
the check in CI to keep new code consistent.