Skip to content

Commit

Permalink
⬆️ Bump files with dotnet-file sync
Browse files Browse the repository at this point in the history
# devlooped/SponsorLink

- Allow disabling Info diagnostics globally devlooped/SponsorLink@d7090c1
- Update SponsorLink.Analyzer.Tests.targets devlooped/SponsorLink@058dbbc
  • Loading branch information
devlooped-bot authored and kzu committed Jul 24, 2024
1 parent 026ee06 commit 71c1835
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 9 deletions.
12 changes: 6 additions & 6 deletions .netconfig
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,8 @@
weak
[file "src/SponsorLink/SponsorLink/SponsorLinkAnalyzer.cs"]
url = https://github.com/devlooped/SponsorLink/blob/main/samples/dotnet/SponsorLink/SponsorLinkAnalyzer.cs
sha = f6fd85da07d1b52922fb48676d9aed9f1aef782b
etag = 3fdee3cef9d95765ac670408bb1c813bd6524415f2b3049f831ca7b02b277c17
sha = d7090c1dbcb20c68b99486a6dc53d86b8d9b06bb
etag = 2a94a016b5dc9371dc16ed57852acb8570ee0e6f3076fd749e1235e56ed142a0
weak
[file "src/SponsorLink/SponsorLink/SponsorStatus.cs"]
url = https://github.com/devlooped/SponsorLink/blob/main/samples/dotnet/SponsorLink/SponsorStatus.cs
Expand All @@ -241,8 +241,8 @@
weak
[file "src/SponsorLink/SponsorLink/buildTransitive/Devlooped.Sponsors.targets"]
url = https://github.com/devlooped/SponsorLink/blob/main/samples/dotnet/SponsorLink/buildTransitive/Devlooped.Sponsors.targets
sha = 5038d77597e956881dbb6e1d3f050f2c8dc21b4d
etag = f4e566aa471141e5064276f8e3668466e8bf907c4db2fbc533bcef90744c8c46
sha = d7090c1dbcb20c68b99486a6dc53d86b8d9b06bb
etag = e992b97517c9bcc6c9e927832bc13fac3036fa6d4ecaad893caf320b3c582aee
weak
[file "src/SponsorLink/SponsorLink/sponsorable.md"]
url = https://github.com/devlooped/SponsorLink/blob/main/samples/dotnet/SponsorLink/sponsorable.md
Expand Down Expand Up @@ -356,6 +356,6 @@
weak
[file "src/SponsorLink/SponsorLink.Analyzer.Tests.targets"]
url = https://github.com/devlooped/SponsorLink/blob/main/samples/dotnet/SponsorLink.Analyzer.Tests.targets
sha = e2d7e6f3b23ef5d5ead947f48c63efc77f3d4741
etag = 6959847d7e6425906530095e564f46bdfddf26995e6663142cfd2b065c0bb3c4
sha = 058dbbc3582042d7fdcaf5741db59d2b46ea1222
etag = 2d8bac60892b5565e3419b1fa775c5b977af202304ef3c25a4c6d04c7ac9faf1
weak
6 changes: 3 additions & 3 deletions src/SponsorLink/SponsorLink.Analyzer.Tests.targets
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@

<ItemGroup Condition="'$(ManagePackageVersionsCentrally)' == 'true'">
<PackageReference Include="Humanizer.Core" VersionOverride="2.14.1" PrivateAssets="all" Pack="false" />
<PackageReference Include="Microsoft.IdentityModel.JsonWebTokens" Version="8.0.0" PrivateAssets="all" Pack="false" />
<PackageReference Include="Microsoft.IdentityModel.JsonWebTokens" Version="8.0.1" PrivateAssets="all" Pack="false" />
</ItemGroup>

<ItemGroup Condition="'$(ManagePackageVersionsCentrally)' != 'true'">
<PackageReference Include="Humanizer.Core" Version="2.14.1" PrivateAssets="all" Pack="false" />
<PackageReference Include="Microsoft.IdentityModel.JsonWebTokens" Version="8.0.0" PrivateAssets="all" Pack="false" />
<PackageReference Include="Microsoft.IdentityModel.JsonWebTokens" Version="8.0.1" PrivateAssets="all" Pack="false" />
</ItemGroup>

<Target Name="AddSponsorLinkAnalyzerDependencies" BeforeTargets="CoreCompile" DependsOnTargets="ResolveLockFileCopyLocalFiles">
Expand All @@ -36,4 +36,4 @@
</ItemGroup>
</Target>

</Project>
</Project>
6 changes: 6 additions & 0 deletions src/SponsorLink/SponsorLink/SponsorLinkAnalyzer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ public override void Initialize(AnalysisContext context)
// multiple diagnostics for each project in a solution that uses the same product.
ctx.RegisterCompilationEndAction(ctx =>
{
// We'd never report Info/hero link if users opted out of it.
if (status == SponsorStatus.Sponsor &&
ctx.Options.AnalyzerConfigOptionsProvider.GlobalOptions.TryGetValue("build_property.SponsorLinkHero", out var slHero) &&
bool.TryParse(slHero, out var isHero) && isHero)
return;

// Only report if the package is directly referenced in the project for
// any of the funding packages we monitor (i.e. we could have one or more
// metapackages we also consider "direct references).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@

<!-- To quickly exit if true -->
<CompilerVisibleProperty Include="DesignTimeBuild" />

<!-- If the user declares himself already as a hero, we don't need to remind him via Info diagnostics -->
<CompilerVisibleProperty Include="SponsorLinkHero" />
</ItemGroup>

<PropertyGroup>
Expand Down

0 comments on commit 71c1835

Please sign in to comment.