Skip to content
forked from belav/csharpier

CSharpier is an opinionated code formatter for c#.

License

Notifications You must be signed in to change notification settings

Exiled1/csharpier

This branch is 11 commits ahead of, 221 commits behind belav/csharpier:main.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

750d2e2 · Jan 17, 2024
Nov 7, 2023
Dec 16, 2023
Jan 18, 2022
Dec 22, 2023
Jan 4, 2023
Jan 15, 2024
Oct 1, 2023
Dec 10, 2023
Jan 17, 2024
Jan 10, 2024
Jan 12, 2024
May 2, 2021
Feb 21, 2022
Feb 27, 2023
Dec 22, 2021
Nov 26, 2023
Jan 17, 2024
Oct 18, 2021
Dec 4, 2023
Nov 20, 2023
Jan 15, 2024
Jan 15, 2024
Nov 16, 2023
Nov 28, 2023
Feb 10, 2021
Aug 15, 2022
Feb 26, 2022
Nov 16, 2023
Jan 22, 2022
Jan 22, 2022
Nov 29, 2022
Aug 15, 2023

Repository files navigation

CSharpier

CSharpier is an opinionated code formatter for c#. It uses Roslyn to parse 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 csharpier -g

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

dotnet csharpier .

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

About

CSharpier is an opinionated code formatter for c#.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 92.1%
  • TypeScript 3.0%
  • Java 2.7%
  • PowerShell 0.9%
  • JavaScript 0.5%
  • CSS 0.4%
  • Other 0.4%