Skip to content

Commit 4604e38

Browse files
Enabled and fixed issues for the rule SA1413. (#2013)
1 parent 866a802 commit 4604e38

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+579
-579
lines changed

lib/PuppeteerSharp.ruleset

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<Rule Id="SA1513" Action="None" /> <!-- Error SA1513: Closing brace should be followed by blank line (SA1513)-->
2424
<Rule Id="SA1124" Action="Error" /> <!-- Error SA1124: Don't use regions-->
2525
<Rule Id="SA1009" Action="Error" /> <!-- Error SA1009: Closing parenthesis should not be preceded by a space. (SA1009)-->
26-
<Rule Id="SA1413" Action="None" /> <!-- Error SA1413: Use trailing comma in multi-line initializers (SA1413)-->
26+
<Rule Id="SA1413" Action="Error" /> <!-- Error SA1413: Use trailing comma in multi-line initializers (SA1413)-->
2727
<Rule Id="SA1602" Action="None" /> <!-- Error SA1602: Enumeration items should be documented (SA1602)-->
2828
<Rule Id="SA1005" Action="Error" /> <!-- Error SA1005: Single line comment should begin with a space. (SA1005)-->
2929
<Rule Id="SA1203" Action="Error" /> <!-- Error SA1203: Constant fields should appear before non-constant fields (SA1203)-->

lib/PuppeteerSharp/BoundingBox.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ internal Clip ToClip()
5959
X = X,
6060
Y = Y,
6161
Width = Width,
62-
Height = Height
62+
Height = Height,
6363
};
6464
}
6565

lib/PuppeteerSharp/Browser.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ internal async Task<Page> CreatePageInContextAsync(string contextId)
407407
{
408408
var createTargetRequest = new TargetCreateTargetRequest
409409
{
410-
Url = "about:blank"
410+
Url = "about:blank",
411411
};
412412

413413
if (contextId != null)
@@ -426,7 +426,7 @@ internal async Task DisposeContextAsync(string contextId)
426426
{
427427
await Connection.SendAsync("Target.disposeBrowserContext", new TargetDisposeBrowserContextRequest
428428
{
429-
BrowserContextId = contextId
429+
BrowserContextId = contextId,
430430
}).ConfigureAwait(false);
431431
_contexts.TryRemove(contextId, out var _);
432432
}
@@ -555,7 +555,7 @@ internal static async Task<Browser> CreateAsync(
555555

556556
await connection.SendAsync("Target.setDiscoverTargets", new TargetSetDiscoverTargetsRequest
557557
{
558-
Discover = true
558+
Discover = true,
559559
}).ConfigureAwait(false);
560560

561561
return browser;

lib/PuppeteerSharp/BrowserContext.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ public Task OverridePermissionsAsync(string origin, IEnumerable<OverridePermissi
125125
{
126126
Origin = origin,
127127
BrowserContextId = _id,
128-
Permissions = permissions.ToArray()
128+
Permissions = permissions.ToArray(),
129129
});
130130

131131
/// <summary>
@@ -135,7 +135,7 @@ public Task OverridePermissionsAsync(string origin, IEnumerable<OverridePermissi
135135
public Task ClearPermissionOverridesAsync()
136136
=> _connection.SendAsync("Browser.resetPermissions", new BrowserResetPermissionsRequest
137137
{
138-
BrowserContextId = _id
138+
BrowserContextId = _id,
139139
});
140140

141141
internal void OnTargetCreated(Browser browser, TargetChangedArgs args) => TargetCreated?.Invoke(browser, args);

lib/PuppeteerSharp/BrowserFetcher.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ public RevisionInfo RevisionInfo(string revision)
239239
FolderPath = GetFolderPath(revision),
240240
Url = GetDownloadURL(Product, Platform, DownloadHost, revision),
241241
Revision = revision,
242-
Platform = Platform
242+
Platform = Platform,
243243
};
244244
result.ExecutablePath = GetExecutablePath(Product, Platform, revision, result.FolderPath);
245245
result.Local = new DirectoryInfo(result.FolderPath).Exists;
@@ -369,7 +369,7 @@ private Task InstallDMGAsync(string dmgPath, string folderPath)
369369

370370
using var process = new Process
371371
{
372-
EnableRaisingEvents = true
372+
EnableRaisingEvents = true,
373373
};
374374

375375
process.StartInfo.FileName = "hdiutil";

lib/PuppeteerSharp/CDPSession.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ public async Task<JObject> SendAsync(string method, object args = null, bool wai
139139
callback = new MessageTask
140140
{
141141
TaskWrapper = new TaskCompletionSource<JObject>(TaskCreationOptions.RunContinuationsAsynchronously),
142-
Method = method
142+
Method = method,
143143
};
144144
_callbacks[id] = callback;
145145
}
@@ -173,7 +173,7 @@ public Task DetachAsync()
173173

174174
return Connection.SendAsync("Target.detachFromTarget", new TargetDetachFromTargetRequest
175175
{
176-
SessionId = Id
176+
SessionId = Id,
177177
});
178178
}
179179

@@ -193,7 +193,7 @@ internal void OnMessage(ConnectionResponse obj)
193193
MessageReceived?.Invoke(this, new MessageEventArgs
194194
{
195195
MessageID = method,
196-
MessageData = obj.Params
196+
MessageData = obj.Params,
197197
});
198198
}
199199
}

lib/PuppeteerSharp/ChromiumLauncher.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ internal static string[] GetDefaultArgs(LaunchOptions options)
116116
{
117117
"--headless",
118118
"--hide-scrollbars",
119-
"--mute-audio"
119+
"--mute-audio",
120120
});
121121
}
122122

lib/PuppeteerSharp/Connection.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ internal async Task<JObject> SendAsync(string method, object args = null, bool w
125125
callback = new MessageTask
126126
{
127127
TaskWrapper = new TaskCompletionSource<JObject>(TaskCreationOptions.RunContinuationsAsynchronously),
128-
Method = method
128+
Method = method,
129129
};
130130
_callbacks[id] = callback;
131131
}
@@ -145,7 +145,7 @@ internal async Task<CDPSession> CreateSessionAsync(TargetInfo targetInfo)
145145
var sessionId = (await SendAsync<TargetAttachToTargetResponse>("Target.attachToTarget", new TargetAttachToTargetRequest
146146
{
147147
TargetId = targetInfo.TargetId,
148-
Flatten = true
148+
Flatten = true,
149149
}).ConfigureAwait(false)).SessionId;
150150
return await GetSessionAsync(sessionId).ConfigureAwait(false);
151151
}
@@ -271,7 +271,7 @@ private void ProcessIncomingMessage(ConnectionResponse obj)
271271
MessageReceived?.Invoke(this, new MessageEventArgs
272272
{
273273
MessageID = method,
274-
MessageData = obj.Params
274+
MessageData = obj.Params,
275275
});
276276
}
277277
}

lib/PuppeteerSharp/DOMWorldType.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ internal enum DOMWorldType
1111
[EnumMember(Value = "isolated")]
1212
Isolated,
1313
[EnumMember(Value = "default")]
14-
Default
14+
Default,
1515
}
1616
}

lib/PuppeteerSharp/Dialog.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public Task Accept(string promptText = "")
6363
=> _client.SendAsync("Page.handleJavaScriptDialog", new PageHandleJavaScriptDialogRequest
6464
{
6565
Accept = true,
66-
PromptText = promptText
66+
PromptText = promptText,
6767
});
6868

6969
/// <summary>
@@ -73,7 +73,7 @@ public Task Accept(string promptText = "")
7373
public Task Dismiss()
7474
=> _client.SendAsync("Page.handleJavaScriptDialog", new PageHandleJavaScriptDialogRequest
7575
{
76-
Accept = false
76+
Accept = false,
7777
});
7878
}
7979
}

0 commit comments

Comments
 (0)