genfiles

package
v0.0.658 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package genfiles understands the .generated_files config file. The ".generated_files" config lives in the repo's root.

The config is a series of newline-delimited statements. Statements which begin with a `#` are ignored. A statement is a white-space delimited key-value tuple.

statement = key val

where whitespace is ignored, and:

key = "path" | "file-name" | "path-prefix" |
"file-prefix" | "paths-from-repo"

For example:

# Simple generated files config
file-prefix	zz_generated.
file-name	generated.pb.go

The statement's `key` specifies the type of the corresponding value:

  • "path": exact path to a single file
  • "file-name": exact leaf file name, regardless of path
  • "path-prefix": prefix match on the file path
  • "file-prefix": prefix match of the leaf filename (no path)
  • "paths-from-repo": load file paths from a file in repo

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Group

type Group struct {
	Paths, FileNames, PathPrefixes, FilePrefixes map[string]bool
}

Group is a logical collection of files. Check for a file's inclusion in the group using the Match method.

func NewGroup

func NewGroup(gc ghFileClient, owner, repo, sha string) (*Group, error)

NewGroup reads the .generated_files file in the root of the repository and any referenced path files (from "path-from-repo" commands).

func (*Group) Match

func (g *Group) Match(path string) bool

Match determines whether a file, given here by its full path is included in the generated files group.

type ParseError

type ParseError struct {
	// contains filtered or unexported fields
}

ParseError is an invalid line in a .generated_files config.

func (*ParseError) Error

func (pe *ParseError) Error() string

Jump to

Keyboard shortcuts

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