mirror of
https://github.com/Facepunch/sbox-public.git
synced 2026-01-02 11:28:19 -05:00
This commit imports the C# engine code and game files, excluding C++ source code. [Source-Commit: ceb3d758046e50faa6258bc3b658a30c97743268]
31 lines
730 B
C#
31 lines
730 B
C#
using static Facepunch.Constants;
|
|
|
|
namespace Facepunch.Steps;
|
|
|
|
internal class Format( string name, Constants.Solutions solution, Format.Mode mode = Format.Mode.Full, bool verifyOnly = false ) : Step( name )
|
|
{
|
|
public enum Mode
|
|
{
|
|
Full = 0,
|
|
Whitespace = 1,
|
|
}
|
|
|
|
protected override ExitCode RunInternal()
|
|
{
|
|
var solutionDir = Constants.GetSolutionDir( solution );
|
|
|
|
var modeArgs = mode == Mode.Whitespace ? "whitespace --folder" : "";
|
|
if ( verifyOnly )
|
|
{
|
|
modeArgs += " --verify-no-changes";
|
|
}
|
|
if ( !Utility.RunDotnetCommand( solutionDir, $"format {modeArgs}" ) )
|
|
{
|
|
return ExitCode.Failure;
|
|
}
|
|
|
|
Log.Error( $"Format completed successfully for {solution} in mode {mode}" );
|
|
return ExitCode.Success;
|
|
}
|
|
}
|