formatcmd

package
v0.1.1-alpha.2 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package formatcmd provides the format command for CLI.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(name string, configProvider func() *ProjectConfig) *redant.Command

New creates a new format command. The configProvider function is called to get project configuration.

Types

type FormatConfig added in v0.1.0

type FormatConfig struct {
	// Paths to format (directories or files)
	Paths []string
	// Write changes to files (default: false, just check)
	Write bool
	// Show diff instead of writing
	Diff bool
	// Exit with non-zero code if files need formatting
	ExitCode bool
	// Use builtin formatter instead of buf
	Builtin bool
}

FormatConfig holds format command configuration.

type ProjectConfig added in v0.1.0

type ProjectConfig struct {
	// Root directories containing proto files
	Root []string
	// Vendor directory
	Vendor string
	// Include paths
	Includes []string
}

ProjectConfig holds project configuration from protobuf.yaml.

Jump to

Keyboard shortcuts

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