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

glmnet/csharpier

This branch is 465 commits behind belav/csharpier:main.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

4aabbf0 · Oct 3, 2022
Aug 22, 2022
Jun 6, 2022
Jan 18, 2022
Feb 21, 2022
Aug 26, 2022
Oct 3, 2022
Oct 3, 2022
May 2, 2021
Feb 21, 2022
Dec 22, 2021
May 21, 2022
Oct 3, 2022
Oct 18, 2021
Oct 3, 2022
Nov 10, 2021
Jun 6, 2022
Jan 3, 2022
Jun 6, 2022
Feb 21, 2022
Feb 10, 2021
Aug 15, 2022
Feb 26, 2022
Jun 6, 2022
Jan 22, 2022
Jan 22, 2022

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.2%
  • TypeScript 2.9%
  • Java 2.6%
  • PowerShell 0.6%
  • JavaScript 0.6%
  • CSS 0.4%
  • Other 0.7%