Skip to content

Commit 313e6da

Browse files
devlooped-botkzu
authored andcommitted
⬆️ Bump files with dotnet-file sync
# devlooped/oss - Simplify .gitattributes devlooped/oss@5f92a68 # devlooped/SponsorLink - Add overload to simplify getting or setting status devlooped/SponsorLink@efda32a
1 parent 4f6c0bc commit 313e6da

File tree

5 files changed

+35
-31
lines changed

5 files changed

+35
-31
lines changed

.gitattributes

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,8 @@
1-
# sln, csproj files (and friends) are always CRLF, even on linux
2-
*.sln text eol=crlf
3-
*.proj text eol=crlf
4-
*.csproj text eol=crlf
1+
# normalize by default
2+
* text=auto encoding=UTF-8
3+
*.sh text eol=lf
54

65
# These are windows specific files which we may as well ensure are
76
# always crlf on checkout
87
*.bat text eol=crlf
98
*.cmd text eol=crlf
10-
11-
# Opt in known filetypes to always normalize line endings on checkin
12-
# and always use native endings on checkout
13-
*.c text
14-
*.config text
15-
*.h text
16-
*.cs text
17-
*.md text
18-
*.tt text
19-
*.txt text
20-
21-
# Some must always be checked out as lf so enforce that for those files
22-
# If these are not lf then bash/cygwin on windows will not be able to
23-
# excute the files
24-
*.sh text eol=lf

.netconfig

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@
2020
sha = e81ab754b366d52d92bd69b24bef1d5b1c610634
2121
[file ".gitattributes"]
2222
url = https://github.com/devlooped/oss/blob/main/.gitattributes
23-
etag = 7acb32f5fa6d4ccd9c824605a7c2b8538497f0068c165567807d393dcf4d6bb7
23+
etag = 338ba6d92c8d1774363396739c2be4257bfc58026f4b0fe92cb0ae4460e1eff7
2424
weak
25-
sha = 0683ee777d7d878d4bf013d7deea352685135a05
25+
sha = 5f92a68e302bae675b394ef343114139c075993e
2626
[file ".github/dependabot.yml"]
2727
url = https://github.com/devlooped/oss/blob/main/.github/dependabot.yml
2828
etag = c147ea2f3431ca0338c315c4a45b56ee233c4d30f8d6ab698d0e1980a257fd6a
@@ -146,8 +146,8 @@
146146
weak
147147
[file "src/SponsorLink/Analyzer/StatusReportingGenerator.cs"]
148148
url = https://github.com/devlooped/SponsorLink/blob/main/samples/dotnet/Analyzer/StatusReportingGenerator.cs
149-
sha = 38a11504cc9cbd994fb7380fd580102e7514b3b5
150-
etag = 8a457fdb6d22be34740ae474f4dfc32e55696093d315519e08dd2280c8cb3745
149+
sha = efda32a6eaaeffa485fb480e31adfd2f8130bd48
150+
etag = 34dd69526941ce9c6eb8fe259020333b2b55c8422d1d620eb431a8ba7125b3f9
151151
weak
152152
[file "src/SponsorLink/Analyzer/buildTransitive/SponsorableLib.targets"]
153153
url = https://github.com/devlooped/SponsorLink/blob/main/samples/dotnet/Analyzer/buildTransitive/SponsorableLib.targets
@@ -191,8 +191,8 @@
191191
weak
192192
[file "src/SponsorLink/SponsorLink/DiagnosticsManager.cs"]
193193
url = https://github.com/devlooped/SponsorLink/blob/main/samples/dotnet/SponsorLink/DiagnosticsManager.cs
194-
sha = 46e9abe02e5a6abadda66ef050ddc5b9859aa2b8
195-
etag = 72fe901dd67f30c1b78990599303ec6f409b2021a6da20edd66cc57f5d6e299c
194+
sha = efda32a6eaaeffa485fb480e31adfd2f8130bd48
195+
etag = 76c240a3677af6c7f474ec65f0d883a746137a122ad986f8356753e2d03372c3
196196
weak
197197
[file "src/SponsorLink/SponsorLink/ManifestStatus.cs"]
198198
url = https://github.com/devlooped/SponsorLink/blob/main/samples/dotnet/SponsorLink/ManifestStatus.cs
@@ -211,8 +211,8 @@
211211
weak
212212
[file "src/SponsorLink/SponsorLink/SponsorLink.cs"]
213213
url = https://github.com/devlooped/SponsorLink/blob/main/samples/dotnet/SponsorLink/SponsorLink.cs
214-
sha = f6fd85da07d1b52922fb48676d9aed9f1aef782b
215-
etag = 0904bd22c6abf4a5a4f6334ee38413eddcf2af8540901b3541f68ae0c20ce6d3
214+
sha = efda32a6eaaeffa485fb480e31adfd2f8130bd48
215+
etag = 555128f4279241225b4dc8bb2ec8835894edfe9f6b9223399ee8cb3dc7adaf06
216216
weak
217217
[file "src/SponsorLink/SponsorLink/SponsorLink.csproj"]
218218
url = https://github.com/devlooped/SponsorLink/blob/main/samples/dotnet/SponsorLink/SponsorLink.csproj

src/SponsorLink/Analyzer/StatusReportingGenerator.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,14 @@ public void Initialize(IncrementalGeneratorInitializationContext context)
1212
context.RegisterSourceOutput(
1313
// this is required to ensure status is registered properly independently
1414
// of analyzer runs.
15-
context.GetSponsorAdditionalFiles().Combine(context.AnalyzerConfigOptionsProvider),
15+
context.GetStatusOptions(),
1616
(spc, source) =>
1717
{
18-
var (manifests, options) = source;
19-
var status = Diagnostics.GetOrSetStatus(manifests, options);
18+
var status = Diagnostics.GetOrSetStatus(source);
2019
spc.AddSource("StatusReporting.cs",
2120
$"""
2221
// Status: {status}
23-
// DesignTimeBuild: {options.IsDesignTimeBuild()}
22+
// DesignTimeBuild: {source.GlobalOptions.IsDesignTimeBuild()}
2423
""");
2524
spc.ReportDiagnostic(Diagnostic.Create("SL200", "Compiler", "Don't disable me!",
2625
DiagnosticSeverity.Warning,

src/SponsorLink/SponsorLink/DiagnosticsManager.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,13 @@ ConcurrentDictionary<string, Diagnostic> Diagnostics
6868
public SponsorStatus GetOrSetStatus(ImmutableArray<AdditionalText> manifests, AnalyzerConfigOptionsProvider options)
6969
=> GetOrSetStatus(() => manifests, () => options.GlobalOptions);
7070

71+
/// <summary>
72+
/// Gets the status of the <see cref="Funding.Product"/>, or sets it from
73+
/// the given set of <paramref name="options"/> if not already set.
74+
/// </summary>
75+
public SponsorStatus GetOrSetStatus(StatusOptions options)
76+
=> GetOrSetStatus(() => options.AdditionalFiles, () => options.GlobalOptions);
77+
7178
/// <summary>
7279
/// Gets the status of the <see cref="Funding.Product"/>, or sets it from
7380
/// the given analyzer <paramref name="options"/> if not already set.

src/SponsorLink/SponsorLink/SponsorLink.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@ namespace Devlooped.Sponsors;
1818

1919
static partial class SponsorLink
2020
{
21+
public record StatusOptions(ImmutableArray<AdditionalText> AdditionalFiles, AnalyzerConfigOptions GlobalOptions);
22+
23+
/// <summary>
24+
/// Statically cached dictionary of sponsorable accounts and their public key (in JWK format),
25+
/// retrieved from assembly metadata attributes starting with "Funding.GitHub.".
26+
/// </summary>
2127
public static Dictionary<string, string> Sponsorables { get; } = typeof(SponsorLink).Assembly
2228
.GetCustomAttributes<AssemblyMetadataAttribute>()
2329
.Where(x => x.Key.StartsWith("Funding.GitHub."))
@@ -93,6 +99,14 @@ public static IncrementalValueProvider<ImmutableArray<AdditionalText>> GetSponso
9399
.Select((source, c) => source.Left)
94100
.Collect();
95101

102+
/// <summary>
103+
/// Gets the status options for use within an incremental generator, to avoid depending on
104+
/// analyzer runs. Used in combination with <see cref="DiagnosticsManager.GetOrSetStatus(StatusOptions)"/>.
105+
/// </summary>
106+
public static IncrementalValueProvider<StatusOptions> GetStatusOptions(this IncrementalGeneratorInitializationContext context)
107+
=> context.GetSponsorAdditionalFiles().Combine(context.AnalyzerConfigOptionsProvider)
108+
.Select((source, _) => new StatusOptions(source.Left, source.Right.GlobalOptions));
109+
96110
static bool IsSponsorManifest(this AdditionalText text, AnalyzerConfigOptionsProvider provider)
97111
=> provider.GetOptions(text).TryGetValue("build_metadata.SponsorManifest.ItemType", out var itemType) &&
98112
itemType == "SponsorManifest" &&

0 commit comments

Comments
 (0)