Skip to content

Commit 08c658e

Browse files
committed
Go: Autoformat
1 parent a5d2299 commit 08c658e

File tree

10 files changed

+44
-22
lines changed

10 files changed

+44
-22
lines changed

go/ql/lib/semmle/go/Files.qll

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,8 @@ class Folder extends Container, @folder {
183183

184184
/** Any file, including files that have not been extracted but are referred to as locations for errors. */
185185
class ExtractedOrExternalFile extends Container, @file, Documentable, ExprParent, GoModExprParent,
186-
DeclParent, ScopeNode {
186+
DeclParent, ScopeNode
187+
{
187188
override Location getLocation() { has_location(this, result) }
188189

189190
override string getAbsolutePath() { files(this, result) }

go/ql/lib/semmle/go/StringOps.qll

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,8 @@ module StringOps {
228228
* the receiver of a call to `strings.Replacer.Replace` or
229229
* `strings.Replacer.WriteString`.
230230
*/
231-
private class StringsNewReplacerConfiguration extends DataFlowForStringsNewReplacer::Configuration {
231+
private class StringsNewReplacerConfiguration extends DataFlowForStringsNewReplacer::Configuration
232+
{
232233
StringsNewReplacerConfiguration() { this = "StringsNewReplacerConfiguration" }
233234

234235
override predicate isSource(DataFlow::Node source) {

go/ql/lib/semmle/go/frameworks/Chi.qll

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ private module Chi {
2121
* Methods that extract URL parameters, considered as a source of untrusted flow.
2222
*/
2323
private class UserControlledRequestMethod extends UntrustedFlowSource::Range,
24-
DataFlow::MethodCallNode {
24+
DataFlow::MethodCallNode
25+
{
2526
UserControlledRequestMethod() {
2627
this.getTarget().hasQualifiedName(packagePath(), "Context", "URLParam")
2728
}

go/ql/lib/semmle/go/frameworks/Encoding.qll

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ private string packagePath() { result = package("github.com/json-iterator/go", "
99

1010
/** A model of json-iterator's `Unmarshal` function, propagating taint from the JSON input to the decoded object. */
1111
private class JsonIteratorUnmarshalFunction extends TaintTracking::FunctionModel,
12-
UnmarshalingFunction::Range {
12+
UnmarshalingFunction::Range
13+
{
1314
JsonIteratorUnmarshalFunction() {
1415
this.hasQualifiedName(packagePath(), ["Unmarshal", "UnmarshalFromString"])
1516
or

go/ql/lib/semmle/go/frameworks/K8sIoApiCoreV1.qll

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ module K8sIoApiCoreV1 {
2828
}
2929

3030
private class SecretMarshal extends TaintTracking::FunctionModel, Method,
31-
MarshalingFunction::Range {
31+
MarshalingFunction::Range
32+
{
3233
SecretMarshal() { this.hasQualifiedName(packagePath(), ["Secret", "SecretList"], "Marshal") }
3334

3435
override DataFlow::FunctionInput getAnInput() { result.isReceiver() }
@@ -43,7 +44,8 @@ module K8sIoApiCoreV1 {
4344
}
4445

4546
private class SecretUnmarshal extends TaintTracking::FunctionModel, Method,
46-
UnmarshalingFunction::Range {
47+
UnmarshalingFunction::Range
48+
{
4749
SecretUnmarshal() {
4850
this.hasQualifiedName(packagePath(), ["Secret", "SecretList"], "Unmarshal")
4951
}

go/ql/lib/semmle/go/frameworks/K8sIoApimachineryPkgRuntime.qll

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,8 @@ module K8sIoApimachineryPkgRuntime {
8585
}
8686

8787
private class CacheableObjectCacheEncode extends TaintTracking::FunctionModel, Method,
88-
MarshalingFunction::Range {
88+
MarshalingFunction::Range
89+
{
8990
CacheableObjectCacheEncode() {
9091
this.implements(packagePath(), "CacheableObject", "CacheEncode")
9192
}
@@ -113,7 +114,8 @@ module K8sIoApimachineryPkgRuntime {
113114
}
114115

115116
private class DecoderDecode extends TaintTracking::FunctionModel, Method,
116-
UnmarshalingFunction::Range {
117+
UnmarshalingFunction::Range
118+
{
117119
DecoderDecode() {
118120
this.implements(packagePath(), "Decoder", "Decode") or
119121
this.hasQualifiedName(packagePath(), "WithoutVersionDecoder", "Decode")
@@ -134,7 +136,8 @@ module K8sIoApimachineryPkgRuntime {
134136
}
135137

136138
private class EncoderEncode extends TaintTracking::FunctionModel, Method,
137-
MarshalingFunction::Range {
139+
MarshalingFunction::Range
140+
{
138141
EncoderEncode() {
139142
this.implements(packagePath(), "Encoder", "Encode") or
140143
this.hasQualifiedName(packagePath(), "WithVersionEncoder", "Encode")
@@ -240,7 +243,8 @@ module K8sIoApimachineryPkgRuntime {
240243
}
241244

242245
private class ParameterCodecDecodeParameters extends TaintTracking::FunctionModel, Method,
243-
UnmarshalingFunction::Range {
246+
UnmarshalingFunction::Range
247+
{
244248
ParameterCodecDecodeParameters() {
245249
this.implements(packagePath(), "ParameterCodec", "DecodeParameters")
246250
}
@@ -260,7 +264,8 @@ module K8sIoApimachineryPkgRuntime {
260264
}
261265

262266
private class ParameterCodecEncodeParameters extends TaintTracking::FunctionModel, Method,
263-
MarshalingFunction::Range {
267+
MarshalingFunction::Range
268+
{
264269
ParameterCodecEncodeParameters() {
265270
this.implements(packagePath(), "ParameterCodec", "EncodeParameters")
266271
}
@@ -280,7 +285,8 @@ module K8sIoApimachineryPkgRuntime {
280285
}
281286

282287
private class ProtobufMarshallerMarshalTo extends TaintTracking::FunctionModel, Method,
283-
MarshalingFunction::Range {
288+
MarshalingFunction::Range
289+
{
284290
ProtobufMarshallerMarshalTo() {
285291
this.implements(packagePath(), "ProtobufMarshaller", "MarshalTo") or
286292
this.implements(packagePath(), "ProtobufReverseMarshaller", "MarshalToSizedBuffer")
@@ -316,7 +322,8 @@ module K8sIoApimachineryPkgRuntime {
316322
}
317323

318324
private class RawExtensionMarshal extends TaintTracking::FunctionModel, Method,
319-
MarshalingFunction::Range {
325+
MarshalingFunction::Range
326+
{
320327
RawExtensionMarshal() { this.hasQualifiedName(packagePath(), "RawExtension", "Marshal") }
321328

322329
override DataFlow::FunctionInput getAnInput() { result.isReceiver() }
@@ -331,7 +338,8 @@ module K8sIoApimachineryPkgRuntime {
331338
}
332339

333340
private class RawExtensionUnmarshal extends TaintTracking::FunctionModel, Method,
334-
UnmarshalingFunction::Range {
341+
UnmarshalingFunction::Range
342+
{
335343
RawExtensionUnmarshal() { this.hasQualifiedName(packagePath(), "RawExtension", "Unmarshal") }
336344

337345
override DataFlow::FunctionInput getAnInput() { result.isReceiver() }
@@ -364,7 +372,8 @@ module K8sIoApimachineryPkgRuntime {
364372
}
365373

366374
private class UnknownMarshal extends TaintTracking::FunctionModel, Method,
367-
MarshalingFunction::Range {
375+
MarshalingFunction::Range
376+
{
368377
string methodName;
369378

370379
UnknownMarshal() {
@@ -388,7 +397,8 @@ module K8sIoApimachineryPkgRuntime {
388397
}
389398

390399
private class UnknownUnmarshal extends TaintTracking::FunctionModel, Method,
391-
UnmarshalingFunction::Range {
400+
UnmarshalingFunction::Range
401+
{
392402
UnknownUnmarshal() { this.hasQualifiedName(packagePath(), "Unknown", "Unmarshal") }
393403

394404
override DataFlow::FunctionInput getAnInput() { result.isReceiver() }

go/ql/lib/semmle/go/frameworks/Revel.qll

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ module Revel {
2020
}
2121

2222
private class ParamsFixedSanitizer extends TaintTracking::DefaultTaintSanitizer,
23-
DataFlow::FieldReadNode {
23+
DataFlow::FieldReadNode
24+
{
2425
ParamsFixedSanitizer() {
2526
exists(Field f |
2627
this.readsField(_, f) and
@@ -48,7 +49,8 @@ module Revel {
4849

4950
/** An access to an HTTP request field whose value may be controlled by an untrusted user. */
5051
private class UserControlledRequestField extends UntrustedFlowSource::Range,
51-
DataFlow::FieldReadNode {
52+
DataFlow::FieldReadNode
53+
{
5254
UserControlledRequestField() {
5355
exists(string fieldName |
5456
this.getField().hasQualifiedName(packagePath(), "Request", fieldName)
@@ -61,7 +63,8 @@ module Revel {
6163
}
6264

6365
private class UserControlledRequestMethod extends UntrustedFlowSource::Range,
64-
DataFlow::MethodCallNode {
66+
DataFlow::MethodCallNode
67+
{
6568
UserControlledRequestMethod() {
6669
this.getTarget()
6770
.hasQualifiedName(packagePath(), "Request",

go/ql/lib/semmle/go/frameworks/stdlib/NetHttp.qll

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ import go
88
module NetHttp {
99
/** An access to an HTTP request field whose value may be controlled by an untrusted user. */
1010
private class UserControlledRequestField extends UntrustedFlowSource::Range,
11-
DataFlow::FieldReadNode {
11+
DataFlow::FieldReadNode
12+
{
1213
UserControlledRequestField() {
1314
exists(string fieldName | this.getField().hasQualifiedName("net/http", "Request", fieldName) |
1415
fieldName =

go/ql/lib/semmle/go/frameworks/stdlib/TextTemplate.qll

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ module TextTemplate {
2525
}
2626

2727
private class TextTemplateInstantiation extends TemplateInstantiation::Range,
28-
DataFlow::MethodCallNode {
28+
DataFlow::MethodCallNode
29+
{
2930
int dataArg;
3031

3132
TextTemplateInstantiation() {

go/ql/lib/semmle/go/security/CleartextLoggingCustomizations.qll

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,8 @@ module CleartextLogging {
183183
override string describe() { result = "HTTP request headers" }
184184
}
185185

186-
private class KubernetesSecretInterfaceSource extends Source, K8sIoClientGo::SecretInterfaceSource {
186+
private class KubernetesSecretInterfaceSource extends Source, K8sIoClientGo::SecretInterfaceSource
187+
{
187188
override string describe() { result = "Kubernetes Secret" }
188189
}
189190

0 commit comments

Comments
 (0)