Formatters
What is CSharpier? An introduction to the opinionated C# and XML formatter
CSharpier is an opinionated code formatter for C# and XML. It parses source code and re-prints it using its own rules, so formatting is decided by the tool instead of by individual style preferences. It can be installed in a project as a dotnet tool.
- Tool
- CSharpier
- Made by
- CSharpier
- Official site
- csharpier.com
- Category
- Formatters
Who makes CSharpier
CSharpier is published under the vendor name CSharpier. Its ongoing development is sponsored by the .NET on AWS Open Source Software Fund.
The official website is linked below.
Official website: csharpier.com
What CSharpier is for
CSharpier exists to format C# and XML code consistently. Rather than checking code against a list of style rules, it parses the source and prints it again using its own rules, so the output follows one fixed style.
The printing process was ported from prettier but has evolved since. CSharpier also follows prettier's Option Philosophy, which explains why it keeps configuration deliberately small.
Who CSharpier is for
The vendor does not state a target audience. From the facts available, CSharpier suits teams and individual developers who work in C# or XML and want a formatter to settle layout decisions for them.
Because it offers only a few basic formatting options and has no plans to add more, it fits people who are comfortable accepting its output as-is. Requests for new formatting options are out of scope and are closed without discussion.
Notable capabilities
CSharpier combines a deliberately narrow set of options with several ways to run it, from the editor to the build.
- Formats both C# and XML by parsing the source and re-printing it with its own rules.
- Offers only a few basic formatting options, following prettier's Option Philosophy.
- Integrates with the major C# IDEs.
- Installs in a project as a dotnet tool, and formats the project's contents with the dotnet csharpier format command.
- Can format on save in an editor, as a pre-commit hook, as part of a build, or programmatically.
- Supports validating the changes it makes.
- Works with a CI/CD tool to ensure code was formatted.
How CSharpier fits formatters
Among formatters, CSharpier is defined by its opinionated approach: it applies its own rules to C# and XML and keeps configuration to a few basic options. Teams adopting it agree to its style instead of tuning one.
In Linthelm's wider niche of linters, static analysis and code quality tools, a formatter handles layout while other tools examine code for problems. CSharpier belongs to the layout side. Its ability to run in an editor, a pre-commit hook, a build or CI/CD makes it easy to place alongside those other checks.
Frequently asked questions
What is CSharpier used for?
CSharpier is used to format C# and XML code. It parses source code and re-prints it using its own rules.
Does CSharpier support XML?
Yes. CSharpier is an opinionated code formatter for both C# and XML.
How do I run CSharpier on a project?
Install it in the project as a dotnet tool, then run the dotnet csharpier format command to format the project's contents.
Can CSharpier be configured extensively?
No. It offers only a few basic formatting options and has no plans to add more. Requests for new formatting options are out of scope and are closed without discussion.
Who funds CSharpier development?
Its ongoing development is sponsored by the .NET on AWS Open Source Software Fund.
Linthelm is independent and is not affiliated with CSharpier. Product names belong to their owners. Features change; confirm details on the official website.