Skip to content

Commit

Permalink
Force license check in UTs
Browse files Browse the repository at this point in the history
  • Loading branch information
pavel-mikula-sonarsource committed Dec 15, 2023
1 parent 0cbd276 commit a79fe2f
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 6 deletions.
5 changes: 2 additions & 3 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -227,9 +227,8 @@ dotnet_naming_style.I_style.capitalization = pascal_case
# Rules
# ----------------------------------------------------------------------------------------------------------------------

# CS7035: it expects the build number to fit in 16 bits, our build numbers are bigger https://github.com/dotnet/roslyn/issues/17024#issuecomment-1669503201
dotnet_diagnostic.CS7035.severity = none

dotnet_diagnostic.S1451.severity = warning # Force activation of license header check for UTs
dotnet_diagnostic.CS7035.severity = none # CS7035: it expects the build number to fit in 16 bits, our build numbers are bigger https://github.com/dotnet/roslyn/issues/17024#issuecomment-1669503201
dotnet_diagnostic.CA1822.severity = warning # Increase visibility for Member 'xxx' does not access instance data and can be marked as static
dotnet_diagnostic.CS8785.severity = error # Do not hide root cause for: Generator 'xxx' failed to generate source. It will not contribute to the output and compilation errors may occur as a result. Exception was of type 'xxx' with message 'xxx'
dotnet_diagnostic.RS2008.severity = none # Enable analyzer release tracking - we don't use the release tracking analyzer
Expand Down
22 changes: 21 additions & 1 deletion analyzers/tests/SonarAnalyzer.UnitTest/Common/XUnitVersions.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,24 @@
namespace SonarAnalyzer.UnitTest.Common;
/*
* SonarAnalyzer for .NET
* Copyright (C) 2015-2023 SonarSource SA
* mailto: contact AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/

namespace SonarAnalyzer.UnitTest.Common;

public static class XUnitVersions
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,24 @@
using System.Text;
/*
* SonarAnalyzer for .NET
* Copyright (C) 2015-2023 SonarSource SA
* mailto: contact AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/

using System.Text;
using System.Text.RegularExpressions;
using Microsoft.CodeAnalysis.Text;
using SonarAnalyzer.Protobuf;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,24 @@
namespace SonarAnalyzer.UnitTest.TestFramework.Tests;
/*
* SonarAnalyzer for .NET
* Copyright (C) 2015-2023 SonarSource SA
* mailto: contact AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/

namespace SonarAnalyzer.UnitTest.TestFramework.Tests;

[TestClass]
public class ProjectBuilderTest
Expand Down Expand Up @@ -63,3 +83,4 @@ public void AddDocument_SupportsRazorFiles()
new Action(() => EmptyVB.AddDocument("TestCases\\UnusedPrivateMember.vbhtml").FindDocument("UnusedPrivateMember.vbhtml").Should().NotBeNull())
.Should().Throw<ArgumentException>();
}

0 comments on commit a79fe2f

Please sign in to comment.