Developer szymonmaszke has released an open‑source Python framework designed to make creating custom linting rules fast and painless.
Born out of the need to quickly prototype private linters, the project has now been shared as FOSS for others to use, adapt and extend.
The core idea: give developers a simple way to define powerful, file‑agnostic linting rules in as little as ~20 lines of code.
✨ Key features
- Minimal setup — functioning linter or checker in roughly 20 LOC.
- Multi‑format support — works on Python, YAML, TOML and JSON out of the box.
- Flexible ignore system — per‑line ignores, range ignores, whole‑file skips, rule‑selection at runtime.
- Cross‑file analysis — a single check can span multiple elements or even all files.
- Direct AST access — works straight on Python’s Abstract Syntax Tree for more precise checks.
- Developer‑friendly docs — tutorials and API references to get you productive quickly.
🛠️ Real‑world use cases
Enforcing team coding conventions
Create rules specific to your project’s style guide — no more “tribal knowledge” slipping through reviews.Configuration hygiene
Lint YAML/TOML/JSON config files for structure, required keys, or deprecated options before they reach production.Security scanning
Flag unsafe patterns across Python code and configuration files (e.g., hardcoded secrets, weak cryptography).Project‑wide architectural checks
Ensure certain modules never import from disallowed packages, or that key files haven’t been altered unexpectedly.Automated code review assistance
Run bespoke checks before PRs are even opened, freeing reviewers to focus on logic and design.
💬 As the author puts it: “All in all seems to be quite functional for my private (yet) linters, so I decided to make it into a FOSS project. Have fun, would love to hear your feedback and ideas regarding it!”
📌 CyberNews thread: Show HN: Framework to create linters for Python, YAML, TOML, JSON
💻 Source code & docs: https://github.com/open-nudge/lintkit
Top comments (0)