Skip to content

Commit 46a645c

Browse files
authored
Merge pull request github#2956 from asger-semmle/js/autoformat-again
JS: Really autoformat everything
2 parents 228bd73 + e405a97 commit 46a645c

File tree

33 files changed

+81
-101
lines changed

33 files changed

+81
-101
lines changed

javascript/ql/examples/queries/dataflow/StoredXss/StoredXss.ql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ import DataFlow::PathGraph
2222
*/
2323
class MysqlSource extends StoredXss::Source {
2424
MysqlSource() {
25-
this = moduleImport("mysql")
25+
this =
26+
moduleImport("mysql")
2627
.getAMemberCall("createConnection")
2728
.getAMethodCall("query")
2829
.getCallback(1)

javascript/ql/src/semmle/javascript/security/dataflow/TaintedPathCustomizations.qll

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ module TaintedPath {
368368
* // pathname is safe
369369
* }
370370
* ```
371-
*
371+
*
372372
* or
373373
* ```
374374
* var relative = path.resolve(pathname); // or path.normalize
@@ -402,9 +402,13 @@ module TaintedPath {
402402
}
403403

404404
override predicate blocks(boolean outcome, Expr e) {
405-
member = "relative" and e = pathCall.getArgument(1).asExpr() and outcome = startsWith.getPolarity().booleanNot()
405+
member = "relative" and
406+
e = pathCall.getArgument(1).asExpr() and
407+
outcome = startsWith.getPolarity().booleanNot()
406408
or
407-
not member = "relative" and e = pathCall.getArgument(0).asExpr() and outcome = startsWith.getPolarity()
409+
not member = "relative" and
410+
e = pathCall.getArgument(0).asExpr() and
411+
outcome = startsWith.getPolarity()
408412
}
409413
}
410414

javascript/ql/test/library-tests/CallGraphs/AnnotatedTest/Test.ql

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,7 @@ class AnnotatedCall extends InvokeExpr {
3434

3535
AnnotatedFunction getAnExpectedCallee() { result.getCalleeName() = getCallTargetName() }
3636

37-
int getBoundArgs() {
38-
result = getAnnotation(this, "boundArgs").toInt()
39-
}
37+
int getBoundArgs() { result = getAnnotation(this, "boundArgs").toInt() }
4038

4139
int getBoundArgsOrMinusOne() {
4240
result = getBoundArgs()

javascript/ql/test/library-tests/Classes/tests.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ import ConstructorDefinitions
1717
import ClassNodeConstructor
1818
import ClassNodeInstanceMethod
1919
import PrivateField
20-
import ClassFlow
20+
import ClassFlow

javascript/ql/test/library-tests/CustomLoadStoreSteps/test.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class Configuration extends TaintTracking::Configuration {
1313

1414
// When the source code states that "foo" is being read, "bar" is additionally being read.
1515
override predicate isAdditionalLoadStep(DataFlow::Node pred, DataFlow::Node succ, string prop) {
16-
exists(DataFlow::PropRead read | read = succ |
16+
exists(DataFlow::PropRead read | read = succ |
1717
read.getBase() = pred and
1818
read.getPropertyName() = "foo"
1919
) and

javascript/ql/test/library-tests/DependencyModuleImports/Test.ql

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,8 @@ class SampleVersionSink extends DataFlow::Node {
3232
functionName = "m1" and
3333
argNumber = 0
3434
|
35-
this = DataFlow::dependencyModuleImport(dep)
36-
.getAMemberCall(functionName)
37-
.getArgument(argNumber) and
35+
this =
36+
DataFlow::dependencyModuleImport(dep).getAMemberCall(functionName).getArgument(argNumber) and
3837
dep.info(dependencyName, vDep) and
3938
vDep.maybeBetween(vFrom, vTo)
4039
)
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
import javascript
22

3-
query
4-
DataFlow::Node getBoundFunction(DataFlow::PartialInvokeNode invoke, DataFlow::Node callback, int boundArgs) {
3+
query DataFlow::Node getBoundFunction(
4+
DataFlow::PartialInvokeNode invoke, DataFlow::Node callback, int boundArgs
5+
) {
56
result = invoke.getBoundFunction(callback, boundArgs)
67
}
78

8-
query
9-
predicate isPartialArgument(DataFlow::PartialInvokeNode invoke, DataFlow::Node callback, DataFlow::Node argument, int index) {
9+
query predicate isPartialArgument(
10+
DataFlow::PartialInvokeNode invoke, DataFlow::Node callback, DataFlow::Node argument, int index
11+
) {
1012
invoke.isPartialArgument(callback, argument, index)
1113
}
1214

13-
query
14-
DataFlow::Node getBoundReceiver(DataFlow::PartialInvokeNode invoke) {
15+
query DataFlow::Node getBoundReceiver(DataFlow::PartialInvokeNode invoke) {
1516
result = invoke.getBoundReceiver()
1617
}
1718

18-
query
19-
DataFlow::Node clickEvent() {
19+
query DataFlow::Node clickEvent() {
2020
result = DataFlow::globalVarRef("addEventListener").getACall().getABoundCallbackParameter(1, 0)
2121
}

javascript/ql/test/library-tests/Promises/tests.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ import PromiseDefinition_getAResolveHandler
77
import PromiseDefinition_getRejectParameter
88
import PromiseDefinition_getResolveParameter
99
import PromiseDefinition_getACatchHandler
10-
import flow
10+
import flow

javascript/ql/test/library-tests/RangeAnalysis/DeadBranch.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ class AssertionComment extends LineComment {
2222
isOK = true and
2323
exists(ConditionGuardNode guard | guard = getAGuardNode() |
2424
RangeAnalysis::isContradictoryGuardNode(guard) and
25-
result = "Error: analysis claims " + getTestExpr() + " is always " +
26-
guard.getOutcome().booleanNot()
25+
result =
26+
"Error: analysis claims " + getTestExpr() + " is always " + guard.getOutcome().booleanNot()
2727
)
2828
or
2929
isOK = false and
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import javascript
22

33
from StringLiteral literal, RegExpDot dot, int pos
4-
where dot.getParent*() = literal
5-
and pos = dot.getLocation().getStartColumn() - literal.getLocation().getStartColumn()
4+
where
5+
dot.getParent*() = literal and
6+
pos = dot.getLocation().getStartColumn() - literal.getLocation().getStartColumn()
67
select dot, literal.getRawValue().charAt(pos)

0 commit comments

Comments
 (0)