This repository was developed in order to generate automated reports on how well codebases adhere to the coding standards of the University of Chicago's DSI Clinic course.
The goal of this codebase is to provide a quick and easy way to review code and to alert contributors where their code may be failing.
This package depends on ruff
being available in your environment.
python3 -m pip install dsi-cocoa ruff==0.4.10
This package contains a module evaluate_repo
which runs code testing libraries against a repository. There are multiple ways that we want to be able to run this repo:
cocoa
and then use it as part of their process.Via command line:
cocoa /path/to/repo
Results are truncated by default. To print all results, use the verbose option:
cocoa /path/to/repo --verbose
Cocoa evaluates the main branch by default. To evaluate a different branch, use the branch argument:
cocoa /path/to/repo --branch branch-name
To evaluate files created or modified after a certain date, use the date option:
cocoa /path/to/repo --date YYYY-MM-DD
All options can be combined like so:
cocoa /path/to/repo --verbose --branch <branch-name> --date YYYY-MM-DD
The code run multiple checks on each repo. For each check run there are three possibilities:
For each of the checks below we have denoted what the check generates.
There is a Github action located here that runs cocoa
on pushes to the main branch. The action has an associated badge that can be displayed at the top of your repo to show passing or failing status. The badge code can be copied from the raw text of this readme.
To override the --date
or --branch
options run in the action, create an environment named "cocoa_standards" in your repository, then create environment variables called BRANCH_NAME
and REVIEW_AFTER_DATE
.