Skip to content

Commit

Permalink
Cosmetic changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ScarletKuro committed May 30, 2024
1 parent aa74a36 commit 9319230
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 13 deletions.
12 changes: 6 additions & 6 deletions build/Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,17 @@
"continuous",
GitHubActionsImage.UbuntuLatest,
FetchDepth = 0,
On = new[] { GitHubActionsTrigger.Push },
On = [GitHubActionsTrigger.Push],
PublishArtifacts = true,
InvokedTargets = new[] { nameof(Compile), nameof(Pack) })]
InvokedTargets = [nameof(Compile), nameof(Pack)])]
[GitHubActions(
"release",
GitHubActionsImage.UbuntuLatest,
FetchDepth = 0,
OnPushTags = new[] { @"\d+\.\d+\.\d+" },
OnPushTags = [@"\d+\.\d+\.\d+"],
PublishArtifacts = true,
InvokedTargets = new[] { nameof(Push), nameof(PushGithubNuget) },
ImportSecrets = new[] { nameof(NugetKey), nameof(GithubToken) })]
InvokedTargets = [nameof(Push), nameof(PushGithubNuget)],
ImportSecrets = [nameof(NugetKey), nameof(GithubToken)])]
class Build : NukeBuild
{
/// Support plugins are available for:
Expand All @@ -44,7 +44,7 @@ class Build : NukeBuild
[Parameter("Configuration to build - Default is 'Debug' (local) or 'Release' (server)")]
readonly Configuration Configuration = Configuration.Release;

[Parameter] string NugetApiUrl = "https://api.nuget.org/v3/index.json"; //default
[Parameter] readonly string NugetApiUrl = "https://api.nuget.org/v3/index.json"; //default
[Parameter][Secret] readonly string NugetKey;
[Parameter][Secret] readonly string GithubToken;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,16 @@ private static ClassDeclarationSyntax GenerateMaterialSymbolsClass(KeyValuePair<

private static ClassDeclarationSyntax GenerateFamilyClass(KeyValuePair<string, IReadOnlyCollection<Icon>> group, string className, string familyPath)
{
return SyntaxFactory.ClassDeclaration(className)
return SyntaxFactory
.ClassDeclaration(className)
.AddModifiers(SyntaxFactory.Token(SyntaxKind.PublicKeyword), SyntaxFactory.Token(SyntaxKind.StaticKeyword), SyntaxFactory.Token(SyntaxKind.PartialKeyword))
.AddMembers(group.Value.Select(icon => GenerateIconField(icon, familyPath)).Cast<MemberDeclarationSyntax>().ToArray());
}

private static bool IsKeyword(string keyword)
{
var syntaxKind = SyntaxFacts.GetKeywordKind(keyword);

return SyntaxFacts.IsKeywordKind(syntaxKind);
}

Expand Down
8 changes: 4 additions & 4 deletions src/GoogleMaterialDesignIconsGenerator/Model/Google/Icon.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@ public class Icon : IEquatable<Icon>
public int Codepoint { get; init; }

[JsonPropertyName("unsupported_families")]
public IReadOnlyCollection<string> UnsupportedFamilies { get; init; } = ReadOnlyCollection<string>.Empty;
public IReadOnlyCollection<string> UnsupportedFamilies { get; init; } = [];

[JsonPropertyName("categories")]
public IReadOnlyCollection<string> Categories { get; init; } = ReadOnlyCollection<string>.Empty;
public IReadOnlyCollection<string> Categories { get; init; } = [];

[JsonPropertyName("tags")]
public IReadOnlyCollection<string> Tags { get; init; } = ReadOnlyCollection<string>.Empty;
public IReadOnlyCollection<string> Tags { get; init; } = [];

[JsonPropertyName("sizes_px")]
public IReadOnlyCollection<int> SizesPx { get; init; } = ReadOnlyCollection<int>.Empty;
public IReadOnlyCollection<int> SizesPx { get; init; } = [];

public bool Equals(Icon? other)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ public class IconsMetadata
#pragma warning restore CA1056 // URI-like properties should not be strings

[JsonPropertyName("families")]
public IReadOnlyCollection<string> Families { get; init; } = ReadOnlyCollection<string>.Empty;
public IReadOnlyCollection<string> Families { get; init; } = [];

[JsonPropertyName("icons")]
public IReadOnlyCollection<Icon> Icons { get; init; } = ReadOnlyCollection<Icon>.Empty;
public IReadOnlyCollection<Icon> Icons { get; init; } = [];
}
2 changes: 2 additions & 0 deletions src/GoogleMaterialDesignIconsGenerator/Utility/FamilyMap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ public static bool IsMaterialSymbolFamily(string family)
public static string FamilyNameToCsharpClassName(string familyName)
{
ArgumentNullException.ThrowIfNull(familyName);

return familyName switch
{
// Material Symbols
Expand All @@ -133,6 +134,7 @@ public static string FamilyNameToCsharpClassName(string familyName)
public static string FamilyNameToHtmlClassName(string familyName)
{
ArgumentNullException.ThrowIfNull(familyName);

return familyName switch
{
// Material Symbols
Expand Down

0 comments on commit 9319230

Please sign in to comment.