Skip to content

Conversation

@HuaHuaY
Copy link
Contributor

@HuaHuaY HuaHuaY commented Nov 11, 2025

HeaderFilterRegex is a whitelist to determine info of which header file will be reported by clang-tidy.

  --header-filter=<string>        - Regular expression matching the names of the
                                    headers to output diagnostics from. Diagnostics
                                    from the main file of each translation unit are
                                    always displayed.
                                    Can be used together with -line-filter.
                                    This option overrides the 'HeaderFilterRegex'
                                    option in .clang-tidy file, if any.

Previous config HeaderFilterRegex: '(?!_deps)(src|test|example)' can filter build/_deps/nlohmann_json-src, but it is an illegal syntax in clang-tidy's regex engine. It seems that clang-tidy doesn't support negative lookahead. Forgive me for using 'seems', I have only found too little information about clang-tidy's regex syntax. And in fact I still haven't figured out how it works. And there are also some bugs in clang-tidy, see llvm/llvm-project#138302.

Clang-tidy 19 supports a new feature ExcludeHeaderFilterRegex but we use version 18 as default. So we can only find another way to filter build/_deps/nlohmann_json-src.

@wgtmac wgtmac merged commit f8323d2 into apache:main Nov 12, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants