Glyptodont

Documentation for the Glyptodont gem. See also the README and configuration below.

Paleoart: Glyptodon, a large extinct armadillo from the Pleistocene in South America
Glyptodon (noir et blanc) by Pavel Riha, edit by Walké. CC BY-SA 3.0.

What?

Glyptodont is a command-line tool that scans a Git repository for TODO-style comments (e.g. TODO, FIXME, HACK, XXX) and fails if they exceed your limits. It helps stop unfinished work from reaching production.

You run it in CI or locally; it reports how many TODOs were found and how old the oldest ones are, and exits with a non-zero code when your thresholds are exceeded.

Why?

All the glyptodonts have fossilised. This tool makes sure your TODOs don’t do the same.

If you’ve ever been bitten by a TODO in production that was never done, Glyptodont is for you. It gives you:

How much?

Both can be set via command-line options, a .glyptodont.yaml file in the repo, or a mix (options override config).

How?

Install

gem install glyptodont

Or add to your application’s Gemfile:

gem "glyptodont"

Then run:

bundle exec glyptodont

Optional: put a .glyptodont.yaml in the repo root to set threshold, max_age_in_days, keywords, and ignore entries.

Configuration

Glyptodont looks for an optional .glyptodont.yaml file in the root of the directory being scanned.

Example:

---
threshold: 1
max_age_in_days: 1
ignore:
  - README.md:11
  - lib/glyptodont/checkers/counter.rb:30
  - lib/glyptodont/todo_researcher.rb:33
  - spec/checkers/counter_spec.rb:20
documentation_files:
  - CHANGELOG.md
  - docs/index.html

Command-line options

Usage: glyptodont [options]
    -d, --directory DIRECTORY        Git repository to search for TODOs (default '.')
    -t, --threshold TODOS            Maximum number of TODOs to allow (default 10)
    -m, --max-age DAYS               Maximum number of days to allow TODOs to stay (default 14)
    -k, --keywords TODO,WORDS        Keywords to treat as 'TODO' (default FIXME,HACK,TODO,XXX)
        --version                    Show version

Use in CI/CD

Run glyptodont (or bundle exec glyptodont) after checkout. If the repo exceeds your limits, the command exits non-zero and the pipeline fails.

GitHub Actions

Add a job that installs Ruby, installs the gem, and runs Glyptodont. Example:

jobs:
  glyptodont:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Set up Ruby
        uses: ruby/setup-ruby@v1
        with:
          ruby-version: "3.2"
          bundler-cache: true

      - name: Install Glyptodont
        run: gem install glyptodont

      - name: Check TODOs
        run: glyptodont

To use a strict policy (e.g. only 5 TODOs, max 7 days old), pass options:

      - name: Check TODOs
        run: glyptodont --threshold 5 --max-age 7

If your project already uses Bundler, you can add the gem and run it via Bundler instead:

      - name: Check TODOs
        run: |
          bundle config set --local path vendor/bundle
          bundle install
          bundle exec glyptodont

Buildkite

Add a command step that runs Glyptodont. Your agent must have Ruby (and CMake if the gem is built from source). Example:

steps:
  - label: "Check TODOs"
    command: |
      gem install glyptodont
      glyptodont

With a strict policy:

  - label: "Check TODOs"
    command: |
      gem install glyptodont
      glyptodont --threshold 5 --max-age 7

If your pipeline already uses Bundler (e.g. bundle install in an earlier step), add gem "glyptodont" to the Gemfile and run:

  - label: "Check TODOs"
    command: bundle exec glyptodont

Using Docker: You can run Glyptodont in a container so the agent doesn’t need Ruby. See glyptodont-docker for an image and example:

  - label: "Check TODOs"
    command: docker run --rm -v "$(pwd):/repo" johnsyweb/glyptodont-docker glyptodont --directory /repo

(Adjust the image name and mount path to match the image you use.)

Where?