csharp_new_line_before_open_brace

Which constructs put their opening brace on a new line.

Value Notes
all
none
types
methods
accessors
anonymous_types
anonymous_methods
lambdas
control_blocks
object_collection_array_initializers
properties
events

Default: all

Curb's output is not always a fixed point of the tool(s) below for this key — see conformance divergences for the full registry.

  • dotnet-format-whitespace: Same fallback-mismatch shape as csharp_indent_labels: Curb falls back to the documented default (all/Allman) for an unrecognised value. Measured: dotnet format leaves the source untouched for the same unrecognised value, i.e. it silently skips applying the setting rather than falling back to its own documented default. (NewLineBeforeOpenBraceTests.An_unrecognised_value_falls_back_to_the_default)
  • ide0055: Same fallback-mismatch divergence as the dotnet-format-whitespace entry above (Curb falls back to the documented default for an unrecognised value; dotnet format's own fallback for the same invalid value disagrees), now confirmed to reproduce under a real, analyzer-driven dotnet build -p:EnforceCodeStyleInBuild=true too, not just the dotnet format whitespace CLI — expected, since IDE0055 is the same underlying Roslyn formatting engine. (NewLineBeforeOpenBraceTests.An_unrecognised_value_falls_back_to_the_default)
csharp_new_line_before_open_brace = all
		
namespace N;

public class Widget {
    public int X { get; set; }

    public void Run() {
        if (X > 0) {
            X--;
        }
    }
}
		
namespace N;

public class Widget
{
    public int X { get; set; }

    public void Run()
    {
        if (X > 0)
        {
            X--;
        }
    }
}
		
csharp_new_line_before_open_brace = none
		
namespace N;

public class Widget
{
    public int X { get; set; }

    public void Run()
    {
        if (X > 0)
        {
            X--;
        }
    }
}
		
namespace N;

public class Widget
{
    public int X { get; set; }

    public void Run()
    {
        if (X > 0)
        {
            X--;
        }
    }
}
		
csharp_new_line_before_open_brace = types
		
namespace N;

public class Widget
{
    public int X { get; set; }

    public void Run()
    {
        if (X > 0)
        {
            X--;
        }
    }
}
		
namespace N;

public class Widget
{
    public int X { get; set; }

    public void Run()
    {
        if (X > 0)
        {
            X--;
        }
    }
}
		
csharp_new_line_before_open_brace = methods
		
namespace N;

public class Widget
{
    public int X { get; set; }

    public void Run()
    {
        if (X > 0)
        {
            X--;
        }
    }
}
		
namespace N;

public class Widget
{
    public int X { get; set; }

    public void Run()
    {
        if (X > 0)
        {
            X--;
        }
    }
}
		
csharp_new_line_before_open_brace = accessors
		
namespace N;

public class Widget
{
    public int X { get; set; }

    public void Run()
    {
        if (X > 0)
        {
            X--;
        }
    }
}
		
namespace N;

public class Widget
{
    public int X { get; set; }

    public void Run()
    {
        if (X > 0)
        {
            X--;
        }
    }
}
		
csharp_new_line_before_open_brace = anonymous_types
		
namespace N;

public class Widget
{
    public int X { get; set; }

    public void Run()
    {
        if (X > 0)
        {
            X--;
        }
    }
}
		
namespace N;

public class Widget
{
    public int X { get; set; }

    public void Run()
    {
        if (X > 0)
        {
            X--;
        }
    }
}
		
csharp_new_line_before_open_brace = anonymous_methods
		
namespace N;

public class Widget
{
    public int X { get; set; }

    public void Run()
    {
        if (X > 0)
        {
            X--;
        }
    }
}
		
namespace N;

public class Widget
{
    public int X { get; set; }

    public void Run()
    {
        if (X > 0)
        {
            X--;
        }
    }
}
		
csharp_new_line_before_open_brace = lambdas
		
namespace N;

public class Widget
{
    public int X { get; set; }

    public void Run()
    {
        if (X > 0)
        {
            X--;
        }
    }
}
		
namespace N;

public class Widget
{
    public int X { get; set; }

    public void Run()
    {
        if (X > 0)
        {
            X--;
        }
    }
}
		
csharp_new_line_before_open_brace = control_blocks
		
namespace N;

public class Widget
{
    public int X { get; set; }

    public void Run()
    {
        if (X > 0)
        {
            X--;
        }
    }
}
		
namespace N;

public class Widget
{
    public int X { get; set; }

    public void Run()
    {
        if (X > 0)
        {
            X--;
        }
    }
}
		
csharp_new_line_before_open_brace = object_collection_array_initializers
		
namespace N;

public class Widget
{
    public int X { get; set; }

    public void Run()
    {
        if (X > 0)
        {
            X--;
        }
    }
}
		
namespace N;

public class Widget
{
    public int X { get; set; }

    public void Run()
    {
        if (X > 0)
        {
            X--;
        }
    }
}
		
csharp_new_line_before_open_brace = properties
		
namespace N;

public class Widget
{
    public int X { get; set; }

    public void Run()
    {
        if (X > 0)
        {
            X--;
        }
    }
}
		
namespace N;

public class Widget
{
    public int X { get; set; }

    public void Run()
    {
        if (X > 0)
        {
            X--;
        }
    }
}
		
csharp_new_line_before_open_brace = events
		
namespace N;

public class Widget
{
    public int X { get; set; }

    public void Run()
    {
        if (X > 0)
        {
            X--;
        }
    }
}
		
namespace N;

public class Widget
{
    public int X { get; set; }

    public void Run()
    {
        if (X > 0)
        {
            X--;
        }
    }
}