prefixtitle

package module
Version: v0.0.0-...-5008174 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2020 License: BSD-3-Clause Imports: 2 Imported by: 3

Documentation

Overview

Package prefixtitle parses prefixed issue and change titles for Go packages.

It uses the conventions set by the Go project. These conventions are documented on https://golang.org/wiki/HandlingIssues, https://golang.org/wiki/Gardening, https://golang.org/wiki/CommitMessage, and https://golang.org/wiki/MinorReleases wiki pages.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseChange

func ParseChange(module, prefixedTitle string) (paths []string, title string)

ParseChange parses a prefixed change title. It returns 1 or more paths from the prefix joined with module, and the remaining change title. It does not try to verify whether each path is an existing Go package.

The value of module is expected to be the empty string for CLs in the "go.googlesource.com/go" repository and PRs in its "github.com/golang/go" GitHub mirror. It should be the module path for all other repositories.

Supported forms include:

"",    "import/path: change title"   -> ["import/path"],            "change title"
"",    "path1, path2: change title"  -> ["path1", "path2"],         "change title"  # Multiple comma-separated paths.
"mod", "import/path: change title"   -> ["mod/import/path"],        "change title"
"mod", "path1, path2: change title"  -> ["mod/path1", "mod/path2"], "change title"  # Multiple comma-separated paths.

If there's no path prefix (preceded by ": "), prefixedTitle is returned unmodified:

"",    "change title"                -> [""],    "change title"
"mod", "change title"                -> ["mod"], "change title"

If there's a branch prefix in square brackets, title is returned with said prefix:

"",    "[branch] path: change title" -> ["path"],     "[branch] change title"
"mod", "[branch] path: change title" -> ["mod/path"], "[branch] change title"

func ParseIssue

func ParseIssue(module, prefixedTitle string) (paths []string, title string)

ParseIssue parses a prefixed issue title. It returns 1 or more paths from the prefix joined with module, and the remaining issue title. It does not try to verify whether each path is an existing Go package.

The value of module is expected to be the empty string for issues in the "github.com/golang/go" repository. It should be the module path for all other repositories.

Supported forms include:

"",    "import/path: issue title"    -> ["import/path"],            "issue title"
"",    "proposal: path: issue title" -> ["path"],                   "issue title"  # Proposal.
"",    "Proposal: path: issue title" -> ["path"],                   "issue title"  # Proposal.
"",    "x/path: issue title"         -> ["golang.org/x/path"],      "issue title"  # "x/..." refers to "golang.org/x/...".
"",    "dl/path: issue title"        -> ["golang.org/dl/path"],     "issue title"  # "dl/..." refers to "golang.org/dl/...".
"",    "path1, path2: issue title"   -> ["path1", "path2"],         "issue title"  # Multiple comma-separated paths.
"mod", "import/path: issue title"    -> ["mod/import/path"],        "issue title"
"mod", "path1, path2: issue title"   -> ["mod/path1", "mod/path2"], "issue title"  # Multiple comma-separated paths.

If there's no path prefix (preceded by ": "), prefixedTitle is returned unmodified:

"",    "issue title"                 -> [""],    "issue title"
"mod", "issue title"                 -> ["mod"], "issue title"

Types

This section is empty.

Source Files

Jump to

Keyboard shortcuts

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