belav/csharpier

CSharpier is an opinionated code formatter for c#.

2,322

stars

1,640

commits

C#

primary language

Sep 6, 2026

updated

csharpier.com
csharp
dotnet
formatter
prettier

README

CSharpier

CSharpier is an opinionated code formatter for c# and XML. It parses your code and re-prints it using its own rules. The printing process was ported from prettier but has evolved over time.

CSharpier provides a few basic options that affect formatting and has no plans to add more. It follows the Option Philosophy of prettier.

Quick Start

Install CSharpier globally using the following command.

dotnet tool install -g csharpier

Then format the contents of a directory and its children with the following command.

csharpier format .

CSharpier can also format on save in your editor or as a pre-commit hook. Then you can ensure code was formatted with a CI/CD tool.


Read the documentation

Try it out


Before

public class ClassName {
    public void CallMethod() { 
        this.LongUglyMethod("1234567890", "abcdefghijklmnopqrstuvwxyz", "ABCDEFGHIJKLMNOPQRSTUVWXYZ");
    }
}

After

public class ClassName
{
    public void CallMethod()
    {
        this.LongUglyMethod(
            "1234567890",
            "abcdefghijklmnopqrstuvwxyz",
            "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
        );
    }
}

Contributing

See Development Readme

Join Us Discord

Sponsors

Thanks to the following companies for sponsoring the ongoing development of CSharpier.

.NET on AWS Open Source Software Fund

Fern

And a huge thanks to all the others who sponsor the project through Github sponsors

Contributors

(top 30 of 78)

belav

1,446 commits

TimothyMakkison

47 commits

shocklateboy92

23 commits

stefannikolei

19 commits

belav/csharpier

CSharpier is an opinionated code formatter for c#.

2,322

stars

1,640

commits

C#

primary language

Sep 6, 2026

updated

csharpier.com
csharp
dotnet
formatter
prettier

README

CSharpier

CSharpier is an opinionated code formatter for c# and XML. It parses your code and re-prints it using its own rules. The printing process was ported from prettier but has evolved over time.

CSharpier provides a few basic options that affect formatting and has no plans to add more. It follows the Option Philosophy of prettier.

Quick Start

Install CSharpier globally using the following command.

dotnet tool install -g csharpier

Then format the contents of a directory and its children with the following command.

csharpier format .

CSharpier can also format on save in your editor or as a pre-commit hook. Then you can ensure code was formatted with a CI/CD tool.


Read the documentation

Try it out


Before

public class ClassName {
    public void CallMethod() { 
        this.LongUglyMethod("1234567890", "abcdefghijklmnopqrstuvwxyz", "ABCDEFGHIJKLMNOPQRSTUVWXYZ");
    }
}

After

public class ClassName
{
    public void CallMethod()
    {
        this.LongUglyMethod(
            "1234567890",
            "abcdefghijklmnopqrstuvwxyz",
            "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
        );
    }
}

Contributing

See Development Readme

Join Us Discord

Sponsors

Thanks to the following companies for sponsoring the ongoing development of CSharpier.

.NET on AWS Open Source Software Fund

Fern

And a huge thanks to all the others who sponsor the project through Github sponsors

Contributors

(top 30 of 78)

belav

1,446 commits

TimothyMakkison

47 commits

shocklateboy92

23 commits

stefannikolei

19 commits

Languages

C#

90.7%

TypeScript

3.7%

Java

3.4%