Skip to content

QL: Autoformat test files#22232

Open
redsun82 wants to merge 1 commit into
mainfrom
redsun82-autoformat-ql-test-files
Open

QL: Autoformat test files#22232
redsun82 wants to merge 1 commit into
mainfrom
redsun82-autoformat-ql-test-files

Conversation

@redsun82

Copy link
Copy Markdown
Contributor

This autoformats seven QL test files that were left unformatted by commit 4ad3a44 ("QL: Convert qlref tests to inline expectations").

The inline expectation comments introduced there were not run through formatter output, which causes the Check Autoformatting CI job in semmle-code to fail.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: b14eb21f-33ec-4f61-b650-823abc8940aa
Copilot AI review requested due to automatic review settings July 24, 2026 07:50
@redsun82
redsun82 requested a review from a team as a code owner July 24, 2026 07:50

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

Autoformats seven QL test fixtures by moving trailing inline-expectation comments. However, the moved markers no longer share lines with their expected alerts.

Changes:

  • Reformats $ Alert comments.
  • Adjusts spacing around affected declarations.
Show a summary per file
File Description
UseInstanceofExtension/Foo.qll Reformats four alert markers.
NonDocBlock/Foo.qll Reformats two alert markers.
Misspelling/Test.qll Reformats class alert markers.
DeadCode/Foo.qll Reformats a module alert marker.
DataFlowConfigModuleNaming/Test.qll Reformats module alert markers.
AcronymsShouldBeCamelCase/Test.qll Reformats a newtype alert marker.
MissingNoInline/Test.qll Reformats a predicate alert marker.

Review details

Comments suppressed due to low confidence (6)

ql/ql/test/queries/style/UseInstanceofExtension/Foo.qll:17

  • This marker is on line 17, but the Inst2 alert is located on the declaration at line 16. Because QL inline expectations match the line comment location only to results on the same line, this marker no longer validates the alert.
  // $ Alert

ql/ql/test/queries/style/UseInstanceofExtension/Foo.qll:24

  • This marker is on line 24, while the Inst3 alert remains on declaration line 23. The QL inline-expectation postprocessor only matches comments and results on the same line, so this becomes an unmatched expectation.
  // $ Alert

ql/ql/test/queries/style/UseInstanceofExtension/Foo.qll:33

  • This marker is now one line below the Inst4 result location. QL inline expectations compare the line comment's own line with the alert line, so the postprocessor will report this expectation as missing and the declaration alert as unexpected.
  // $ Alert

ql/ql/test/queries/style/NonDocBlock/Foo.qll:12

  • Moving this marker to line 12 separates it from the reported block comment on line 11. Since the QL inline-expectation postprocessor only matches results on the marker's exact line, this expectation will fail.
// $ Alert

ql/ql/test/queries/style/Misspelling/Test.qll:21

  • This marker is one line below the AnalysedInt declaration that carries the alert location. Exact same-line matching in the QL inline-expectation postprocessor means the marker and result will not pair.
  // $ Alert

ql/ql/test/queries/style/DataFlowConfigModuleNaming/Test.qll:20

  • The EmptyFlow result is located on line 19 and this marker is on line 20. Exact same-line matching in the QL inline-expectation postprocessor leaves both the expectation and result unmatched.
  // $ Alert
  • Files reviewed: 7/7 changed files
  • Comments generated: 7
  • Review effort level: Medium


class Inst extends string { // $ Alert
class Inst extends string {
// $ Alert
*/ // $ Alert
*/

// $ Alert
*/ // $ Alert
class PublicallyAccessible extends string { // $ Alert
class PublicallyAccessible extends string {
// $ Alert

private module Input2 implements InputSig { // $ Alert
private module Input2 implements InputSig {
// $ Alert
// BAD - does not end with "Config"
module EmptyConfiguration implements DataFlow::ConfigSig { // $ Alert
module EmptyConfiguration implements DataFlow::ConfigSig {
// $ Alert
// BAD
newtype TXMLElements = // $ Alert
newtype TXMLElements =
// $ Alert
*/
predicate missingNoInline(AddExpr add, Expr e1, Expr e2) { // $ Alert
predicate missingNoInline(AddExpr add, Expr e1, Expr e2) {
// $ Alert
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.

2 participants