Skip to content

Commit

Permalink
feat: add CSharpier (#165)
Browse files Browse the repository at this point in the history
* Add formatter and update readme and conform.txt

* Remove unused variable
  • Loading branch information
JesperLundberg authored Oct 28, 2023
1 parent 2538784 commit b2368ff
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ You can view this list in vim with `:help conform-formatters`
- [cljstyle](https://github.com/greglook/cljstyle) - Formatter for Clojure code.
- [cmake_format](https://github.com/cheshirekow/cmake_format) - Parse cmake listfiles and format them nicely.
- [codespell](https://github.com/codespell-project/codespell) - Check code for common misspellings.
- [csharpier](https://github.com/belav/csharpier) - An opinionated C# formatter.
- [darker](https://github.com/akaihola/darker) - Run black only on changed lines.
- [dart_format](https://dart.dev/tools/dart-format) - Replace the whitespace in your program with formatting that follows Dart guidelines.
- [deno_fmt](https://deno.land/manual/tools/formatter) - Use [Deno](https://deno.land/) to format TypeScript, JavaScript/JSON and markdown.
Expand Down Expand Up @@ -494,7 +495,6 @@ Retrieve the available formatters for a buffer
`list_all_formatters(): conform.FormatterInfo[]` \
List information about all filetype-configured formatters


### get_formatter_info(formatter, bufnr)

`get_formatter_info(formatter, bufnr): conform.FormatterInfo` \
Expand All @@ -513,6 +513,7 @@ Check if the buffer will use LSP formatting when lsp_fallback = true
| Param | Type | Desc |
| ------- | ------------ | ------------------------------------ |
| options | `nil\|table` | Options passed to vim.lsp.buf.format |

<!-- /API -->

## Acknowledgements
Expand Down
1 change: 1 addition & 0 deletions doc/conform.txt
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ FORMATTERS *conform-formatter
`cljstyle` - Formatter for Clojure code.
`cmake_format` - Parse cmake listfiles and format them nicely.
`codespell` - Check code for common misspellings.
csharpier - An opinionated C# formatter.
`darker` - Run black only on changed lines.
`dart_format` - Replace the whitespace in your program with formatting that
follows Dart guidelines.
Expand Down
10 changes: 10 additions & 0 deletions lua/conform/formatters/csharpier.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---@type conform.FileFormatterConfig
return {
meta = {
url = "https://github.com/belav/csharpier",
description = "The opinionated C# code formatter",
},
command = "dotnet-csharpier",
args = { "--write-stdout" },
stdin = true,
}

0 comments on commit b2368ff

Please sign in to comment.