Overview
Monitor and manage deeply customizable metrics about your python code using ASTs.
codewatch lets you write simple python code to track statistics about the state of your codebase and write lint-like assertions on those statistics. Use this to incrementally improve and evolve the quality of your code base, increase the visibility of problematic code, to encourage use of new patterns while discouraging old ones, to enforce coding style guides, or to prevent certain kinds of regression errors.
What codewatch does:
- Traverses your project directory
- Parses your code into AST nodes and calls your visitor functions
- Your visitor functions run and populate a stats dictionary
- After all visitor functions are called, your assertion functions are called
- Your assertion functions can assert on data in the stats dictionary, save metrics to a dashboard, or anything you can think of
Installation
Python: >=2
Execute the following in your terminal:
pip install codewatch