Configuration
Config is optional. Defaults work for most projects.
Config file locations
Config is loaded (in order, later overrides earlier):
- Defaults
.glassworm.toml(searched upward from CWD)[tool.glassworm]inpyproject.toml
Options
severity
Control exit behavior when findings are present.
| Value | Behavior |
|---|---|
error |
Exit 1 — blocks commit / CI |
warning |
Exit 0 — prints warning, allows commit |
include
Glob patterns for files to scan. Defaults:
[tool.glassworm]
include = ["*.py", "*.js", "*.ts", "*.jsx", "*.tsx", "*.json", "*.yaml", "*.yml", "*.md", "*.txt", "*.sh", "*.bash", "*.html", "*.css", "*.xml", "*.toml", "*.ini", "*.cfg", "*.env*"]
exclude
Glob patterns for paths to skip. Defaults:
Example: .glassworm.toml
[tool.glassworm]
severity = "warning"
exclude = ["vendor/", "node_modules/", "*.min.js", "dist/", "build/"]
Example: pyproject.toml
[tool.glassworm]
severity = "error"
include = ["*.py", "*.js", "*.ts", "*.json", "*.md"]
exclude = ["vendor/", "node_modules/", "*.min.js", "docs/"]
CLI override
--severity overrides config:
glassworm --severity warning . # Always warn, never block
glassworm --severity error . # Always block on findings
--config
--config locates the config root; it does not read a single file. Behavior:
- File path (e.g.
--config /project/pyproject.toml): Uses the parent directory as the config root, then loads both.glassworm.tomlandpyproject.tomlfrom that directory (whichever exist). - Directory path (e.g.
--config /project): Uses that directory directly as the config root.