From 56895ea621a6f6ce0081f5790c76535bb034d46a Mon Sep 17 00:00:00 2001 From: Brendan Forster Date: Thu, 6 Feb 2020 10:48:38 -0400 Subject: [PATCH] move formatting code to optional flag (#2085) * move formatting code to flag * reformat code --- Octokit/Models/Common/CheckStatus.cs | 2 +- build/Context.cs | 1 + build/Lifetime.cs | 1 + build/Tasks/FormatCode.cs | 2 +- 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Octokit/Models/Common/CheckStatus.cs b/Octokit/Models/Common/CheckStatus.cs index f6ce856b..2c109a91 100644 --- a/Octokit/Models/Common/CheckStatus.cs +++ b/Octokit/Models/Common/CheckStatus.cs @@ -37,7 +37,7 @@ namespace Octokit [Parameter(Value = "skipped")] Skipped, - + [Parameter(Value = "stale")] Stale, } diff --git a/build/Context.cs b/build/Context.cs index 62020375..c6111a08 100644 --- a/build/Context.cs +++ b/build/Context.cs @@ -10,6 +10,7 @@ public class Context : FrostingContext public string Target { get; set; } public new string Configuration { get; set; } public bool LinkSources { get; set; } + public bool FormatCode { get; set; } public BuildVersion Version { get; set; } public DirectoryPath Artifacts { get; set; } diff --git a/build/Lifetime.cs b/build/Lifetime.cs index 929066f8..0075dd74 100644 --- a/build/Lifetime.cs +++ b/build/Lifetime.cs @@ -12,6 +12,7 @@ public class Lifetime : FrostingLifetime context.Target = context.Argument("target", "Default"); context.Configuration = context.Argument("configuration", "Release"); context.LinkSources = context.Argument("linkSources", false); + context.FormatCode = context.Argument("formatCode", false); context.Artifacts = "./packaging/"; context.CodeCoverage = "./coverage-results/"; diff --git a/build/Tasks/FormatCode.cs b/build/Tasks/FormatCode.cs index 09e94a1b..49353a33 100644 --- a/build/Tasks/FormatCode.cs +++ b/build/Tasks/FormatCode.cs @@ -15,6 +15,6 @@ public sealed class FormatCode : FrostingTask public override bool ShouldRun(Context context) { - return context.IsLocalBuild; + return context.FormatCode; } }