Skip to content

Commit 93275aa

Browse files
fix(S1075): replace hardcoded ToolInformationUri with ThisAssembly.Info.RepositoryUrl (#73)
* Initial plan * fix: resolve SonarCloud S1075 by replacing hardcoded URI with ThisAssembly.Info.RepositoryUrl Agent-Logs-Url: https://github.com/304NotModified/SLNX-validator/sessions/7405df7a-70cc-4543-b4af-eae493ce9100 Co-authored-by: 304NotModified <5808377+304NotModified@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: 304NotModified <5808377+304NotModified@users.noreply.github.com>
1 parent b19dca0 commit 93275aa

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

src/SLNX-validator.Core/SLNX-validator.Core.csproj

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@
1515
<ItemGroup>
1616
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.*" />
1717
<PackageReference Include="Microsoft.Extensions.FileSystemGlobbing" Version="*" />
18+
<PackageReference Include="ThisAssembly.AssemblyInfo" Version="2.*" PrivateAssets="all" />
19+
</ItemGroup>
20+
21+
<ItemGroup>
22+
<Constant Include="Info.RepositoryUrl" Value="$(RepositoryUrl)" Root="." RootComment="Provides access to assembly attributes defined in the project as constants." />
1823
</ItemGroup>
1924

2025
</Project>

src/SLNX-validator.Core/SarifReporting/SarifReporter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ public sealed class SarifReporter(IFileSystem fileSystem) : ReporterBase(fileSys
1010
private const string SarifSchema = "https://json.schemastore.org/sarif-2.1.0.json";
1111
private const string SarifVersion = "2.1.0";
1212
private const string ToolName = "slnx-validator";
13-
private const string ToolInformationUri = "https://github.com/304NotModified/SLNX-validator";
13+
private static readonly string ToolInformationUri = ThisAssembly.Info.RepositoryUrl;
1414

1515
public override async Task WriteReportAsync(ReportResults reportResults, Stream outputStream)
1616
{

0 commit comments

Comments
 (0)