Code Quality: Customizing directories to scan #186446
Replies: 2 comments
-
|
GitHub Code Quality doesn’t respect linguist-generated, [GeneratedCode] / [CompilerGenerated] attributes, filename patterns like *.g.cs, or custom include/exclude paths. Those work for Linguist and Code Scanning, but Code Quality currently analyzes all detected source files without configurable suppression for generated code. If the warnings are coming from generated files, the only real workarounds today are excluding those files from the repo (or generating them in CI), moving them elsewhere, or using Code Scanning where path exclusions are supported. |
Beta Was this translation helpful? Give feedback.
-
|
@bgrainger thank you for this feedback! Being able to customize directories/files to scan is on our roadmap for Code Quality, looking to start working on it later this year. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Select Topic Area
Question
Body
I've turned on GitHub Code Quality (https://github.com/orgs/community/discussions/177488) for an internal repo. The code is in C#, which was automatically detected. However, there are lots of warnings logged from
*.g.csfiles (generated code), which are not directly actionable (except by fixing the code generator, which is a different project)..gitattributeshas this:The files themselves have this:
This attribute documentation says it "can be used by code analysis tools to identify computer-generated code".
I would like the presence of metadata indicating tool-generated code to cause warnings in the code to be suppressed (or an option to ignore them).
Failing that, because the file name is
*.g.cs, another solution would be to allow customizing the paths to scan in, as is possible for Code Scanning: https://docs.github.com/en/code-security/how-tos/scan-code-for-vulnerabilities/configure-code-scanning/customizing-your-advanced-setup-for-code-scanning#specifying-directories-to-scanBeta Was this translation helpful? Give feedback.
All reactions