Skip to content

protoc-gen-star post-processor that formats protobuf files with clang-format

License

Notifications You must be signed in to change notification settings

chanced/formatproto

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

formatproto

formatproto is a post-processor for protoc-gen-star that formats proto files with clang-format

Usage:

package main

import (
    "github.com/chanced/formatproto"
    pgs "github.com/lyft/protoc-gen-star"
)

func main() {
    pgs.Init(
        pgs.DebugEnv("DEBUG"),
    ).RegisterModule(
        // your modules here
    ).RegisterPostProcessor(
        formatproto.PostProcessor(),
    ).Render()
}

You will also need a .clang-format file at the root of your directory. An example file:

Language: Proto
BasedOnStyle: google
IndentWidth: 2

Prereqs:

You must have clang-format installed.

MacOS

brew install clang-format

Linux (with apt)

sudo apt install clang-format

Windows

Download the binary: https://llvm.org/builds/

License

MIT

About

protoc-gen-star post-processor that formats protobuf files with clang-format

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages