Skip to content

Commit

Permalink
feat: add buf as protobuf linter (#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
buztard authored Sep 14, 2023
1 parent 36269c8 commit 2b73887
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ To view configured and available formatters, as well as to see the path to the l
- [autopep8](https://github.com/hhatto/autopep8) - A tool that automatically formats Python code to conform to the PEP 8 style guide.
- [beautysh](https://github.com/lovesegfault/beautysh) - A Bash beautifier for the masses.
- [black](https://github.com/psf/black) - The uncompromising Python code formatter.
- [buf](https://github.com/bufbuild/buf) - A new way of working with Protocol Buffers.
- [clang_format](https://www.kernel.org/doc/html/latest/process/clang-format.html) - Tool to format C/C++/… code according to a set of rules and heuristics.
- [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.
Expand Down
11 changes: 11 additions & 0 deletions lua/conform/formatters/buf.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---@type conform.FileFormatterConfig
return {
meta = {
url = "https://buf.build/docs/lint/overview",
description = "A new way of working with Protocol Buffers",
},
command = "buf",
args = { "format", "-w", "$FILENAME" },
stdin = false,
cwd = require("conform.util").root_file({ "buf.yaml" }),
}

0 comments on commit 2b73887

Please sign in to comment.