Documentation
¶
Overview ¶
Package generated recognizes paths that hold generated output rather than work: bytecode caches, installed dependencies, coverage reports, and the files an editor or an operating system leaves lying around.
A repository whose .gitignore misses one of these has it reported as untracked, which git status cannot tell apart from new work. preen holds such a path back from the plan and says why, rather than helping commit something that regenerates itself on the next test run.
Every pattern is overridable. A repository that vendors one of these directories on purpose is a real thing, and the tool has no business overruling it.
Index ¶
Constants ¶
const Configured = "matched a configured pattern"
Configured is the reason given for a pattern the repository added itself, where preen has no description of its own to offer.
Variables ¶
var Defaults = []Rule{
{Pattern: "__pycache__/", Why: "Python bytecode cache"},
{Pattern: "*.pyc", Why: "compiled Python"},
{Pattern: "*.pyo", Why: "optimized Python bytecode"},
{Pattern: ".pytest_cache/", Why: "pytest cache"},
{Pattern: ".mypy_cache/", Why: "mypy cache"},
{Pattern: ".ruff_cache/", Why: "ruff cache"},
{Pattern: "*.egg-info/", Why: "Python packaging metadata"},
{Pattern: ".venv/", Why: "Python virtual environment"},
{Pattern: "venv/", Why: "Python virtual environment"},
{Pattern: "node_modules/", Why: "installed JavaScript dependencies"},
{Pattern: ".nyc_output/", Why: "JavaScript coverage output"},
{Pattern: "htmlcov/", Why: "rendered coverage report"},
{Pattern: "lcov.info", Why: "coverage report"},
{Pattern: "coverage.out", Why: "Go coverage profile"},
{Pattern: "coverage.html", Why: "rendered coverage report"},
{Pattern: "coverage.xml", Why: "coverage report"},
{Pattern: ".coverage", Why: "Python coverage data"},
{Pattern: "target/", Why: "build output"},
{Pattern: ".gradle/", Why: "Gradle cache"},
{Pattern: "*.class", Why: "compiled Java"},
{Pattern: ".DS_Store", Why: "macOS directory metadata"},
{Pattern: "Thumbs.db", Why: "Windows thumbnail cache"},
{Pattern: "*.swp", Why: "editor swap file"},
{Pattern: "*.swo", Why: "editor swap file"},
{Pattern: "*~", Why: "editor backup file"},
{Pattern: ".idea/", Why: "JetBrains project settings"},
}
Defaults are the patterns preen holds back without being asked.
The list is deliberately short and boring: every entry is output some tool writes and rewrites, and none of them is a file anyone edits by hand. Broad build directories like build/ and dist/ are left out, because plenty of projects keep real source under those names.
Functions ¶
This section is empty.
Types ¶
type Matcher ¶
type Matcher struct {
// contains filtered or unexported fields
}
Matcher decides whether a path holds generated output. The zero Matcher matches nothing, which is the shape callers want when the check is off.
func New ¶
New returns a Matcher over the default patterns plus extra, with anything allow covers exempted. An extra pattern uses the same syntax as a default.