Skip to content

.gitignore coverage

Having a .gitignore is not the same as having the right one. This gate cross-checks it against the stack it can actually see.

Gate ID
gitignore_coverage
Severity
warning
Scope
Project root
Tags
git-hygiene

What it checks

Cross-checks .gitignore against a hardcoded if-stack-then-must-ignore table: package.json → node_modules, Cargo.toml → target, pyproject.toml/setup.py → pycache/.venv, Gemfile → .bundle/vendor/bundle, plus the universal .DS_Store. Silent on repos with no recognised stack markers.

The rule table is fixed and small — if this marker exists, then these entries must be covered:

MarkerRequired entries
package.jsonnode_modules
Cargo.tomltarget
pyproject.toml__pycache__, .venv
setup.py__pycache__, .venv
Gemfile.bundle, vendor/bundle
(any recognised stack).DS_Store

go.mod deliberately requires nothing — vendored Go modules are an opt-in choice, not an accident.

The gate is silent on repositories with no recognised stack marker, and it understands existing entries well enough not to propose a redundant one (a **/node_modules/ line already counts as covering node_modules).

What a finding says

text
.gitignore does not cover `node_modules`. Node projects rebuild node_modules from package.json + lockfile; committing it bloats the repo and breaks installs. Add `node_modules` to your .gitignore.

Options

json
{
  "gate_options": {
    "gitignore_coverage": { "disabled_patterns": [".DS_Store"] }
  }
}

Turning it off

Silence the gate for the whole project in .l0git.json:

json
{
  "ignore": ["gitignore_coverage"]
}

Or keep it running at a lower severity:

json
{
  "severity": { "gitignore_coverage": "info" }
}

See also

Released under the MIT License. · Privacy & legal