Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.CodeAnalysis" Version="4.13.0" />
<PackageReference Include="Microsoft.CodeAnalysis" Version="5.3.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.13.0" />
<PackageReference Include="xunit" Version="2.9.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.0.2">
Expand Down
26 changes: 26 additions & 0 deletions MN.L10n.Analyzer/MN.L10n.Analyzer.Test/MNL10nAnalyzerUnitTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,32 @@ Vänligen bekräfta ditt intresse genom att klicka på länken nedan.
VerifyCSharpDiagnostic(test, expectations.ToArray());
}

[Fact]
public void Test_MN0009_MissingKeywordsWhenArgumentIsNull()
{
var test = @"
namespace ConsoleApplication1
{
class TypeName
{
public void Main() {
_s(""Testing $someParameter$"", null);
}
}
}";

VerifyCSharpDiagnostic(test, new DiagnosticResult
{
Id = "MN0009",
Message = "L10n is missing '$someParameter$' in the object for keywords",
Severity = DiagnosticSeverity.Error,
Locations =
[
new DiagnosticResultLocation("Test0.cs", 7, 6)
]
});
}

protected override CodeFixProvider GetCSharpCodeFixProvider()
{
return new MNL10nCodeFixProvider();
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

Rule ID | Category | Severity | Notes
--------|----------|----------|-------
MN0001 | L10n | Error | MNL10nAnalyzer
MN0002 | L10n | Error | MNL10nAnalyzer
MN0003 | L10n | Error | MNL10nAnalyzer
MN0004 | L10n | Error | MNL10nAnalyzer
Expand Down
30 changes: 15 additions & 15 deletions MN.L10n.Analyzer/MN.L10n.Analyzer/MN.L10n.Analyzer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<IncludeBuildOutput>false</IncludeBuildOutput>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<PublishSingleFile>true</PublishSingleFile>
<EnforceExtendedAnalyzerRules>true</EnforceExtendedAnalyzerRules>
<Nullable>enable</Nullable>
<LangVersion>latest</LangVersion>
<IsRoslynComponent>true</IsRoslynComponent>
<IncludeBuildOutput>false</IncludeBuildOutput>
</PropertyGroup>

<PropertyGroup>
Expand All @@ -21,32 +24,29 @@
<Copyright></Copyright>
<PackageTags>MN.L10n.Analyzer, analyzers</PackageTags>
<NoPackageAnalysis>true</NoPackageAnalysis>
<Version>4.0.2</Version>
<Version>5.0.0</Version>
<Company>MultiNet Interactive AB</Company>
</PropertyGroup>

<PropertyGroup>
<PlatformTarget>x64</PlatformTarget>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis" Version="4.13.0" />
<PackageReference Update="NETStandard.Library" PrivateAssets="all" />
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="5.3.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="5.3.0" PrivateAssets="all" />
</ItemGroup>

<ItemGroup>
<Compile Update="Resources.Designer.cs" DesignTime="True" AutoGen="True" DependentUpon="Resources.resx" />
<EmbeddedResource Update="Resources.resx" Generator="ResXFileCodeGenerator" LastGenOutput="Resources.Designer.cs" />
</ItemGroup>

<ItemGroup>
<None Update="tools\*.ps1" CopyToOutputDirectory="Always" Pack="true" PackagePath="" />
<None Include="$(OutputPath)\$(AssemblyName).dll" Pack="true" PackagePath="analyzers/dotnet/cs" Visible="false" />
</ItemGroup>

<ItemGroup>
<AdditionalFiles Include="AnalyzerReleases.Shipped.md" />
<AdditionalFiles Include="AnalyzerReleases.Unshipped.md" />
</ItemGroup>


<ItemGroup>
<None Update="tools\*.ps1" CopyToOutputDirectory="Always" Pack="true" PackagePath="" />
<None Include="$(OutputPath)\$(AssemblyName).dll" Pack="true" PackagePath="analyzers/dotnet/cs" Visible="false" />
</ItemGroup>
</Project>
Loading
Loading