Skip to content

Commit

Permalink
feat(supressFormatter): support for clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisgrieser committed Jun 16, 2024
1 parent 35f82e9 commit 1efcf49
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,12 @@ missing.
- [yamllint](https://yamllint.readthedocs.io/en/stable/disable_with_comments.html)
<!-- auto-generated: end -->

<!-- TODO: auto-generate this section as well -->
### Suppress Formatting
- [stylua](https://github.com/JohnnyMorganz/StyLua#ignoring-parts-of-a-file)
- [prettier](https://prettier.io/docs/en/ignore.html)
- [black](https://black.readthedocs.io/en/stable/usage_and_configuration/the_basics.html#ignoring-sections)
- [black](https://black.readthedocs.io/en/stable/usage_and_configuration/the_basics.html#ignoring-sections) / [ruff](https://docs.astral.sh/ruff/formatter/#format-suppression)
- [clang-format](https://clang.llvm.org/docs/ClangFormatStyleOptions.html#disabling-formatting-on-a-piece-of-code)

## Installation
This plugin requires diagnostics provided by a source that supports Neovim's
Expand Down
12 changes: 12 additions & 0 deletions lua/rulebook/data/suppress-formatter-comment.lua
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,18 @@ M = {
ignoreRange = { "<!-- prettier-ignore-start -->", "<!-- prettier-ignore-end -->" },
docs = "https://prettier.io/docs/en/ignore.html#markdown",
},
c = {
ignoreBlock = { "/* clang-format off */", "/* clang-format on */" },
location = "encloseLine",
ignoreRange = { "/* clang-format off */", "/* clang-format on */" },
docs = "https://clang.llvm.org/docs/ClangFormatStyleOptions.html#disabling-formatting-on-a-piece-of-code",
},
cpp = {
ignoreBlock = { "/* clang-format off */", "/* clang-format on */" },
location = "encloseLine",
ignoreRange = { "/* clang-format off */", "/* clang-format on */" },
docs = "https://clang.llvm.org/docs/ClangFormatStyleOptions.html#disabling-formatting-on-a-piece-of-code",
},
}

--------------------------------------------------------------------------------
Expand Down

0 comments on commit 1efcf49

Please sign in to comment.