Your first lint¶
In this tutorial you will lint a tiny project, watch dddlint catch a naming
drift, and fix it. It takes about five minutes. You need only uv installed.
1. Make a project¶
Create an empty directory and drop in two files that disagree about what to call a customer.
One file says client, the other says customer. That is exactly the kind of
split dddlint exists to surface.
2. Write the vocabulary¶
Tell dddlint that customer is the canonical term and client is an alias.
3. Run the linter¶
You will see two findings:
repo.py
────────────────────────────────────
1 alias ClientRepository 'client' is not the canonical term, use 'customer'
2 alias get_client 'client' is not the canonical term, use 'customer'
✖ 2 findings
dddlint exited with code 1. That non-zero exit is what makes it useful in CI
and commit hooks — the build fails until the language is consistent.
4. Fix the drift¶
Rename the identifiers in repo.py to use customer:
Run the linter again:
Exit code 0. The whole codebase now speaks one language.
What you learned¶
- A
dddlint.yamlat the project root defines the vocabulary. dddlint lintscans every file tree-sitter recognises and reports findings.- The exit code is
0when clean and1when there are findings.
Next steps¶
- Make it automatic: run dddlint in CI or as a pre-commit hook.
- Get findings inline while you type: editor diagnostics.
- Learn the full vocabulary syntax in the configuration reference.