Skip to content

Commit

Permalink
consolidate/cleanup SA1000 (#2577)
Browse files Browse the repository at this point in the history
  • Loading branch information
reyang committed Nov 9, 2021
1 parent 11654f1 commit 0ed4ed6
Show file tree
Hide file tree
Showing 8 changed files with 6 additions and 9 deletions.
3 changes: 2 additions & 1 deletion build/OpenTelemetry.prod.loose.ruleset
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
<Description Resource="OpenTelemetrySDKRules_Description" />
</Localization>
<Rules AnalyzerId="StyleCop.Analyzers" RuleNamespace="StyleCop.Analyzers">
<Rule Id="SA1000" Action="Warning" />
<!-- SA1000 KeywordsMustBeSpacedCorrectly https://github.com/DotNetAnalyzers/StyleCopAnalyzers/issues/3214 -->
<Rule Id="SA1000" Action="None" />
<Rule Id="SA1001" Action="Warning" />
<Rule Id="SA1002" Action="Warning" />
<Rule Id="SA1003" Action="Warning" />
Expand Down
2 changes: 2 additions & 0 deletions build/OpenTelemetry.prod.ruleset
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
<Description Resource="OpenTelemetrySDKRules_Description" />
</Localization>
<Rules AnalyzerId="StyleCop.Analyzers" RuleNamespace="StyleCop.Analyzers">
<!-- SA1000 KeywordsMustBeSpacedCorrectly https://github.com/DotNetAnalyzers/StyleCopAnalyzers/issues/3214 -->
<Rule Id="SA1000" Action="None" />
<Rule Id="SA1200" Action="None" />
<Rule Id="SA1401" Action="None" />
<Rule Id="SA1512" Action="None" />
Expand Down
2 changes: 2 additions & 0 deletions build/OpenTelemetry.test.ruleset
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
</Localization>
<Rules AnalyzerId="StyleCop.Analyzers" RuleNamespace="StyleCop.Analyzers">
<Rule Id="SA0001" Action="None" />
<!-- SA1000 KeywordsMustBeSpacedCorrectly https://github.com/DotNetAnalyzers/StyleCopAnalyzers/issues/3214 -->
<Rule Id="SA1000" Action="None" />
<Rule Id="SA1200" Action="None" />
<Rule Id="SA1401" Action="None" />
<Rule Id="SA1512" Action="None" />
Expand Down
1 change: 0 additions & 1 deletion docs/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), 'OpenTelemetry.sln'))\build\Common.nonprod.props" />

<PropertyGroup>
<NoWarn>$(NoWarn),SA1000</NoWarn>
<OutputType>Exe</OutputType>
<!-- https://dotnet.microsoft.com/download/dotnet-core -->
<TargetFrameworks>netcoreapp3.1;net5.0</TargetFrameworks>
Expand Down
2 changes: 0 additions & 2 deletions examples/Console/TestPrometheusExporter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ internal static object Run(int port, int totalDurationInMins)
})
.Build();

#pragma warning disable SA1000 // KeywordsMustBeSpacedCorrectly https://github.com/DotNetAnalyzers/StyleCopAnalyzers/issues/3214
ObservableGauge<long> gauge = MyMeter.CreateObservableGauge(
"myGauge",
() =>
Expand All @@ -82,7 +81,6 @@ internal static object Run(int port, int totalDurationInMins)
}
});
writeMetricTask.Start();
#pragma warning restore SA1000 // KeywordsMustBeSpacedCorrectly

token.CancelAfter(totalDurationInMins * 60 * 1000);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<NoWarn>$(NoWarn),SA1000</NoWarn>
<OutputType>Exe</OutputType>
<TargetFrameworks>netcoreapp3.1;net5.0;net6.0;net462</TargetFrameworks>
<IsPackable>false</IsPackable>
Expand Down
2 changes: 0 additions & 2 deletions test/OpenTelemetry.Tests/Metrics/MetricAPITest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@

namespace OpenTelemetry.Metrics.Tests
{
#pragma warning disable SA1000 // KeywordsMustBeSpacedCorrectly https://github.com/DotNetAnalyzers/StyleCopAnalyzers/issues/3214
public class MetricApiTest
{
private const int MaxTimeToAllowForFlush = 10000;
Expand Down Expand Up @@ -655,5 +654,4 @@ private class UpdateThreadArguments<T>
public T DeltaValueUpdatedByEachCall;
}
}
#pragma warning restore SA1000 // KeywordsMustBeSpacedCorrectly
}
2 changes: 0 additions & 2 deletions test/OpenTelemetry.Tests/Metrics/MetricViewTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@

namespace OpenTelemetry.Metrics.Tests
{
#pragma warning disable SA1000 // KeywordsMustBeSpacedCorrectly https://github.com/DotNetAnalyzers/StyleCopAnalyzers/issues/3214
public class MetricViewTests
{
private const int MaxTimeToAllowForFlush = 10000;
Expand Down Expand Up @@ -559,5 +558,4 @@ public void MetricStreamConfigurationForDropMustNotAllowOverriding()
Assert.Equal(Aggregation.Drop, MetricStreamConfiguration.Drop.Aggregation);
}
}
#pragma warning restore SA1000 // KeywordsMustBeSpacedCorrectly
}

0 comments on commit 0ed4ed6

Please sign in to comment.