Skip to main content

A cli tool to enforce documentation for code suppressions

Project description

shamefile — force to document silenced linter

shamefile logo

 

Turn silent tech debt into reviewable and documented decisions.

Tests Lint CodeQL Coverage Quality Gate License Rust shamefile


How it works  •  Why use it  •  Installation  •  Supported languages  •  FAQ  •  Roadmap  •  Contributing

shamefile won't let anyone silence a linter warning in your code without writing down why.

People are lazy. Both committer and code reviewer.

  • The committer slaps a // NOLINT comment when there's no easy fix. They don't justify it — in most languages there's no good place for that.
  • The code reviewer focuses on more important things: security, bugs, design. There's no dedicated time for checking new suppression arrivals.

Shamefile adds shamefile.yaml for the code reviewer and the shame CLI for the committer to give them tools to react before tech debt gets out of control.

How it works

Five real suppressions across five languages:

Python suppression JavaScript suppression

C# suppression Java suppression

Go suppression

Init empty shamefile with shame me .

CI failed: found undocumented suppressions

shamefile.yaml with empty why fields

Fill empty why with shame next

shamefile.yaml with documented why fields

Run again via CI with shame me . --dry-run

CI passed: every suppression documented

Reviewer rejects a weak justification on a shamefile entry

Why you should use it


Instantly improves AI agents

Instantly improves AI agents

Ignoring warnings? Not so easy anymore. Triggers AI reflection — "is this really unfixable?". Observed across Claude, GPT, and Cursor agents. Safer vibe coding by default.



Single source of truth

Single source of truth

"Where to document?", "where to look?", "what to do?" — same answer to every question: shamefile.yaml.



Reviewable by design

Reviewable by design

Make suppression review a ritual, not goodwill.



Shamefile doesn't quit with ex-employees

Shamefile doesn't quit with ex-employees

Knowledge stays in the YAML and you can refactor with confidence.


Installation

Source Command
npm npm install -g shamefile
PyPI pip install shamefile
crates.io cargo install shamefile
From source cargo install --git https://github.com/BKDDFS/shamefile
Homebrew coming soon

All channels install the shame CLI. Run shame --help to verify.

Or as a pre-commit hook:

# .pre-commit-config.yaml
- repo: https://github.com/BKDDFS/shamefile
  rev: main
  hooks:
    - id: shamefile

Commands

Command What it does
shame me . Scan project, sync shamefile.yaml; fail if any entry lacks why
shame me . --dry-run CI mode — read-only validation, never writes to disk
shame next Show first undocumented entry with the source line highlighted
shame next "<reason>" Document the first undocumented entry inline
shame fix <location> <token> --why "<reason>" Document a specific entry
shame remove <location> <token> (alias shame rm) Delete a stale entry without editing the YAML by hand

Run shame --help for the full reference.

CI/CD integration

On the CI side, shame me . --dry-run is read-only and deterministic. It validates three contracts:

Check Meaning
Coverage Every suppression in code is registered in shamefile.yaml
Staleness Every registered entry still points at a live suppression in code
Justification Every entry has a non-empty why

A failure on any of the three exits non-zero.

# .github/workflows/ci.yml
- name: Check suppressions
  run: shame me . --dry-run
Flag Description
--dry-run (-n) Read-only validation for CI/CD — never writes to disk
--hidden Also scan hidden files and directories (dotfiles)

Registry format

shamefile.yaml lives at the project root (git root if available, otherwise the working directory). Every entry is human-readable and stable under git diff:

---
config: {}
entries:

- location: ./src/api.py:42
  token: '# type: ignore'
  content: 'result = parse_legacy_api(raw)  # type: ignore'
  created_at: 2026-04-17
  owner: Anna Nowak <anna@example.com>
  why: 'legacy API returns untyped dict; types module in progress'
  • location and token form the entry's identity.
  • content is the verbatim source line — used for reconciliation when code moves.
  • owner and created_at are populated automatically on first run via git blame.
  • why is the only field that requires a written justification — from a developer or an AI agent. The PR reviewer decides whether the reason is good enough.

Cascade matching

A registry that breaks every time you refactor is worse than no registry. shamefile reconciles entries against source code in two passes:

  1. Location match — exact file:line + token.
  2. Content match — same source line + token (handles line shifts, with rename detection limited to the most recent commit via git diff HEAD~1..HEAD -M).

Reformatting a function or inserting imports above a suppression preserves the entry — owner, created_at, and why stay intact. Entries are only removed when the token itself is gone from the code.

Supported languages

shamefile is language-agnostic by design. The list below reflects what has been wired up and tested so far — not a limit on what the engine can do. If your language is missing and there's no open issue for it, please open one so we know there's interest.

Token Tool Language
# noqa Flake8 / Ruff Python
# pylint: disable Pylint Python
# type: ignore Mypy Python
# pyright: ignore Pyright Python
# pytype: disable Pytype Python
# pyre-ignore / # pyre-fixme Pyre Python
nosec Bandit Python
# pragma: no cover Coverage.py Python
# fmt: off / # fmt: skip Black / Ruff Python
# isort: skip isort Python
# lint-fixme / # lint-ignore Fixit Python
# autopep8: off autopep8 Python
// eslint-disable, /* eslint-disable ESLint JS / TS / TSX
// tslint:disable, /* tslint:disable TSLint TS / TSX
// @ts-ignore, /* @ts-ignore TypeScript JS / TS / TSX
// @ts-expect-error, /* @ts-expect-error TypeScript JS / TS / TSX

Supported file extensions: .py, .js, .jsx, .mjs, .cjs, .ts, .tsx.

Roadmap

  • MCP server — native integration for LLM-based PR authors (avoids loading the full registry into agent context)
  • Custom git merge driver — auto-resolve shamefile.yaml conflicts on parallel PRs
  • Additional language grammars — Rust, Go, Java, Kotlin, C# via tree-sitter
  • Custom entry fields — attach ticket, reviewer, or deadline metadata to suppressions
  • Native exclusion config — first-class exclude: patterns in shamefile.yaml for checked-in vendored or generated code that bypasses the default .gitignore discovery

FAQ

Why not just write the reason inline, like # noqa: F401 # legacy import?
  • Reviewers don't see it. A # noqa buried in one of seven changed files rarely gets pushback. shamefile.yaml puts every suppression in the PR into one diff — the reviewer sees the full cost as a single list, with author and why per entry.
  • Nothing forces a reason. Linters accept any string after the token, or none. shame me . --dry-run fails the build until every entry has a non-empty why. This matters most for AI coding agents, which lose the suppression's context the moment the session ends — the registry forces them to write the reason to disk while it still exists.
  • Inline is a bad trade-off. A short reason carries no information; a useful one drowns the line of code it is attached to. The registry keeps source readable and justifications detailed.

What stops developers from writing why: 'TODO' and moving on?

The tool guarantees a string is written; the reviewer judges whether it is a real reason. If why: 'TODO' passes review, that is an organisational gap, not a tool gap — but the registry makes the gap visible: every lazy entry is one grep away, by author and date. Before shamefile, the same shortcut was hidden inside whichever file it lived in.


Won't shamefile.yaml become a merge conflict magnet on parallel PRs?

This is the same trade-off every shared-file tool (lockfiles, changelogs, schema migrations) has accepted in exchange for single-source-of-truth visibility. A custom git merge driver that resolves automatically is on the Roadmap.

The registry is sorted by (location, token), so suppressions added in unrelated parts of the codebase land in different regions of the file — most parallel PRs do not collide. When they do, shame me is idempotent: after a merge, running it on the resolved tree deterministically reconciles entries from source, so git checkout --theirs shamefile.yaml && shame me . is the escape hatch.


What about generated, vendored, or third-party code?

A repo's typical generated/vendored content is excluded for free:

  • .gitignore and .ignore files are respected (handled by the same engine ripgrep uses), so node_modules/, target/, dist/, __pycache__/ etc. are skipped without configuration.
  • Only .py / .js / .jsx / .mjs / .cjs / .ts / .tsx are scanned, so vendored content in any other language is silently ignored.

A first-class exclude: config in shamefile.yaml is on the Roadmap.

Contributing

Contributions are welcome. Where you start depends on what you have:

  • Found a bug? Open an issue with a minimal repro.
  • Idea or design question? Open a Discussion under Ideas so direction can be agreed before any code is written.
  • Usage question or trouble setting things up? Ask in Q&A.
  • Want to send a PR? Read CONTRIBUTING.md first — dev setup, build/test/lint commands, commit format.
  • Security vulnerability? Use the private advisory form — see SECURITY.md. Do not open a public issue.

By participating you agree to the Code of Conduct.

License

shamefile is licensed under the Apache License 2.0. See the LICENSE file for more information.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

shamefile-0.1.7.tar.gz (792.3 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

shamefile-0.1.7-py3-none-win_arm64.whl (1.7 MB view details)

Uploaded Python 3Windows ARM64

shamefile-0.1.7-py3-none-win_amd64.whl (1.8 MB view details)

Uploaded Python 3Windows x86-64

shamefile-0.1.7-py3-none-musllinux_1_2_x86_64.whl (2.0 MB view details)

Uploaded Python 3musllinux: musl 1.2+ x86-64

shamefile-0.1.7-py3-none-musllinux_1_2_aarch64.whl (1.8 MB view details)

Uploaded Python 3musllinux: musl 1.2+ ARM64

shamefile-0.1.7-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.9 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64

shamefile-0.1.7-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.8 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARM64

shamefile-0.1.7-py3-none-macosx_11_0_arm64.whl (1.8 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

shamefile-0.1.7-py3-none-macosx_10_12_x86_64.whl (1.8 MB view details)

Uploaded Python 3macOS 10.12+ x86-64

File details

Details for the file shamefile-0.1.7.tar.gz.

File metadata

  • Download URL: shamefile-0.1.7.tar.gz
  • Upload date:
  • Size: 792.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for shamefile-0.1.7.tar.gz
Algorithm Hash digest
SHA256 f52d4a1f38bb3e6624932c42ff2094b9c7c7fe540a72cc22f69a8218ba2726af
MD5 e6ad9a9bf383bf0dad720dd5de2232c5
BLAKE2b-256 015c85217703cba173f8deffd5e4decbb9da34a4710c4ac582b6e68526b75140

See more details on using hashes here.

Provenance

The following attestation bundles were made for shamefile-0.1.7.tar.gz:

Publisher: publish-pypi.yml on BKDDFS/shamefile

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file shamefile-0.1.7-py3-none-win_arm64.whl.

File metadata

  • Download URL: shamefile-0.1.7-py3-none-win_arm64.whl
  • Upload date:
  • Size: 1.7 MB
  • Tags: Python 3, Windows ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for shamefile-0.1.7-py3-none-win_arm64.whl
Algorithm Hash digest
SHA256 ec63f45a4c72bcd574f5c0b20807c913636610da88b934d24eaeac96d0bc8ba2
MD5 e9e7ca11959358a97839f00f97298a49
BLAKE2b-256 9df2b18eef95b1a498212aff6d065955731e96d1f39164ba6975821808b6cb2b

See more details on using hashes here.

Provenance

The following attestation bundles were made for shamefile-0.1.7-py3-none-win_arm64.whl:

Publisher: publish-pypi.yml on BKDDFS/shamefile

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file shamefile-0.1.7-py3-none-win_amd64.whl.

File metadata

  • Download URL: shamefile-0.1.7-py3-none-win_amd64.whl
  • Upload date:
  • Size: 1.8 MB
  • Tags: Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for shamefile-0.1.7-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 1b336e2e607c600299b81c98e0aeb57daac763deec8934d7a584491ab23b0453
MD5 1e7d05f4c5b8ccd1015ac2e4f5efd624
BLAKE2b-256 139df1319810845585410d69620f351294508f2d0fdb35c0cdf8dd554b0ec9de

See more details on using hashes here.

Provenance

The following attestation bundles were made for shamefile-0.1.7-py3-none-win_amd64.whl:

Publisher: publish-pypi.yml on BKDDFS/shamefile

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file shamefile-0.1.7-py3-none-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for shamefile-0.1.7-py3-none-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 a0e6faaad3e44b25f0e0101a6c47d2c9ca1f99e9fba6d148170a5a0598d546d4
MD5 85b23550c71dcbef3d86fb4cd54b6f63
BLAKE2b-256 bbba5b12704f34329e978964caf11ef06addf80b240aeb4172be47301b20f56f

See more details on using hashes here.

Provenance

The following attestation bundles were made for shamefile-0.1.7-py3-none-musllinux_1_2_x86_64.whl:

Publisher: publish-pypi.yml on BKDDFS/shamefile

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file shamefile-0.1.7-py3-none-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for shamefile-0.1.7-py3-none-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 091b0e4c745e628ecf69d3c531fa0cf1851062ad2c892009a57c47ebf8b5ac41
MD5 75570356371ed27bbd44b126e49140ca
BLAKE2b-256 0523ad16650639a265066300b1e3ba2d5dd649e9721eb4b83132fa20c3fbb89f

See more details on using hashes here.

Provenance

The following attestation bundles were made for shamefile-0.1.7-py3-none-musllinux_1_2_aarch64.whl:

Publisher: publish-pypi.yml on BKDDFS/shamefile

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file shamefile-0.1.7-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for shamefile-0.1.7-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7b5b38afce4d65e8ea0a42bba1fe7e7c89acb0ff3773a780cf0d6aa73c62d10d
MD5 2c870b2dd432b21f7382855641a35a06
BLAKE2b-256 5ce353fa519b069977cfd8e5a85576c440b90bb18401a75bbc750f282d187453

See more details on using hashes here.

Provenance

The following attestation bundles were made for shamefile-0.1.7-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: publish-pypi.yml on BKDDFS/shamefile

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file shamefile-0.1.7-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for shamefile-0.1.7-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 b3aeddd55b3bfc0d426ceaf0ba32b9e0f8b7a21c517592d691c1ab8ff9c48bc1
MD5 b1bfdf4a11ad868e720c093aedd721d7
BLAKE2b-256 749ea59cd030a80189fd11bc4eb01ea9f73b680b44bce68b68babf461dee8cb6

See more details on using hashes here.

Provenance

The following attestation bundles were made for shamefile-0.1.7-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: publish-pypi.yml on BKDDFS/shamefile

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file shamefile-0.1.7-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for shamefile-0.1.7-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 5f8bdb72b891bda65dc35d8bbc73189ac292bbc78c78d70265390b261f5b0b45
MD5 277bc97b3941cf6fff8085594b16dec5
BLAKE2b-256 3e2418367b8d3f555e4bcdd1813ba19e5dd5ac8a2a09bf71690843d8bf779102

See more details on using hashes here.

Provenance

The following attestation bundles were made for shamefile-0.1.7-py3-none-macosx_11_0_arm64.whl:

Publisher: publish-pypi.yml on BKDDFS/shamefile

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file shamefile-0.1.7-py3-none-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for shamefile-0.1.7-py3-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 77dc887d85beb90b7cc4f80618fe7432e740c7562d1d44162a7fff2d28c0587f
MD5 81791dd457f27d7b46298697b92b42d4
BLAKE2b-256 a82a91a01f33b36e4434a969a18b3b08186fb8d9d67956a27a03e4e95730f53f

See more details on using hashes here.

Provenance

The following attestation bundles were made for shamefile-0.1.7-py3-none-macosx_10_12_x86_64.whl:

Publisher: publish-pypi.yml on BKDDFS/shamefile

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page