Skip to content

fix(clang-tidy): Accept both slashes so we can get the header diagnostics on Windows and Unix - #3225

Open
CryoTheRenegade wants to merge 2 commits into
TheSuperHackers:mainfrom
CryoTheRenegade:fix/clang-tidy-headers
Open

fix(clang-tidy): Accept both slashes so we can get the header diagnostics on Windows and Unix#3225
CryoTheRenegade wants to merge 2 commits into
TheSuperHackers:mainfrom
CryoTheRenegade:fix/clang-tidy-headers

Conversation

@CryoTheRenegade

Copy link
Copy Markdown

The old clang tidy config file ignored / file paths, so when running to check for diagnostics, it failed to find any headers on Windows (i.e Core\Include\Common/Foo.h).
This fixes that and adds an ExcludeHeader regex for the MaxSDK and and _deps so we aren't chasing our tails for stuff outside of the repo.

…tics on Windows and Unix

Signed-off-by: Jacob Ledbetter <jledbetter460@gmail.com>
@qodo-free-for-open-source-projects

Copy link
Copy Markdown

PR Summary by Qodo

Fix cross-platform clang-tidy header diagnostic filtering

🐞 Bug fix ⚙️ Configuration changes 🕐 Less than 5 minutes

Grey Divider

AI Description

• Accepts Windows and Unix path separators when selecting project headers for clang-tidy
 diagnostics.
• Excludes MaxSDK and dependency build headers to avoid diagnostics for external code.
Diagram

graph TD
  A["Header paths"] --> B{"Project path?"} -->|Yes| C{"External tree?"} -->|No| D["Header diagnostics"]
  B -->|No| E["Diagnostics skipped"]
  C -->|Yes| E
Loading
High-Level Assessment

Using clang-tidy's native include and exclude header regexes is the most direct approach. Normalizing paths before analysis would require unnecessary wrapper tooling and would not improve this localized configuration fix.

Files changed (1) +4 / -2

Bug fix (1) +4 / -2
.clang-tidyMake header diagnostics cross-platform and exclude external trees +4/-2

Make header diagnostics cross-platform and exclude external trees

• Updates the project header filter to recognize both forward and backward path separators. Adds an exclusion filter for MaxSDK and _deps headers so clang-tidy reports diagnostics only for repository-owned code.

.clang-tidy

@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Aug 27, 2026

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)

Grey Divider


Action required

1. Relative headers remain excluded ✓ Resolved 🐞 Bug ≡ Correctness
Description
HeaderFilterRegex now requires / or \ immediately before Core, Generals, or
Dependencies, so the documented diagnostic path Core\Include\Common\Foo.h cannot match because
Core starts at the beginning of the string. This also regresses equivalent relative Unix paths
such as Core/Include/Common/Foo.h.
Code

.clang-tidy[92]

+HeaderFilterRegex: '[/\\](Core|GeneralsMD|Generals|Dependencies)[/\\].*\.(h|hpp)$'
Evidence
The adjacent comment names Core\Include\Common\Foo.h as the path that must be accepted, while the
added regex begins with [/\\]; that mandatory first token cannot match the start of this relative
path.

.clang-tidy[90-93]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The header filter requires a path separator before each project directory, so relative diagnostic paths beginning directly with `Core`, `Generals`, `GeneralsMD`, or `Dependencies` are dropped.
## Issue Context
The comment's motivating Windows example is `Core\Include\Common\Foo.h`, which has no leading separator. Preserve support for absolute paths and both separator styles while also matching at the beginning of the path.
## Fix Focus Areas
- .clang-tidy[90-92]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Tip of the day
💡 Did you know, you can ask Qodo to dismiss a finding you disagree with, with your reason on record

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

Comment thread .clang-tidy Outdated
@greptile-apps

greptile-apps Bot commented Aug 27, 2026

Copy link
Copy Markdown

Greptile Summary

The PR updates clang-tidy header filtering to recognize project headers expressed with either path separator and with relative or absolute paths.

  • Adds a start-of-string boundary so relative project paths are included.
  • Excludes headers beneath MaxSDK and _deps.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
.clang-tidy The revised regex addresses the previously reported relative-path omission while supporting Unix and Windows separators.

Reviews (2): Last reviewed commit: "fix(clang-tidy): Match relative header p..." | Re-trigger Greptile

Comment thread .clang-tidy Outdated
Require slash-or-start before Core/Generals/Dependencies so both
Core\Include\Foo.h and ...\Core\Include\Foo.h match. The previous
pattern required a separator before the project root and dropped
relative Windows and Unix paths.

Co-authored-by: Cursor <cursoragent@cursor.com>
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.

1 participant