Update CodeQL config to exclude generated code and documented catches - #24
Merged
Merged
Conversation
- Add paths-ignore for obj/bin build output to .github/codeql-config.yml. - Exclude cs/missed-ternary-operator for xUnit-generated entry-point files under obj/, which cannot be hand-modified. - Exclude cs/catch-of-all-exceptions for 7 files whose broad catches were already reviewed and documented as intentional UI event-handler/ drag-drop/best-effort boundaries in the prior CodeQL cleanup (narrowing them would contradict their documented never-crash contracts). Mirrors the established pattern in ApiMark's .github/codeql-config.yml. - Fix xUnit2032 in DockTests.cs: Assert.IsAssignableFrom -> Assert.IsType with exactMatch: false (functionally identical, clearer intent). Validated: dotnet build (0 warnings/errors), build.ps1 -Test (290/290 passed), dotnet reqstream --lint (clean). Reviewed via a code-review agent which confirmed all excluded catch sites are the documented intentional ones with no mixed/undocumented sites. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
This pull request introduces improvements to static analysis configuration and a minor test code update. The most significant changes are the addition of global ignores and targeted query suppressions in the CodeQL configuration, which help reduce noise from generated code and intentional design decisions, and a refinement to a unit test assertion.
CodeQL configuration improvements:
paths-ignoresection to.github/codeql-config.ymlto globally exclude build output and generated files (e.g.,obj/andbin/folders) from analysis.query-filtersin.github/codeql-config.ymlto:cs/missed-ternary-operatorwarning in xUnit-generated files underobj/.cs/catch-of-all-exceptionswarning in specific files where broad exception handling is intentional and documented, per project policy.Test code update:
RestoreDockable_ReopensClosedToolInOriginalDockinDockTests.csto useAssert.IsType<IToolDock>(..., exactMatch: false)for more precise type checking.