formatproto

package module
v0.0.0-...-dc5ec73 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 14, 2021 License: MIT Imports: 6 Imported by: 0

README

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

Documentation

Overview

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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PostProcessor

func PostProcessor() pgs.PostProcessor

PostProcessor formats proto files with clang-format

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL