Skip to content

Commit 008f5ba

Browse files
authored
Merge pull request #11 from cpsusie/v0.2.5.x-Issue_10
V0.2.5.x issue 10
2 parents 78dc0b0 + c002dbf commit 008f5ba

43 files changed

Lines changed: 544 additions & 1831 deletions

Some content is hidden

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

CafeBabeGame/.editorconfig

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[*.cs]
2+
3+
# DotNetVault_EarlyDisposeJustification: Justification for early dispose of LockedResourceObject
4+
dotnet_diagnostic.DotNetVault_EarlyDisposeJustification.severity = error
5+
6+
# DotNetVault_ReportWhiteLists: Report on location of Whitelist files
7+
dotnet_diagnostic.DotNetVault_ReportWhiteLists.severity = error

CafeBabeGame/CafeBabeGame/CafeBabeGame.csproj

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@
1313
</PropertyGroup>
1414

1515
<ItemGroup>
16-
<PackageReference Include="DotNetVault" Version="0.2.5.9" />
17-
<PackageReference Include="HighPrecisionTimeStamps" Version="0.1.0" />
16+
<PackageReference Include="DotNetVault" Version="0.2.5.18" />
1817
<PackageReference Include="System.Collections.Immutable" Version="5.0.0" />
1918
</ItemGroup>
2019

CafeBabeGame/CafeBabeGame/Program.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
namespace CafeBabeGame
1717
{
18+
//[ReportWhiteListLocations]
1819
class Program
1920
{
2021
private static readonly IDeadBeefCafeGameFactory GameFactory = new DeadBeefCafeGameFactorySource().FactoryInstance;

Clorton Game/ClortonGameDemo/ClortonGameDemo.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
</PropertyGroup>
1414

1515
<ItemGroup>
16-
<PackageReference Include="DotNetVault" Version="0.2.5.9" />
17-
<PackageReference Include="HighPrecisionTimeStamps" Version="0.1.0" />
16+
<PackageReference Include="DotNetVault" Version="0.2.5.18" />
17+
<PackageReference Include="HighPrecisionTimeStamps" Version="1.0.0" />
1818
<PackageReference Include="System.Collections.Immutable" Version="5.0.0" />
1919
</ItemGroup>
2020

Clorton Game/ClortonGameDemo/Program.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
namespace ClortonGameDemo
1010
{
11+
//[ReportWhiteListLocations]
1112
class Program
1213
{
1314
private static IClortonGameFactory GameFactory { get; set; }

ConsoleStressTest/ConsoleStressTest.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
</PropertyGroup>
1818

1919
<ItemGroup>
20-
<PackageReference Include="DotNetVault" Version="0.2.5.9" />
21-
<PackageReference Include="HighPrecisionTimeStamps" Version="0.1.0" />
20+
<PackageReference Include="DotNetVault" Version="0.2.5.18" />
21+
<PackageReference Include="HighPrecisionTimeStamps" Version="1.0.0" />
2222
<PackageReference Include="System.Collections.Immutable" Version="5.0.0" />
2323
</ItemGroup>
2424

ConsoleStressTest/Program.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
namespace ConsoleStressTest
1212
{
13+
//[ReportWhiteListLocations]
1314
class Program
1415
{
1516
static Program() => TheResultText = new LocklessWriteOnce<string>();

DotNetVault.Test/AnalyzerYetAgainUnitTests.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,18 @@ public class UnitTest : CodeFixVerifier
3030
public void ValidateEmpty()
3131
{
3232
var test = @"";
33-
3433
VerifyCSharpDiagnostic(test);
3534
}
35+
36+
[TestMethod]
37+
public void ValidateWhiteListsReported()
38+
{
39+
var test = ResourceFiles.ReportWhiteListTestCases.ReportOnWhiteListsTestCase;
40+
VerifyCSharpDiagnostic(test, col => col.Count() == 1,
41+
dx => dx.Id == DotNetVaultAnalyzer.DotNetVault_ReportWhiteLists &&
42+
dx.Severity == DiagnosticSeverity.Warning && !dx.IsSuppressed);
43+
}
44+
3645
[TestMethod]
3746
public void Bug76TestCase1()
3847
{

DotNetVault.Test/DotNetVault.Test.csproj

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@
7171
<Compile Remove="TestCases\QueryTestCases.cs" />
7272
<Compile Remove="TestCases\RefStructAttributeTestsOk.cs" />
7373
<Compile Remove="TestCases\RefStructAttrNotOkCase1.cs" />
74+
<Compile Remove="TestCases\ReportOnWhiteListsTestCase.cs" />
7475
<Compile Remove="TestCases\RoRegularNotARefStructCase2.cs" />
7576
<Compile Remove="TestCases\SbAndUriBNotVaultSafe.cs" />
7677
<Compile Remove="TestCases\ShouldTriggerDiagnosticBecauseNoUsing.cs" />
@@ -96,7 +97,7 @@
9697
</ItemGroup>
9798

9899
<ItemGroup>
99-
<PackageReference Include="HighPrecisionTimeStamps" Version="0.1.0" />
100+
<PackageReference Include="HighPrecisionTimeStamps" Version="1.0.0" />
100101
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.2">
101102
<PrivateAssets>all</PrivateAssets>
102103
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
@@ -164,6 +165,11 @@
164165
<AutoGen>True</AutoGen>
165166
<DependentUpon>RefStructAttributeTestCases.resx</DependentUpon>
166167
</Compile>
168+
<Compile Update="ResourceFiles\ReportWhiteListTestCases.Designer.cs">
169+
<DesignTime>True</DesignTime>
170+
<AutoGen>True</AutoGen>
171+
<DependentUpon>ReportWhiteListTestCases.resx</DependentUpon>
172+
</Compile>
167173
<Compile Update="ResourceFiles\UsingMandatoryTestCases.Designer.cs">
168174
<DesignTime>True</DesignTime>
169175
<AutoGen>True</AutoGen>
@@ -256,6 +262,10 @@
256262
<Generator>ResXFileCodeGenerator</Generator>
257263
<LastGenOutput>RefStructAttributeTestCases.Designer.cs</LastGenOutput>
258264
</EmbeddedResource>
265+
<EmbeddedResource Update="ResourceFiles\ReportWhiteListTestCases.resx">
266+
<Generator>ResXFileCodeGenerator</Generator>
267+
<LastGenOutput>ReportWhiteListTestCases.Designer.cs</LastGenOutput>
268+
</EmbeddedResource>
259269
<EmbeddedResource Update="ResourceFiles\UsingMandatoryTestCases.resx">
260270
<Generator>ResXFileCodeGenerator</Generator>
261271
<LastGenOutput>UsingMandatoryTestCases.Designer.cs</LastGenOutput>

DotNetVault.Test/ResourceFiles/ReportWhiteListTestCases.Designer.cs

Lines changed: 85 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)