Skip to content

Commit dae5325

Browse files
Enabled and fixed issues for the rule SA1514. (#2012)
1 parent 4604e38 commit dae5325

Some content is hidden

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

55 files changed

+420
-2
lines changed

lib/PuppeteerSharp.ruleset

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<Rule Id="SA1600" Action="None" /> <!-- Error SA1600: Elements should be documented (SA1600)-->
1414
<Rule Id="SA1516" Action="Error" /> <!-- Error SA1516: Elements should be separated by blank line (SA1516)-->
1515
<Rule Id="SA1629" Action="None" /> <!-- Error SA1629: Documentation text should end with a period (SA1629)-->
16-
<Rule Id="SA1514" Action="None" /> <!-- Error SA1514: Element documentation header should be preceded by blank line (SA1514)-->
16+
<Rule Id="SA1514" Action="Error" /> <!-- Error SA1514: Element documentation header should be preceded by blank line (SA1514)-->
1717
<Rule Id="SA1201" Action="Error" /> <!-- Error SA1201: Elements must appear in the correct order (SA1201)-->
1818
<Rule Id="SA1202" Action="None" /> <!-- Error SA1202: 'public' members should come before 'internal' members (SA1202)-->
1919
<Rule Id="SA1210" Action="Error" /> <!-- Error SA1210: Using directives should be ordered alphabetically by the namespaces. (SA1210)-->

lib/PuppeteerSharp/BoundingBox.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,19 @@ public BoundingBox(decimal x, decimal y, decimal width, decimal height)
3636
/// </summary>
3737
/// <value>The x.</value>
3838
public decimal X { get; set; }
39+
3940
/// <summary>
4041
/// The y coordinate of the element in pixels.
4142
/// </summary>
4243
/// <value>The y.</value>
4344
public decimal Y { get; set; }
45+
4446
/// <summary>
4547
/// The width of the element in pixels.
4648
/// </summary>
4749
/// <value>The width.</value>
4850
public decimal Width { get; set; }
51+
4952
/// <summary>
5053
/// The height of the element in pixels.
5154
/// </summary>

lib/PuppeteerSharp/Browser.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ public bool IsClosed
149149
/// Dafault wait time in milliseconds. Defaults to 30 seconds.
150150
/// </summary>
151151
public int DefaultWaitForTimeout { get; set; } = Puppeteer.DefaultTimeout;
152+
152153
/// <summary>
153154
/// Indicates that the browser is connected.
154155
/// </summary>

lib/PuppeteerSharp/ConsoleType.cs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,78 +11,97 @@ public enum ConsoleType
1111
/// Log.
1212
/// </summary>
1313
Log,
14+
1415
/// <summary>
1516
/// Debug.
1617
/// </summary>
1718
Debug,
19+
1820
/// <summary>
1921
/// Info.
2022
/// </summary>
2123
Info,
24+
2225
/// <summary>
2326
/// Error.
2427
/// </summary>
2528
Error,
29+
2630
/// <summary>
2731
/// Warning.
2832
/// </summary>
2933
Warning,
34+
3035
/// <summary>
3136
/// Dir.
3237
/// </summary>
3338
Dir,
39+
3440
/// <summary>
3541
/// Dirxml.
3642
/// </summary>
3743
Dirxml,
44+
3845
/// <summary>
3946
/// Table.
4047
/// </summary>
4148
Table,
49+
4250
/// <summary>
4351
/// Trace.
4452
/// </summary>
4553
Trace,
54+
4655
/// <summary>
4756
/// Clear.
4857
/// </summary>
4958
Clear,
59+
5060
/// <summary>
5161
/// StartGroup.
5262
/// </summary>
5363
StartGroup,
64+
5465
/// <summary>
5566
/// StartGroupCollapsed.
5667
/// </summary>
5768
StartGroupCollapsed,
69+
5870
/// <summary>
5971
/// EndGroup.
6072
/// </summary>
6173
EndGroup,
74+
6275
/// <summary>
6376
/// Assert.
6477
/// </summary>
6578
Assert,
79+
6680
/// <summary>
6781
/// Profile.
6882
/// </summary>
6983
Profile,
84+
7085
/// <summary>
7186
/// ProfileEnd.
7287
/// </summary>
7388
ProfileEnd,
89+
7490
/// <summary>
7591
/// Count.
7692
/// </summary>
7793
Count,
94+
7895
/// <summary>
7996
/// TimeEnd.
8097
/// </summary>
8198
TimeEnd,
99+
82100
/// <summary>
83101
/// Verbose.
84102
/// </summary>
85103
Verbose,
104+
86105
/// <summary>
87106
/// Time Stamp.
88107
/// </summary>

lib/PuppeteerSharp/CookieParam.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,59 +15,70 @@ public class CookieParam
1515
/// </summary>
1616
/// <value>The name.</value>
1717
public string Name { get; set; }
18+
1819
/// <summary>
1920
/// Gets or sets the value.
2021
/// </summary>
2122
/// <value>The value.</value>
2223
public string Value { get; set; }
24+
2325
/// <summary>
2426
/// Gets or sets the domain.
2527
/// </summary>
2628
/// <value>The domain.</value>
2729
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
2830
public string Domain { get; set; }
31+
2932
/// <summary>
3033
/// Gets or sets the URL.
3134
/// </summary>
3235
/// <value>The URL.</value>
3336
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
3437
public string Url { get; set; }
38+
3539
/// <summary>
3640
/// Gets or sets the path.
3741
/// </summary>
3842
/// <value>The path.</value>
3943
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
4044
public string Path { get; set; }
45+
4146
/// <summary>
4247
/// Gets or sets the expiration. Unix time in seconds.
4348
/// </summary>
4449
/// <value>Expiration.</value>
4550
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
4651
public double? Expires { get; set; }
52+
4753
/// <summary>
4854
/// Gets or sets the size.
4955
/// </summary>
5056
/// <value>The size.</value>
5157
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
58+
5259
public int? Size { get; set; }
60+
5361
/// <summary>
5462
/// Gets or sets if it's HTTP only.
5563
/// </summary>
5664
/// <value>Whether it's http only or not.</value>
5765
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
5866
public bool? HttpOnly { get; set; }
67+
5968
/// <summary>
6069
/// Gets or sets if it's secure.
6170
/// </summary>
6271
/// <value>Whether it's secure or not.</value>
6372
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
6473
public bool? Secure { get; set; }
74+
6575
/// <summary>
6676
/// Gets or sets if it's session only.
6777
/// </summary>
6878
/// <value>Whether it's session only or not.</value>
6979
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
7080
public bool? Session { get; set; }
81+
7182
/// <summary>
7283
/// Gets or sets the cookies SameSite value.
7384
/// </summary>

lib/PuppeteerSharp/Dialog.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,13 @@ public Dialog(CDPSession client, DialogType type, string message, string default
4343
/// </summary>
4444
/// <value>The type of the dialog.</value>
4545
public DialogType DialogType { get; set; }
46+
4647
/// <summary>
4748
/// If dialog is prompt, returns default prompt value. Otherwise, returns empty string.
4849
/// </summary>
4950
/// <value>The default value.</value>
5051
public string DefaultValue { get; set; }
52+
5153
/// <summary>
5254
/// A message displayed in the dialog.
5355
/// </summary>

lib/PuppeteerSharp/DialogType.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,17 @@ public enum DialogType
1212
/// Alert dialog.
1313
/// </summary>
1414
Alert,
15+
1516
/// <summary>
1617
/// Prompt dialog.
1718
/// </summary>
1819
Prompt,
20+
1921
/// <summary>
2022
/// Confirm dialog.
2123
/// </summary>
2224
Confirm,
25+
2326
/// <summary>
2427
/// Before unload dialog.
2528
/// </summary>

lib/PuppeteerSharp/DragOperation.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
namespace PuppeteerSharp
1+
namespace PuppeteerSharp
22
{
33
/// <summary>
44
/// Drag operations available on <see cref="DragData"/>.
@@ -9,14 +9,17 @@ public enum DragOperation
99
/// Unknown.
1010
/// </summary>
1111
Unknown = -1,
12+
1213
/// <summary>
1314
/// Copy.
1415
/// </summary>
1516
Copy = 1,
17+
1618
/// <summary>
1719
/// Link.
1820
/// </summary>
1921
Link = 2,
22+
2023
/// <summary>
2124
/// Move.
2225
/// </summary>

lib/PuppeteerSharp/GeolocationOption.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,13 @@ public class GeolocationOption : IEquatable<GeolocationOption>
1414
/// </summary>
1515
/// <value>The latitude.</value>
1616
public decimal Latitude { get; set; }
17+
1718
/// <summary>
1819
/// Longitude between -180 and 180.
1920
/// </summary>
2021
/// <value>The longitude.</value>
2122
public decimal Longitude { get; set; }
23+
2224
/// <summary>
2325
/// Optional non-negative accuracy value.
2426
/// </summary>
@@ -36,8 +38,10 @@ public bool Equals(GeolocationOption other)
3638
Latitude == other.Latitude &&
3739
Longitude == other.Longitude &&
3840
Accuracy == other.Accuracy;
41+
3942
/// <inheritdoc/>
4043
public override bool Equals(object obj) => Equals(obj as GeolocationOption);
44+
4145
/// <inheritdoc/>
4246
public override int GetHashCode()
4347
=> (Latitude.GetHashCode() ^ 2014) +

lib/PuppeteerSharp/Helpers/TaskHelper.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ public static class TaskHelper
1313
timeout => new TimeoutException($"Timeout of {timeout.TotalMilliseconds} ms exceeded");
1414

1515
// Recipe from https://blogs.msdn.microsoft.com/pfxteam/2012/10/05/how-do-i-cancel-non-cancelable-async-operations/
16+
1617
/// <summary>
1718
/// Cancels the <paramref name="task"/> after <paramref name="milliseconds"/> milliseconds
1819
/// </summary>
@@ -29,6 +30,7 @@ public static Task WithTimeout(
2930
=> WithTimeout(task, TimeSpan.FromMilliseconds(milliseconds), exceptionFactory, cancellationToken);
3031

3132
// Recipe from https://blogs.msdn.microsoft.com/pfxteam/2012/10/05/how-do-i-cancel-non-cancelable-async-operations/
33+
3234
/// <summary>
3335
/// Cancels the <paramref name="task"/> after a given <paramref name="timeout"/> period
3436
/// </summary>
@@ -48,6 +50,7 @@ public static Task WithTimeout(
4850
cancellationToken);
4951

5052
// Recipe from https://blogs.msdn.microsoft.com/pfxteam/2012/10/05/how-do-i-cancel-non-cancelable-async-operations/
53+
5154
/// <summary>
5255
/// Cancels the <paramref name="task"/> after <paramref name="milliseconds"/> milliseconds
5356
/// </summary>
@@ -64,6 +67,7 @@ public static Task WithTimeout(
6467
=> WithTimeout(task, timeoutAction, TimeSpan.FromMilliseconds(milliseconds), cancellationToken);
6568

6669
// Recipe from https://blogs.msdn.microsoft.com/pfxteam/2012/10/05/how-do-i-cancel-non-cancelable-async-operations/
70+
6771
/// <summary>
6872
/// Cancels the <paramref name="task"/> after a given <paramref name="timeout"/> period
6973
/// </summary>
@@ -92,6 +96,7 @@ public static async Task WithTimeout(this Task task, Func<Task> timeoutAction, T
9296
}
9397

9498
// Recipe from https://blogs.msdn.microsoft.com/pfxteam/2012/10/05/how-do-i-cancel-non-cancelable-async-operations/
99+
95100
/// <summary>
96101
/// Cancels the <paramref name="task"/> after <paramref name="milliseconds"/> milliseconds
97102
/// </summary>
@@ -104,6 +109,7 @@ public static Task<T> WithTimeout<T>(this Task<T> task, Action timeoutAction, in
104109
=> WithTimeout(task, timeoutAction, TimeSpan.FromMilliseconds(milliseconds));
105110

106111
// Recipe from https://blogs.msdn.microsoft.com/pfxteam/2012/10/05/how-do-i-cancel-non-cancelable-async-operations/
112+
107113
/// <summary>
108114
/// Cancels the <paramref name="task"/> after a given <paramref name="timeout"/> period
109115
/// </summary>
@@ -134,6 +140,7 @@ public static async Task<T> WithTimeout<T>(this Task<T> task, Action timeoutActi
134140
}
135141

136142
// Recipe from https://blogs.msdn.microsoft.com/pfxteam/2012/10/05/how-do-i-cancel-non-cancelable-async-operations/
143+
137144
/// <summary>
138145
/// Cancels the <paramref name="task"/> after <paramref name="milliseconds"/> milliseconds
139146
/// </summary>
@@ -146,6 +153,7 @@ public static Task<T> WithTimeout<T>(this Task<T> task, int milliseconds = 1_000
146153
=> WithTimeout(task, TimeSpan.FromMilliseconds(milliseconds), exceptionFactory);
147154

148155
// Recipe from https://blogs.msdn.microsoft.com/pfxteam/2012/10/05/how-do-i-cancel-non-cancelable-async-operations/
156+
149157
/// <summary>
150158
/// Cancels the <paramref name="task"/> after a given <paramref name="timeout"/> period
151159
/// </summary>

0 commit comments

Comments
 (0)