Add passing and failing tests for IncludeGuardsNotUsed exclusion check feedback - #1195
Merged
mbaluda merged 3 commits intoSep 4, 2026
Merged
Conversation
30 tasks
Co-authored-by: mbaluda <5237080+mbaluda@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] [WIP] Add passing and failing tests for IncludeGuardsNotUsed exclusion check feedback
Add passing and failing tests for IncludeGuardsNotUsed exclusion check feedback
Sep 4, 2026
mbaluda
marked this pull request as ready for review
September 4, 2026 18:16
mbaluda
approved these changes
Sep 4, 2026
mbaluda
approved these changes
Sep 4, 2026
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
One changed C++ test line exceeds the mandatory 100-character limit.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Adds C and C++ regression coverage for IncludeGuardsNotUsed exclusion handling.
Changes:
- Adds excluded and non-excluded header fixtures.
- Adds deviation configurations using the test rule ID.
- Updates expected alerts. No change note is required for test-only changes.
File summaries
| File | Description |
|---|---|
cpp/common/test/rules/includeguardsnotused/test.cpp |
Includes new C++ fixtures. |
cpp/common/test/rules/includeguardsnotused/IncludeGuardsNotUsed.expected |
Adds the non-excluded C++ alert. |
cpp/common/test/rules/includeguardsnotused/headers/test7.hpp |
Adds the failing C++ fixture. |
cpp/common/test/rules/includeguardsnotused/headers/excluded/test7.hpp |
Adds the excluded C++ fixture. |
cpp/common/test/rules/includeguardsnotused/headers/excluded/coding-standards.yml |
Configures the C++ deviation. |
cpp/common/test/rules/includeguardsnotused/headers/excluded/coding-standards.xml |
Adds generated C++ deviation data. |
c/common/test/rules/includeguardsnotused/test.c |
Includes new C fixtures. |
c/common/test/rules/includeguardsnotused/IncludeGuardsNotUsed.expected |
Adds the non-excluded C alert. |
c/common/test/rules/includeguardsnotused/headers/test8.h |
Adds the failing C fixture. |
c/common/test/rules/includeguardsnotused/headers/excluded/test8.h |
Adds the excluded C fixture. |
c/common/test/rules/includeguardsnotused/headers/excluded/coding-standards.yml |
Configures the C deviation. |
c/common/test/rules/includeguardsnotused/headers/excluded/coding-standards.xml |
Adds generated C deviation data. |
Review details
- Files reviewed: 12/12 changed files
- Comments generated: 1
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
mbaluda
approved these changes
Sep 4, 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.
Description
Addresses review feedback on #1194 (#1194 (comment)) by adding a passing and a failing test that exercise the
not isExcluded(file, getQuery())check added to the sharedIncludeGuardsNotUsedquery.For both the C and C++ variants of the shared query test:
headers/test7.hpp/headers/test8.h), which still alerts (failing/NON_COMPLIANT case).headers/excluded/(headers/excluded/test7.hpp/headers/excluded/test8.h), together with acoding-standards.yml(and generatedcoding-standards.xml) deviation record targeting the test harness'sTestQueryrule id, so its alert is suppressed viaisExcluded(passing/COMPLIANT case)..expectedfiles.Verified locally with
codeql test runthat both tests pass, and that temporarily reverting thenot isExcluded(...)check causes both new tests to fail, confirming they correctly exercise the exclusion behavior.Original PR: #1194
Change request type
.ql,.qll,.qlsor unit tests)Rules with added or modified queries
Release change checklist
A change note (development_handbook.md#change-notes) is required for any pull request which modifies:
If you are only adding new rule queries, a change note is not required.
Author: Is a change note required?
🚨