Skip to content

Commit 5cb3480

Browse files
committed
Format test QL libaries with codeql query format
1 parent da3d0cf commit 5cb3480

7 files changed

Lines changed: 26 additions & 13 deletions

File tree

ql/ql/test/queries/performance/MissingNoInline/Test.qll

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ import ql
55
*
66
* This predicate exists to fix a join order.
77
*/
8-
predicate missingNoInline(AddExpr add, Expr e1, Expr e2) { // $ Alert
8+
predicate missingNoInline(AddExpr add, Expr e1, Expr e2) {
9+
// $ Alert
910
// BAD
1011
add.getLeftOperand() = e1 and
1112
add.getRightOperand() = e2

ql/ql/test/queries/style/AcronymsShouldBeCamelCase/Test.qll

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ predicate isXML() { any() } // $ Alert
55
predicate isAES() { any() }
66

77
// BAD
8-
newtype TXMLElements = // $ Alert
8+
newtype TXMLElements =
9+
// $ Alert
910
TXmlElement() or // GOOD
1011
TXMLElement() // $ Alert // BAD
1112

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,16 @@ module EmptyConfig implements DataFlow::ConfigSig {
88
}
99

1010
// BAD - does not end with "Config"
11-
module EmptyConfiguration implements DataFlow::ConfigSig { // $ Alert
11+
module EmptyConfiguration implements DataFlow::ConfigSig {
12+
// $ Alert
1213
predicate isSource(DataFlow::Node src) { none() }
1314

1415
predicate isSink(DataFlow::Node sink) { none() }
1516
}
1617

1718
// BAD - does not end with "Config"
18-
module EmptyFlow implements DataFlow::ConfigSig { // $ Alert
19+
module EmptyFlow implements DataFlow::ConfigSig {
20+
// $ Alert
1921
predicate isSource(DataFlow::Node src) { none() }
2022

2123
predicate isSink(DataFlow::Node sink) { none() }

ql/ql/test/queries/style/DeadCode/Foo.qll

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ private module Input1 implements InputSig {
4343
predicate foo() { any() }
4444
}
4545

46-
private module Input2 implements InputSig { // $ Alert
46+
private module Input2 implements InputSig {
47+
// $ Alert
4748
predicate foo() { any() }
4849
}
4950

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
/**
22
* A string that's deliberately mispelled (and so is that last word).
33
*/ // $ Alert
4-
class PublicallyAccessible extends string { // $ Alert
4+
class PublicallyAccessible extends string {
5+
// $ Alert
56
int numOccurences; // $ Alert // should be 'occurrences'
67

78
PublicallyAccessible() { this = "publically" and numOccurences = 123 }
@@ -16,7 +17,8 @@ class PublicallyAccessible extends string { // $ Alert
1617
* A class whose name contains a British-English spelling.
1718
* And here's the word 'colour'.
1819
*/ // $ Alert
19-
class AnalysedInt extends int { // $ Alert
20+
class AnalysedInt extends int {
21+
// $ Alert
2022
AnalysedInt() { this = 7 }
2123

2224
// 'analyses' should not be flagged

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
/*
22
* This should be QLDoc.
3-
*/ // $ Alert
3+
*/
44

5+
// $ Alert
56
/**
67
* this is fine
78
*/
89
predicate foo() { any() }
910

10-
/* Note: this is bad. */ // $ Alert
11+
/* Note: this is bad. */
12+
// $ Alert
1113
class Foo extends string {
1214
Foo() { this = "FOo" }
1315
}

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

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,32 @@ class Range extends string {
44
string getAChild() { result = "test" }
55
}
66

7-
class Inst extends string { // $ Alert
7+
class Inst extends string {
8+
// $ Alert
89
Range range;
910

1011
Inst() { this = range }
1112

1213
string getAChild() { result = range.getAChild() }
1314
}
1415

15-
class Inst2 extends string { // $ Alert
16+
class Inst2 extends string {
17+
// $ Alert
1618
Inst2() { this instanceof Range }
1719

1820
string getAChild() { result = this.(Range).getAChild() }
1921
}
2022

21-
class Inst3 extends string { // $ Alert
23+
class Inst3 extends string {
24+
// $ Alert
2225
Range range;
2326

2427
Inst3() { this = range }
2528

2629
Range getRange() { result = range }
2730
}
2831

29-
class Inst4 extends string { // $ Alert
32+
class Inst4 extends string {
33+
// $ Alert
3034
Inst4() { this instanceof Range }
3135
}

0 commit comments

Comments
 (0)