mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-06-06 12:03:19 +00:00
56895ea621
* move formatting code to flag * reformat code
21 lines
491 B
C#
21 lines
491 B
C#
using System;
|
|
using Cake.Common;
|
|
using Cake.Frosting;
|
|
|
|
public sealed class FormatCode : FrostingTask<Context>
|
|
{
|
|
public override void Run(Context context)
|
|
{
|
|
int result = context.StartProcess(context.DotNetFormatToolPath);
|
|
if (result != 0)
|
|
{
|
|
throw new Exception($"Failed to execute {context.DotNetFormatToolPath} ({result})");
|
|
}
|
|
}
|
|
|
|
public override bool ShouldRun(Context context)
|
|
{
|
|
return context.FormatCode;
|
|
}
|
|
}
|