Files
sbox-public/engine/Tools/SboxBuild/Steps/Format.cs
s&box team 71f266059a Open source release
This commit imports the C# engine code and game files, excluding C++ source code.

[Source-Commit: ceb3d758046e50faa6258bc3b658a30c97743268]
2025-11-24 09:05:18 +00:00

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;
}
}