Skip to content

clang-tidy: modernize-use-using - #13613

Open
bneradt wants to merge 1 commit into
apache:masterfrom
bneradt:clang-tidy-use-using
Open

clang-tidy: modernize-use-using#13613
bneradt wants to merge 1 commit into
apache:masterfrom
bneradt:clang-tidy-use-using

Conversation

@bneradt

@bneradt bneradt commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

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.

Copilot AI lite review requested due to automatic review settings September 1, 2026 19:58
@bneradt bneradt added this to the 11.0.0 milestone Sep 1, 2026
@bneradt bneradt self-assigned this Sep 1, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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 struct patterns to using aliases or named struct declarations in several plugins and internal headers.
  • Convert typedef enum patterns to named enum declarations in multiple plugin sources and a session-sharing SDK header.
  • Enable modernize-use-using in .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 TSServerSessionSharingMatchMask without prefixing enum.
};

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 TSServerSessionSharingPoolType without prefixing enum.
};
  • 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.

Comment thread include/iocore/net/SessionSharingAPIEnums.h
Comment thread plugins/lua/ts_lua_stat.cc Outdated
Copilot AI review requested due to automatic review settings September 1, 2026 20:22
@bneradt
bneradt force-pushed the clang-tidy-use-using branch from 6c3dd76 to ac8ab69 Compare September 1, 2026 20:22

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

Review details
  • Files reviewed: 23/23 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

@cmcfarlen cmcfarlen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Strange mix of adding using and renaming structs in this PR. We should just name the struct imo.

Comment thread plugins/healthchecks/healthchecks.cc Outdated
Comment thread plugins/regex_revalidate/regex_revalidate.cc Outdated
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.
Copilot AI review requested due to automatic review settings September 2, 2026 21:41
@bneradt
bneradt force-pushed the clang-tidy-use-using branch from ac8ab69 to 6703c41 Compare September 2, 2026 21:41

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants