Skip to content

Commit

Permalink
fix project to test all SL parameters
Browse files Browse the repository at this point in the history
Co-Authored-By: Čaba Šagi <75226367+csaba-sagi-sonarsource@users.noreply.github.com>
  • Loading branch information
1 parent dca7191 commit c09b696
Show file tree
Hide file tree
Showing 18 changed files with 167 additions and 10 deletions.
10 changes: 9 additions & 1 deletion analyzers/its/config/SonarLintExclusions/SonarLint.xml
Expand Up @@ -11,9 +11,17 @@
<Key>sonar.vbnet.ignoreHeaderComments</Key>
<Value>true</Value>
</Setting>
<Setting>
<Key>sonar.inclusions</Key>
<Value>**/Included/*.cs</Value>
</Setting>
<Setting>
<Key>sonar.exclusions</Key>
<Value>**/Excluded.cs</Value>
<Value>**/ExcludedByExclusion.cs</Value>
</Setting>
<Setting>
<Key>sonar.global.exclusions</Key>
<Value>**/ExcludedByGlobalExclusion.cs</Value>
</Setting>
<Setting>
<Key>sonar.test.exclusions</Key>
Expand Down
@@ -0,0 +1,17 @@
{
"issues": [
{
"id": "S1186",
"message": "Add a nested comment explaining why this method is empty, throw a 'NotSupportedException' or complete the implementation.",
"location": {
"uri": "sources\SonarLintExclusions\SonarLintExclusions\Excluded.cs",
"region": {
"startLine": 5,
"startColumn": 34,
"endLine": 5,
"endColumn": 39
}
}
}
]
}
@@ -0,0 +1,17 @@
{
"issues": [
{
"id": "S2094",
"message": "Remove this empty class, write its code or make it an "interface".",
"location": {
"uri": "sources\SonarLintExclusions\SonarLintExclusions\Included.cs",
"region": {
"startLine": 3,
"startColumn": 18,
"endLine": 3,
"endColumn": 26
}
}
}
]
}
@@ -0,0 +1,17 @@
{
"issues": [
{
"id": "S3168",
"message": "Return 'Task' instead.",
"location": {
"uri": "sources\SonarLintExclusions\SonarLintExclusions\Excluded.cs",
"region": {
"startLine": 5,
"startColumn": 29,
"endLine": 5,
"endColumn": 33
}
}
}
]
}
@@ -0,0 +1,9 @@
{
"issues": [
{
"id": "S3990",
"message": "Provide a 'CLSCompliant' attribute for assembly 'SonarLintExclusions'.",
"location": null
}
]
}
@@ -0,0 +1,9 @@
{
"issues": [
{
"id": "S3992",
"message": "Provide a 'ComVisible' attribute for assembly 'SonarLintExclusions'.",
"location": null
}
]
}
@@ -0,0 +1,30 @@
{
"issues": [
{
"id": "S2699",
"message": "Add at least one assertion to this test case.",
"location": {
"uri": "sources\SonarLintExclusions\SonarLintExclusionsTest\ExcludedTest.cs",
"region": {
"startLine": 8,
"startColumn": 21,
"endLine": 8,
"endColumn": 32
}
}
},
{
"id": "S2699",
"message": "Add at least one assertion to this test case.",
"location": {
"uri": "sources\SonarLintExclusions\SonarLintExclusionsTest\IncludedTest.cs",
"region": {
"startLine": 8,
"startColumn": 21,
"endLine": 8,
"endColumn": 32
}
}
}
]
}
Expand Up @@ -3,9 +3,9 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.6.33417.168
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SonarLintExclusions", "SonarLintExclusions\SonarLintExclusions.csproj", "{F5D0F2AC-2BED-42AA-B219-674F970E8400}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SonarLintExclusions", "SonarLintExclusions\SonarLintExclusions.csproj", "{F5D0F2AC-2BED-42AA-B219-674F970E8400}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SonarLintExclusionsTest", "SonarLintExclusionsTest\SonarLintExclusionsTest.csproj", "{0F14329D-7A71-489B-BB85-2B257A866429}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SonarLintExclusionsTest", "SonarLintExclusionsTest\SonarLintExclusionsTest.csproj", "{0F14329D-7A71-489B-BB85-2B257A866429}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{1CF8B86B-6A00-4E05-931E-F278FCFDF1CF}"
ProjectSection(SolutionItems) = preProject
Expand Down

This file was deleted.

@@ -0,0 +1,4 @@
namespace SonarLintExclusions
{
public class ExcludedByExclusion { } // S2094
}
@@ -0,0 +1,4 @@
namespace SonarLintExclusions
{
public class ExcludedByGlobalExclusion { } // S2094
}
@@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SonarLintExclusions
{
internal class NotIncluded
{
}
}
@@ -0,0 +1,7 @@
namespace SonarLintExclusionsExcludeAllButOne
{
public class Exclude1
{

}
}
@@ -0,0 +1,7 @@
namespace SonarLintExclusionsExcludeAllButOne
{
public class Exclude2
{

}
}
@@ -0,0 +1,7 @@
namespace SonarLintExclusionsExcludeAllButOne
{
public class Exclude3
{

}
}
@@ -0,0 +1,7 @@
namespace SonarLintExclusionsExcludeAllButOne
{
public class Class1
{

}
}
@@ -0,0 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

</Project>

0 comments on commit c09b696

Please sign in to comment.