Metacode
lastmod 2026-01-11created 2026-01-112 edits
A declarative comment language and parser for standardizing action comments
About
metacode is a library that addresses the fragmentation of special comments used by tools in the Python ecosystem.
In today's Python development environment, each tool, such as linters, formatters, and type checkers, uses a different comment syntax:
-
# noqa- ignore linter warnings -
# fmt: off- disable the formatter -
# type: ignore- ignore type checking
The metacode project provides a unified syntax that uses the key: action[arguments] pattern to clearly separate tool, action, and parameters.
Features
- Unified syntax: a consistent comment format across all tools
- Multiple argument types: handles parameters of various forms
- Selective key parsing: each tool can parse only the keys it needs
- Automatic comment generation: generates comments automatically through the Insert API
- Language-independent specification: defined in EBNF, so it can be implemented in other programming languages
- Multi-tool coexistence: directives for several tools can be written on one line