From 3956fcc8365e0a6ec2a82968b021ead5262b86a2 Mon Sep 17 00:00:00 2001 From: Hanif Koh Date: Fri, 2 Oct 2026 03:31:10 +0800 Subject: [PATCH] Match Windows Paths in the clang-tidy Ignore List Header paths use backslashes on Windows, so every / in a pattern is now [/\\]. The Windows SDK headers are ignored alongside the other OS-specific ones, and the list is one pattern per line. Suggested by @raistlin7447 from a Windows clang-cl run. --- .clang-tidy | 37 +++++++++++++++++++++++++++++++++---- 1 file changed, 33 insertions(+), 4 deletions(-) diff --git a/.clang-tidy b/.clang-tidy index fe34f6ad71..a670e9e1b1 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -12,7 +12,36 @@ CheckOptions: # admesh's stl.h, which the include path also exposes without its directory. # FFmpeg's C headers are left alone because they are only included inside # extern "C", which an inserted include would miss. OS-specific headers (GLib, - # GTK, D-Bus, POSIX) are only used inside platform #if blocks, and an include - # added at the top of the file would break the other platforms' builds. - # A symbol these provide is not reported missing. - misc-include-cleaner.IgnoreHeaders: 'wx/(gtk|gtk1|msw|osx|unix|x11|motif|univ|qt|dfb|generic|private)/.*;.*/detail/.*;.*/impl/.*;.*_fwd\.hpp;python3\.[0-9]+/.*;bits/.*;imconfig\.h;expat_external\.h;admesh/stl\.h;boost/thread/(pthread|win32)/.*;boost/regex/v[0-9]+/.*;curl/(easy|multi|system|urlapi|header|options|websockets|mprintf)\.h;oneapi/tbb/.*;opencv2/core/hal/.*;openssl/ossl_typ\.h;libav[a-z]+/.*;libsw[a-z]+/.*;glib-2\.0/.*;gtk-3\.0/.*;dbus-1\.0/.*;sys/.*;unistd\.h;strings\.h;fcntl\.h;termios\.h' + # GTK, D-Bus, POSIX, the Windows SDK) are only used inside platform #if blocks, + # and an include added at the top of the file would break the other platforms' + # builds. A symbol these provide is not reported missing. + # Write every / as [/\\] so the patterns also match Windows paths. + # No comments inside the block below, because a # there silently becomes part of a pattern. + misc-include-cleaner.IgnoreHeaders: >- + wx[/\\](gtk|gtk1|msw|osx|unix|x11|motif|univ|qt|dfb|generic|private)[/\\].*; + .*[/\\]detail[/\\].*; + .*[/\\]impl[/\\].*; + .*_fwd\.hpp; + python3\.[0-9]+[/\\].*; + bits[/\\].*; + imconfig\.h; + expat_external\.h; + admesh[/\\]stl\.h; + boost[/\\]thread[/\\](pthread|win32)[/\\].*; + boost[/\\]regex[/\\]v[0-9]+[/\\].*; + curl[/\\](easy|multi|system|urlapi|header|options|websockets|mprintf)\.h; + oneapi[/\\]tbb[/\\].*; + opencv2[/\\]core[/\\]hal[/\\].*; + openssl[/\\]ossl_typ\.h; + libav[a-z]+[/\\].*; + libsw[a-z]+[/\\].*; + glib-2\.0[/\\].*; + gtk-3\.0[/\\].*; + dbus-1\.0[/\\].*; + sys[/\\].*; + unistd\.h; + strings\.h; + fcntl\.h; + termios\.h; + [/\\](um|shared)[/\\].*; + sal\.h