chore: enable readability-identifier-naming check and fix violations - #764
Merged
egolearner merged 15 commits intoSep 18, 2026
Merged
Conversation
Add a Google-style-based readability-identifier-naming configuration to .clang-tidy with project-specific tweaks: - member functions use snake_case; static/global functions may use snake_case or upper-camel CamelCase - struct/class data members use snake_case, trailing underscore optional - local variables and parameters use snake_case; constants stay loose - fix the broken HeaderFilterRegex so headers are covered Auto-fix all existing naming violations across src/tests/tools and insert missing override specifiers. Generated ANTLR/FTS code and vendored third-party files are exempted via per-directory configs and NOLINT ranges.
egolearner
requested review from
JalinWang,
chinaux,
feihongxu0824,
iaojnh,
richyreachy and
zhourrr
as code owners
September 17, 2026 08:07
…g-check # Conflicts: # src/core/utility/buffer_storage.cc # src/core/utility/visit_filter.h # tests/ailego/buffer/vector_page_table_test.cc
egolearner
force-pushed
the
feat/clang-tidy-naming-check
branch
from
September 17, 2026 08:20
f25ac17 to
a7c2a17
Compare
The naming sweep ran only against TUs compiled on macOS arm64 (RABITQ_SUPPORTED=false, DISKANN_SUPPORTED=true), so it missed: - ivf_rabitq_index.cc train() calling GenerateHolder() in the RABITQ_SUPPORTED branch (fails on Linux x86_64). - diskann_index.cc !DISKANN_SUPPORTED fallback still defining CreateAndInitStreamer()/GenerateHolder() (fails on Intel macOS). Align both to the snake_case declarations in index.h.
The rename and merge-resolution edits left continuation-line alignment and wrapping that violated clang-format, failing the lint CI. Reformat the affected sources, headers, tools, and tests to satisfy the repository's clang-format 18.1.8 style.
The readability-identifier-naming sweep ran on macOS arm64, so Linux- and RABITQ-guarded paths were inactive and kept stale CamelCase references to renamed symbols, breaking Linux/x86 compilation: - src/db/common/cgroup_util: rename Linux-only methods read_proc_stat, read_memory_usage_cgroup, read_memory_usage_proc, calculate_linux_cpu_usage and update extract_memory_value call sites in the PLATFORM_LINUX block. - src/core/algorithm/hnsw_rabitq: update stg->is_huge_page() call sites in hnsw_rabitq_chunk.cc and hnsw_rabitq_streamer_entity.cc (RABITQ_SUPPORTED=1).
x86/Linux/RABITQ-only paths were not compiled during the arm64 sweep, so clang-tidy on Linux x86 flagged legitimate names the sweep never saw: - matrix_utility.i: exempt x86 SIMD helpers (Operation_TYPE_WIDTH convention). - libaio_def.h / iouring_def.h: exempt structs/enums copied verbatim from the Linux kernel ABI, which must keep their upstream names. - inverted_search_result.h (AND/OR) and segment.h (Delete): move the NOLINT onto NOLINTNEXTLINE above each declaration so it lands on the flagged line; these keep upper-case names because and/or/delete are C++ keywords. - hnsw_rabitq_chunk.h: NOLINT the on-disk CHUNK_TYPE enum tag.
…pt generated files in clang-tidy CI Fix modernize-use-equals-delete/default, use-override, and bugprone-sizeof violations in RaBitQ, libaio, and SIMD headers exposed by the broadened HeaderFilterRegex. Rename local index_meta_ptr_ to satisfy identifier-naming. Skip auto-generated files (antlr/gen, fts_column/gen) in the compile_commands filter step so generated code is never analyzed, without editing those files.
…tics Rename PascalCase fixture helpers in collection_test.cc to snake_case and fix undeclared-identifier errors in write_recovery_test.cc (both from merged main). Drop generated-header diagnostics that leak into clang-tidy via #include from non-generated main files, since those headers are exempt and uneditable.
Avoid shadowing matrix dimensions with the transpose loop index and update Windows cleanup calls to the renamed helper. Surface Arrow sub-build errors in CI logs.
richyreachy
approved these changes
Sep 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
readability-identifier-naming(Google-style base with project tweaks) across sources, tests, and tools — including headers.fts_column/gen,sqlengine/antlr/gen) via local.clang-tidyoverrides.Rules
snake_case.snake_caseORUpperCamelCase.snake_case(trailing_not required).snake_case.Notes
snake_casename or qualifying member calls withthis->.readability-identifier-namingre-scan reporting 0 violations. Unit tests were not run.Test plan