trace_commentor/DEVNOTE.md
2024-04-22 15:52:10 +08:00

10 lines
627 B
Markdown

## How to add a new node support to TraceCommentor
- Read about the target node information (https://docs.python.org/3/library/ast.html).
- Add a test case.
- Write the implementation and pass all tests.
- echo the original code. (automatically handled by the parent scope node if not in `flags.APPEND_SOURCE_BY_THEMSELVES`)
- expression should be evaluated and add comment to each recursively by correct order. (use `cmtor.eval(...)`)
- statements should be executed. (use `cmtor.exec(...)`)
- use `pytest -s -q -k` to test new test case first, use `DEBUG` and `PRINT` environment variable to help debugging.