diff options
author | buz <852136+buztard@users.noreply.github.com> | 2023-09-14 19:51:40 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-14 10:51:40 -0700 |
commit | 2b73887fd75e1f6efc352cec6bd7e39157c3732e (patch) | |
tree | ba623d2712b0c0a4d7492cdd463b78fa4d3b0350 | |
parent | 36269c8faadf123f1405bc0cb9f3f9fab387d56c (diff) |
feat: add buf as protobuf linter (#43)
-rw-r--r-- | README.md | 1 | ||||
-rw-r--r-- | lua/conform/formatters/buf.lua | 11 |
2 files changed, 12 insertions, 0 deletions
@@ -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. diff --git a/lua/conform/formatters/buf.lua b/lua/conform/formatters/buf.lua new file mode 100644 index 0000000..bb64c26 --- /dev/null +++ b/lua/conform/formatters/buf.lua @@ -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" }), +} |