Skip to content

chore: add CSharpier formatting#33

Draft
alsi-lawr wants to merge 7 commits into
neovim:masterfrom
alsi-lawr:feat/apply-csharpier-formatting
Draft

chore: add CSharpier formatting#33
alsi-lawr wants to merge 7 commits into
neovim:masterfrom
alsi-lawr:feat/apply-csharpier-formatting

Conversation

@alsi-lawr
Copy link
Copy Markdown
Contributor

@alsi-lawr alsi-lawr commented Jun 6, 2026

Adds CSharpier formatting for generated and hand-written C# code, with CI coverage for format checks.

Commits in order add the CI job and the csharpier application to the generated client before the large format changes.

Blocked by

Closes #27

@alsi-lawr alsi-lawr force-pushed the feat/apply-csharpier-formatting branch 2 times, most recently from 7ce85af to 72cffd0 Compare June 7, 2026 01:00
@alsi-lawr alsi-lawr force-pushed the feat/apply-csharpier-formatting branch from 72cffd0 to bad7419 Compare June 7, 2026 11:51
- Wanting to use the new extensions syntax from c#14

- Libraries already will support netstandard2.0, so no issues there if used in dotnet 8 projects in future

- CLI tool can be justified as dropping the last LTS for support as it's not a dependency in anything else
name,
(requestId, args) =>
{
Task.Run(() =>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like this is using 4-space indent. It should stay as 2-space indent.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see it using 4-space indent anywhere, can you point to a specific line? Csharpier respects whatever setting for indents we have in the .editorconfig, which is set to 2. There are only 4 configuration options for csharpier:

printWidth: 100
useTabs: false
indentSize: 4
endOfLine: auto

It will use whatever's in .editorconfig, or the defaults above, if no .csharpierrc is provided.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will also say that the standard for C# is 4-spaces, no tabs. Microsoft conventions here tend to win out in the majority of C# projects, and 2 spaces looks about as alien in C# as using spaces instead of tabs in go would look. These are definitely just 2 spaces, however.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

proposal: Add enforced CSharpier formatting

2 participants