fleetlint Policy for a fleet of repositories
v0.4
Getting started

deps/forks-documented

Forked or patched dependencies are documented

Severityinfo
Tiers1, 2
Stacksany
Scoperoot
Kindexpr
Sourcelibrary v0.1.0
Selected byfleetlint-recommended@v0.1.0

Requirement

Every dependency taken from a fork (a go.mod replace pointing at another module, a git source in Cargo.toml, package.json or a Python requirement) is documented: upstream, base version, what changed and why. A FORKS.md (root or docs/), a Forks section in the README or docs, or an inline comment on the line (// in go.mod, # elsewhere; package.json has no comments) counts. A replace to a local path (=> ../x) is a sibling module, not a fork.

Why

A fork without a note outlives the reason for it; the next upgrade either drops the fix or keeps the fork forever.

Applies when

grep("go.mod", r'=>\s*[a-z]').size() > 0 || grep("Cargo.toml", r'\bgit\s*=\s*"').size() > 0 || grep("package.json", r'"(github:|git\+|git://|https://github\.com/[^"]+\.git)').size() > 0 || grep("pyproject.toml", r'@ ?git\+').size() > 0 || grep("requirements*.txt", r'git\+').size() > 0

Check

For each item in:

grep("go.mod", r'=>\s*[a-z]').filter(l, !l.text.contains("//")) + grep("Cargo.toml", r'\bgit\s*=\s*"').filter(l, !l.text.matches(r'\s#')) + grep("package.json", r'"(github:|git\+|git://|https://github\.com/[^"]+\.git)') + grep("pyproject.toml", r'@ ?git\+').filter(l, !l.text.matches(r'\s#')) + grep("requirements*.txt", r'git\+').filter(l, !l.text.matches(r'\s#'))
exists("FORKS.md") || exists("docs/FORKS.md") || exists("docs/forks.md") || grep("README.md", r'^#+ .*\b(forks?|vendored|patched|patches)\b').size() > 0 || grep("docs/**/*.md", r'^#+ .*\b(forks?|vendored|patched|patches)\b').size() > 0

Fix

Add docs/FORKS.md listing each forked or patched dependency with upstream, base version, the change and why, or comment each line.

Agent instruction: Document each forked or patched dependency (upstream, base version, change, reason) in docs/FORKS.md; ask the user for the reason where the history does not say.

See: https://fleetlint.org/baseline/#dependencies


Generated by fleetlint docs from catalog v0.1.0.