Skip to content

Commit

Permalink
json
Browse files Browse the repository at this point in the history
  • Loading branch information
matkoch committed Aug 28, 2024
1 parent 44173c5 commit e9209b5
Show file tree
Hide file tree
Showing 25 changed files with 899 additions and 2,745 deletions.
8 changes: 4 additions & 4 deletions build/Build.Announce.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ partial class Build
.Executes(async () =>
{
await SendSlackMessageAsync(_ => _
.AddAttachment(_ => _
.AddAttachments(_ => _
.SetFallback(AnnouncementTitle)
.SetAuthorName(AnnouncementTitle)
.SetAuthorLink(AnnouncementLink)
Expand Down Expand Up @@ -117,10 +117,10 @@ await SendSlackMessageAsync(_ => _
{
await SendDiscordMessageAsync(_ => _
.SetContent("@everyone")
.AddEmbed(_ => _
.AddEmbeds(_ => _
.SetTitle(AnnouncementTitle)
.SetColor(AnnouncementColor)
.SetThumbnail(new DiscordEmbedThumbnail()
.SetThumbnail(_ => _
.SetUrl(AnnouncementThumbnailUrl))
.SetDescription(new StringBuilder()
.Append($"This [release]({AnnouncementLink}) includes *[{AnnouncementGitInfo.CommitsText}]({AnnouncementComparisonUrl})*")
Expand All @@ -132,7 +132,7 @@ await SendDiscordMessageAsync(_ => _
.AppendLine()
.AppendLine(AnnouncementReleaseNotes).ToString()
.Replace("*", "**"))
.SetFooter(new DiscordEmbedFooter()
.SetFooter(_ => _
.SetText($"Powered by {AnnouncementSponsors.Select(x => x.Text).JoinCommaAnd()}.")
.SetIconUrl("https://cdn.discordapp.com/emojis/674275938757771306.webp?size=240&quality=lossless"))),
DiscordWebhook);
Expand Down
6 changes: 3 additions & 3 deletions build/Build.CodeGeneration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ partial class Build
"CorFlags.json",
"CoverallsNet.json",
"Coverlet.json",
// "Discord.json",
"Discord.json",
"DocFX.json",
"Docker.json",
"DotCover.json",
Expand All @@ -63,7 +63,7 @@ partial class Build
"MSBuild.json",
"MSpec.json",
"MakeNSIS.json",
// "Mastodon.json",
"Mastodon.json",
"MauiCheck.json",
"MinVer.json",
// "NSwag.json",
Expand All @@ -83,7 +83,7 @@ partial class Build
"ReportGenerator.json",
"SignClient.json",
"SignTool.json",
// "Slack.json",
"Slack.json",
"SonarScanner.json",
"SpecFlow.json",
"Squirrel.json",
Expand Down
12 changes: 12 additions & 0 deletions source/Nuke.Common.Tests/SettingsTest.TestDiscord.verified.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"nonce": "nonce",
"channel_id": "channel-id",
"embeds": [
{
"type": "article",
"author": {
"name": "author-name"
}
}
]
}
10 changes: 6 additions & 4 deletions source/Nuke.Common.Tests/SettingsTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,12 @@ public Task TestDiscord()
var result = new DiscordMessage()
.SetNonce("nonce")
.SetChannelId("channel-id")
.SetEmbeds(new DiscordEmbed()
.SetAuthor(new DiscordEmbedAuthor()
.SetName("author-name")));
.AddEmbeds(_ => _
.SetType(DiscordEmbedType.article)
.SetAuthor(_ => _

Check warning on line 155 in source/Nuke.Common.Tests/SettingsTest.cs

View workflow job for this annotation

GitHub Actions / Qodana for .NET

Potentially misleading parameter name in lambda or local function

The '_' name is typically reserved for parameters without usages
.SetName("author-name")))
.ToJson(Options.JsonSerializerSettings);

return Verifier.Verify(result.ToJson());
return Verifier.Verify(result);
}
}
2 changes: 1 addition & 1 deletion source/Nuke.Common/Tools/Codecov/Codecov.Generated.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public partial class CodecovSettings : ToolOptions
/// <summary>Verbose mode.</summary>
[Argument(Format = "--verbose")] public bool? Verbose => Get<bool?>(() => Verbose);
/// <summary></summary>
[Argument()] public string Framework => Get<string>(() => Framework);
public string Framework => Get<string>(() => Framework);
}
#endregion
#region CodecovSettingsExtensions
Expand Down
Loading

0 comments on commit e9209b5

Please sign in to comment.