Skip to content

Format test QL libaries with codeql query format#22074

Closed
mario-campos wants to merge 1 commit into
mainfrom
mario-campos/autoformat-ql-test-queries
Closed

Format test QL libaries with codeql query format#22074
mario-campos wants to merge 1 commit into
mainfrom
mario-campos/autoformat-ql-test-queries

Conversation

@mario-campos

Copy link
Copy Markdown
Contributor

This pull request makes formats several QL test files via codeql query format. The main change is moving $ Alert comments onto their own lines immediately after the relevant declarations, improving code readability and consistency.

No functional changes were made; only comment placement was adjusted.

@mario-campos mario-campos requested a review from a team June 29, 2026 03:48
@mario-campos mario-campos requested a review from a team as a code owner June 29, 2026 03:48
Copilot AI review requested due to automatic review settings June 29, 2026 03:48

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 // $ Alert comments 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
@mario-campos mario-campos removed the request for review from a team June 29, 2026 04:52

@hvitved hvitved left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will not work; the $ Alert comment markers need to be exactly on the line where an alert is expected.

@mario-campos

Copy link
Copy Markdown
Contributor Author

Oh, that's unfortunate. Thanks @hvitved!

@mario-campos mario-campos deleted the mario-campos/autoformat-ql-test-queries branch June 29, 2026 12:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants