Documentation
¶
Overview ¶
Package util provides general filesystem, git, markdown, and execution helpers for magefiles.
Index ¶
Constants ¶
const GeneratedBanner = "<!-- Page generated by Cargoship; DO NOT EDIT -->"
GeneratedBanner marks a page as generator output.
Variables ¶
This section is empty.
Functions ¶
func CheckRepoMarkdownTables ¶ added in v0.38.0
func CheckRepoMarkdownTables() error
CheckRepoMarkdownTables checks every tracked Markdown file outside vendor/ and reports each misaligned table line on stdout, returning an error when any were found.
func CleanBuild ¶
func CleanBuild() error
CleanBuild removes compiled binary artifacts under build/.
func EscapeAngleBrackets ¶
EscapeAngleBrackets replaces literal "<" and ">" with HTML entities.
func GitCommit ¶
func GitCommit() string
GitCommit returns the short commit of the checkout being built, suffixed with "-dirty" when the working tree has uncommitted changes. When the commit cannot be resolved, it returns config.UnsetCLICommit.
func PaddedTable ¶
PaddedTable renders a table in the aligned form required by repo style guides.
func RenderYAMLValue ¶
RenderYAMLValue renders a default value the way it is written in YAML.
Types ¶
type TableFinding ¶ added in v0.38.0
TableFinding is one line of a Markdown table that is not padded to its column widths.
func CheckMarkdownTables ¶ added in v0.38.0
func CheckMarkdownTables(files []string) ([]TableFinding, error)
CheckMarkdownTables reports every table line in the given files that is not padded the way the repository style guide requires: one space inside each pipe, every cell padded to the width of the widest cell in its column, and the delimiter row's dashes run out to that same width. Tables inside fenced code blocks are skipped, since the style guide and several AGENTS.md files show deliberately unpadded tables as examples.