Skip to content

Commit 221fea0

Browse files
committed
try some suppressions
1 parent afbbf84 commit 221fea0

File tree

4 files changed

+38
-36
lines changed

4 files changed

+38
-36
lines changed

Diff for: JankSQL/GlobalSuppressions.cs

+20-31
Original file line numberDiff line numberDiff line change
@@ -5,34 +5,23 @@
55

66
using System.Diagnostics.CodeAnalysis;
77

8-
// I'd rather not
9-
[assembly: SuppressMessage("StyleCop.CSharp.ReadabilityRules", "SA1101:Prefix local calls with this", Justification = "Not my style")]
10-
11-
// StyleCop forces bracing that I don't like, and can't be configured
12-
[assembly: SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1503:Braces should not be omitted", Justification = "Cant be controlled to represent my style")]
13-
[assembly: SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1520:Use braces consistently", Justification = "can't be controlled to represent my style")]
14-
15-
// multiple newlines at the end of a file are inconsequential
16-
// the configuration only "allows" a single newline
17-
[assembly: SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1518:Use line endings correctly at end of file", Justification = "silly")]
18-
19-
// no need for line nannying
20-
[assembly: SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1508:Closing braces should not be preceded by blank line", Justification = "silly")]
21-
[assembly: SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1507:Code should not contain multiple blank lines in a row", Justification = "silly")]
22-
23-
// StyleCop fires this warning for []? nullable arrays
24-
// see https://github.com/DotNetAnalyzers/StyleCopAnalyzers/issues/2927
25-
[assembly: SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1011:Closing square bracket should be followed by a space", Justification = "StyleCop bug")]
26-
27-
// incompatible with TODO and REVIEW comments, which are useful and built-in to Visual Studio
28-
[assembly: SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1005:Single line comment should begin with a space", Justification = "Not my style")]
29-
30-
// not using file headers
31-
[assembly: SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1633:The file header XML is invalid", Justification = "not using file headers just yet")]
32-
33-
// I freely use single-line comments
34-
[assembly: SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1512:Single-line comments should not be followed by blank line", Justification = "Not my style")]
35-
[assembly: SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1515:Single-line comment should be preceded by blank line", Justification = "Not my style")]
36-
37-
// regions seem nice to me
38-
[assembly: SuppressMessage("StyleCop.CSharp.ReadabilityRules", "SA1124:Do not use regions", Justification = "You're not the boss of me")]
8+
// see https://josefpihrt.github.io/docs/roslynator/how-to-suppress-diagnostic
9+
[assembly: SuppressMessage("Roslynator",
10+
"RCS1036:Remove unnecessary blank line",
11+
Justification = "Nobody tells me where to put whitespace", Scope = "namespaceanddescendants", Target = "JankSQL")]
12+
[assembly: SuppressMessage("Roslynator",
13+
"RCS1036:Remove unnecessary blank line",
14+
Justification = "Nobody tells me where to put whitespace", Scope = "namespaceanddescendants", Target = "JankSQL.Expressions")]
15+
[assembly: SuppressMessage("Roslynator",
16+
"RCS1036:Remove unnecessary blank line",
17+
Justification = "Nobody tells me where to put whitespace", Scope = "namespaceanddescendants", Target = "JankSQL.Engines")]
18+
[assembly: SuppressMessage("Roslynator",
19+
"RCS1036:Remove unnecessary blank line",
20+
Justification = "Nobody tells me where to put whitespace", Scope = "namespaceanddescendants", Target = "JankSQL.Contexts")]
21+
[assembly: SuppressMessage("Roslynator",
22+
"RCS1036:Remove unnecessary blank line",
23+
Justification = "Nobody tells me where to put whitespace", Scope = "namespaceanddescendants", Target = "JankSQL.Listeners")]
24+
25+
[assembly: SuppressMessage("Roslynator",
26+
"RCS1003:Add braces to if-else (when expression spans over multiple lines)",
27+
Justification = "Mixing brackets is preferred", Scope = "namespaceanddescendants", Target = "JankSQL")]

Diff for: Parsing/AssemblyInfo.cs

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
// values defined in project properties. For details of which attributes are included
66
// and how to customize this process see: https://aka.ms/assembly-info-properties
77

8-
98
// Setting ComVisible to false makes the types in this assembly not visible to COM
109
// components. If you need to access a type in this assembly from COM, set the ComVisible
1110
// attribute to true on that type.

Diff for: Tests/BareSelectTests.cs

+4-4
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,7 @@ public void TestNumberIntegers()
528528
JankAssert.RowsetExistsWithShape(result, 4, 1);
529529
result.ResultSet.Dump();
530530

531-
int[] nums = { -200, 300, 5, 0 };
531+
int[] nums = [-200, 300, 5, 0];
532532
for (int n = 0; n < result.ResultSet.ColumnCount; n++)
533533
JankAssert.ValueMatchesInteger(result.ResultSet, n, 0, nums[n]);
534534
}
@@ -543,7 +543,7 @@ public void TestNumberIntegersWithNull()
543543
result.ResultSet.Dump();
544544

545545
Tuple row = result.ResultSet.Row(0);
546-
int?[] nums = { -200, 300, null, 5, 0 };
546+
int?[] nums = [-200, 300, null, 5, 0];
547547
for (int n = 0; n < result.ResultSet.ColumnCount; n++)
548548
{
549549
if (nums[n] == null)
@@ -563,7 +563,7 @@ public void TestNumberDecimals()
563563
result.ResultSet.Dump();
564564

565565
Tuple row = result.ResultSet.Row(0);
566-
double[] nums = { 200, 300.1, 5.182837, 0 };
566+
double[] nums = [200, 300.1, 5.182837, 0];
567567
for (int n = 0; n < result.ResultSet.ColumnCount; n++)
568568
{
569569
Assert.That(row[n].RepresentsNull, Is.False);
@@ -582,7 +582,7 @@ public void TestNumberDecimalsWithNull()
582582
result.ResultSet.Dump();
583583

584584
Tuple row = result.ResultSet.Row(0);
585-
double?[] nums = { 200, 300.1, null, 5.182837, 0 };
585+
double?[] nums = [200, 300.1, null, 5.182837, 0];
586586
for (int n = 0; n < result.ResultSet.ColumnCount; n++)
587587
{
588588
if (nums[n] == null)

Diff for: Tests/GlobalSuppressions.cs

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// This file is used by Code Analysis to maintain SuppressMessage
2+
// attributes that are applied to this project.
3+
// Project-level suppressions either have no target or are given
4+
// a specific target and scoped to a namespace, type, member, etc.
5+
6+
using System.Diagnostics.CodeAnalysis;
7+
8+
// see https://josefpihrt.github.io/docs/roslynator/how-to-suppress-diagnostic
9+
[assembly: SuppressMessage("Roslynator",
10+
"RCS1036:Remove unnecessary blank line",
11+
Justification = "Nobody tells me where to put whitespace", Scope = "NamespaceAndDescendants", Target = "~N:Tests")]
12+
[assembly: SuppressMessage("Roslynator",
13+
"RCS1003:Add braces to if-else (when expression spans over multiple lines)",
14+
Justification = "Mixing brackets is preferred", Scope = "NamespaceAndDescendants", Target = "~N:Tests")]

0 commit comments

Comments
 (0)