Skip to content

Commit adb2c74

Browse files
authored
Update stylecop.analyzers (#1930)
1 parent fea7a89 commit adb2c74

File tree

8 files changed

+14
-11
lines changed

8 files changed

+14
-11
lines changed

lib/PuppeteerSharp.ruleset

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
<Rule Id="SA1642" Action="None" /> <!-- Error SA1642: Constructor summary documentation should begin with standard text (SA1642) (PuppeteerSharp)-->
3535
<Rule Id="SA1013" Action="Error" /> <!-- Error SA1013: Closing brace should be preceded by a space. (SA1013) -->
3636
<Rule Id="SA1515" Action="Error" /> <!-- Error SA1515: Single-line comment should be preceded by blank line (SA1515) -->
37+
<Rule Id="SA1518" Action="None" /> <!-- Error SA1518: File is required to end with a single newline character (SA1518)-->
3738
<Rule Id="SA1012" Action="Error" /> <!-- Error SA1012: Opening brace should be followed by a space. (SA1012) -->
3839
<Rule Id="SA1512" Action="None" /> <!-- Error SA1502: Element should not be on a single line (SA1502) -->
3940
<Rule Id="SA1648" Action="None" /> <!-- Error SA1648: inheritdoc should be used with inheriting class (SA1648) -->

lib/PuppeteerSharp/BrowserFetcher.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public class BrowserFetcher : IDisposable
3939
[Product.Firefox] = "https://archive.mozilla.org/pub/firefox/nightly/latest-mozilla-central",
4040
};
4141

42-
private static readonly Dictionary<(Product product, Platform platform), string> _downloadUrls = new Dictionary<(Product product, Platform platform), string>
42+
private static readonly Dictionary<(Product Product, Platform Platform), string> _downloadUrls = new()
4343
{
4444
[(Product.Chrome, Platform.Linux)] = "{0}/chromium-browser-snapshots/Linux_x64/{1}/{2}.zip",
4545
[(Product.Chrome, Platform.MacOS)] = "{0}/chromium-browser-snapshots/Mac/{1}/{2}.zip",

lib/PuppeteerSharp/ChromiumLauncher.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public ChromiumLauncher(string executable, LaunchOptions options)
7373

7474
#region Private methods
7575

76-
private static (List<string> chromiumArgs, TempDirectory tempUserDataDirectory) PrepareChromiumArgs(LaunchOptions options)
76+
private static (List<string> ChromiumArgs, TempDirectory TempUserDataDirectory) PrepareChromiumArgs(LaunchOptions options)
7777
{
7878
var chromiumArgs = new List<string>();
7979

lib/PuppeteerSharp/ElementHandle.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,7 @@ public async Task<DragData> DragAsync(decimal x, decimal y)
535535

536536
await ScrollIntoViewIfNeededAsync().ConfigureAwait(false);
537537
var start = await ClickablePointAsync().ConfigureAwait(false);
538-
return await Page.Mouse.DragAsync(start.x, start.y, x, y).ConfigureAwait(false);
538+
return await Page.Mouse.DragAsync(start.X, start.Y, x, y).ConfigureAwait(false);
539539
}
540540

541541
/// <summary>
@@ -610,10 +610,10 @@ public async Task DragAndDropAsync(ElementHandle target, int delay = 0)
610610
await ScrollIntoViewIfNeededAsync().ConfigureAwait(false);
611611
var (x, y) = await ClickablePointAsync().ConfigureAwait(false);
612612
var targetPoint = await target.ClickablePointAsync().ConfigureAwait(false);
613-
await Page.Mouse.DragAndDropAsync(x, y, targetPoint.x, targetPoint.y, delay).ConfigureAwait(false);
613+
await Page.Mouse.DragAndDropAsync(x, y, targetPoint.X, targetPoint.Y, delay).ConfigureAwait(false);
614614
}
615615

616-
private async Task<(decimal x, decimal y)> ClickablePointAsync()
616+
private async Task<(decimal X, decimal Y)> ClickablePointAsync()
617617
{
618618
GetContentQuadsResponse result = null;
619619

@@ -661,8 +661,8 @@ public async Task DragAndDropAsync(ElementHandle target, int delay = 0)
661661
}
662662

663663
return (
664-
x: x / 4,
665-
y: y / 4);
664+
X: x / 4,
665+
Y: y / 4);
666666
}
667667

668668
private IEnumerable<BoxModelPoint> IntersectQuadWithViewport(IEnumerable<BoxModelPoint> quad, PageGetLayoutMetricsResponse viewport)

lib/PuppeteerSharp/FirefoxLauncher.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public FirefoxLauncher(string executable, LaunchOptions options)
3838
/// <inheritdoc />
3939
public override string ToString() => $"Firefox process; EndPoint={EndPoint}; State={CurrentState}";
4040

41-
private static (List<string> firefoxArgs, TempDirectory tempUserDataDirectory) PrepareFirefoxArgs(LaunchOptions options)
41+
private static (List<string> FirefoxArgs, TempDirectory TempUserDataDirectory) PrepareFirefoxArgs(LaunchOptions options)
4242
{
4343
var firefoxArgs = new List<string>();
4444

lib/PuppeteerSharp/Helpers/AsyncDictionaryHelper.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ internal async Task<TValue> GetItemAsync(TKey key)
3131

3232
return await tcs.Task.WithTimeout(
3333
new Action(() =>
34-
throw new PuppeteerException(string.Format(CultureInfo.CurrentCulture, _timeoutMessage, key))), 1000).ConfigureAwait(false);
34+
throw new PuppeteerException(string.Format(CultureInfo.CurrentCulture, _timeoutMessage, key))),
35+
1000).ConfigureAwait(false);
3536
}
3637

3738
internal async Task<TValue> TryGetItemAsync(TKey key)

lib/PuppeteerSharp/LauncherBase.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,8 @@ await ExitCompletionSource.Task.WithTimeout(
142142
() =>
143143
{
144144
taskCompleted = false;
145-
}, timeout.Value).ConfigureAwait(false);
145+
},
146+
timeout.Value).ConfigureAwait(false);
146147
return taskCompleted;
147148
}
148149

lib/PuppeteerSharp/PuppeteerSharp.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
<PackageReference Include="Microsoft.AspNetCore.WebUtilities" Version="2.2.0" />
3636
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="1.1.0" />
3737
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
38-
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118">
38+
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.406">
3939
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
4040
<PrivateAssets>all</PrivateAssets>
4141
</PackageReference>

0 commit comments

Comments
 (0)