Format test QL libaries with codeql query format#22074
Closed
mario-campos wants to merge 1 commit into
Closed
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR reformats several QL test .qll files using codeql query format, primarily by moving // $ Alert markers onto their own lines immediately after the relevant declarations.
Changes:
- Reformatted style/performance test inputs to place
// $ Alertcomments on separate lines. - Adjusted indentation/line breaks to match formatter output across multiple test cases.
Show a summary per file
| File | Description |
|---|---|
| ql/ql/test/queries/style/UseInstanceofExtension/Foo.qll | Moves $ Alert markers to standalone lines for readability in this style test input. |
| ql/ql/test/queries/style/NonDocBlock/Foo.qll | Separates $ Alert markers from block comment terminators in this style test input. |
| ql/ql/test/queries/style/Misspelling/Test.qll | Moves $ Alert markers to their own lines in this misspelling style test input. |
| ql/ql/test/queries/style/DeadCode/Foo.qll | Places $ Alert marker on its own line in the Input2 module declaration. |
| ql/ql/test/queries/style/DataFlowConfigModuleNaming/Test.qll | Moves $ Alert markers to standalone lines in config-module naming style tests. |
| ql/ql/test/queries/style/AcronymsShouldBeCamelCase/Test.qll | Places $ Alert marker on its own line under the newtype declaration. |
| ql/ql/test/queries/performance/MissingNoInline/Test.qll | Places $ Alert marker on its own line under the predicate declaration. |
Review details
- Files reviewed: 7/7 changed files
- Comments generated: 6
- Review effort level: Low
Comment on lines
+7
to
9
| class Inst extends string { | ||
| // $ Alert | ||
| Range range; |
Comment on lines
1
to
6
| /* | ||
| * This should be QLDoc. | ||
| */ // $ Alert | ||
| */ | ||
|
|
||
| // $ Alert | ||
| /** |
Comment on lines
+4
to
6
| class PublicallyAccessible extends string { | ||
| // $ Alert | ||
| int numOccurences; // $ Alert // should be 'occurrences' |
Comment on lines
+46
to
49
| private module Input2 implements InputSig { | ||
| // $ Alert | ||
| predicate foo() { any() } | ||
| } |
Comment on lines
10
to
13
| // BAD - does not end with "Config" | ||
| module EmptyConfiguration implements DataFlow::ConfigSig { // $ Alert | ||
| module EmptyConfiguration implements DataFlow::ConfigSig { | ||
| // $ Alert | ||
| predicate isSource(DataFlow::Node src) { none() } |
Comment on lines
7
to
11
| // BAD | ||
| newtype TXMLElements = // $ Alert | ||
| newtype TXMLElements = | ||
| // $ Alert | ||
| TXmlElement() or // GOOD | ||
| TXMLElement() // $ Alert // BAD |
hvitved
requested changes
Jun 29, 2026
hvitved
left a comment
Contributor
There was a problem hiding this comment.
This will not work; the $ Alert comment markers need to be exactly on the line where an alert is expected.
Contributor
Author
|
Oh, that's unfortunate. Thanks @hvitved! |
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 makes formats several QL test files via
codeql query format. The main change is moving$ Alertcomments onto their own lines immediately after the relevant declarations, improving code readability and consistency.No functional changes were made; only comment placement was adjusted.