- Source in
src/tclint/with CLI entry points undersrc/tclint/cli/and command definitions insrc/tclint/commands/. - Tests live in
tests/, with CLI suites intests/cli/and command checks intests/commands/. - Docs and examples reside in
docs/andtests/data/; utility scripts inutil/.
- Create venv and install dev deps:
python -m venv .venv && source .venv/bin/activate && pip install -e . --group dev. - Run full test suite:
python -m pytest. Use-k <pattern>to scope,-qfor quiet output. - Format code:
black .; lint:flake8,mypy, andisort(seeutil/pre-commit). - CLI smoke tests:
tclint <file>ortclfmt <file>from repo root; pass-cto point at a specific config.
- Python 3.10+; follow Black style and isort ordering for Python sources; keep files ASCII unless needed.
- Use descriptive function and variable names; command specs and schema entries mirror Tcl semantics.
- Tcl output rules (indent, spaces-in-braces, etc.) live in
format.py/config.py; follow those patterns when adjusting formatter or config behavior. Indentation defaults to 4 spaces unless tests/config specify otherwise. - Add type hints when adding functions or updating function signatures. Use generics for collections (e.g. prefer
list[int]totyping.List[int]), and usetyping.Optional[type]rather thantype | Nonefor indicating optional types.
- Make the minimum changes required to fulfill the request. Prefer incremental changes to large-scale ones.
- Pytest is the framework; tests mirror features (parser, CLI, commands). Add fixtures under
tests/data/when possible. - Name tests after behavior (e.g.,
test_foreach_arg_expansion_only). Keep assertions precise and avoid broad regex unless necessary. - Run targeted tests before pushing; ensure new violations/config behaviors include end-to-end coverage in
tests/test_tclint.pyor CLI suites.
- Follow existing concise, imperative commit style (e.g., "add foreach arg spec", "fix config validation").
- PRs should describe intent, list key changes, note test coverage (
pytestresults), and mention config or CLI flags that change behavior. - Include screenshots or snippets only when touching user-facing CLI output formatting.
- Config files resolve relative paths; dynamic plugins via config are blocked—use
--commandsCLI flag instead. - Avoid writing to directories beyond the repo; respect default exclude/ignore patterns in
tests/data/tclint.tomlwhen adding fixtures.