Skip to content

anderbellstudios/csharpier

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fork of the CSharpier project with the K&R Style (opening brace on the same line, rather than on the next line).

Quick Start

Unfortunately you'll have to compile this by yourself. With dotnet SDK set up, it shouldn't be too hard.

dotnet pack ./Src/CSharpier.Cli/CSharpier.Cli.csproj -c Release -o dist

Your binaries should be available in Src/CSharpier.Cli/bin/Release/net8.0 (and net9.0)

Running CSharpier.exe format . formats a whole dir.

VSCode (format on save)

After compiling your own binary, install the vehmloewff.custom-format extension (which allows you to run any command to format code)

    "custom-format.formatters": [
        {
            "language": "csharp",
            "command": "path/to/CSharpier.exe format"
        },
    ],
    "[csharp]": {
        "editor.rulers": [ 100 ],
        "editor.formatOnSave": true,
        "editor.defaultFormatter": "Vehmloewff.custom-format",
    },

Before

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

After (this fork)

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

After (original CSharpier)

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

About

CSharpier is an opinionated code formatter for c#.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 93.0%
  • TypeScript 3.2%
  • Java 2.3%
  • PowerShell 0.6%
  • JavaScript 0.3%
  • CSS 0.2%
  • Other 0.4%