Name | dsi-cocoa JSON |
Version |
0.5.9
JSON |
| download |
home_page | None |
Summary | Clinic Opinionated Codebase Oversight and Analysis |
upload_time | 2024-07-02 17:30:39 |
maintainer | Nick Ross, Trevor Spreadbury |
docs_url | None |
author | None |
requires_python | >=3.10 |
license | None |
keywords |
codebase analysis
uchicago dsi
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# Clinic Opinionated Codebase Oversight and Analysis
[![Cocoa Error Analysis](https://github.com/dsi-clinic/cocoa/actions/workflows/error.badges.yml/badge.svg)](https://github.com/dsi-clinic/cocoa/actions/workflows/error.badges.yml)
[![Pre-commit](https://github.com/dsi-clinic/cocoa/actions/workflows/main.workflow.yml/badge.svg)](https://github.com/dsi-clinic/cocoa/actions/workflows/main.workflow.yml)
This repository was developed in order to generate automated reports on how well codebases adhere to the [coding standards](https://github.com/dsi-clinic/coding-standards) of the University of Chicago's DSI [Clinic course](https://datascience.uchicago.edu/education/data-science-clinic/).
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.
## Installation
This package depends on `ruff` being available in your environment.
```bash
python3 -m pip install dsi-cocoa ruff==0.4.10
```
## cocoa
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:
1. We want to be able to clone `cocoa` and then use it as part of their process.
2. We want administrators to be able to give it a list of repos to generate reports on all repos.
3. (Eventually) We want it to be able to run as a github action _on the repo itself_.
4. (Eventually) We want to be able to have adminstrative repo that can run it on other repos.
### How to run
Via command line:
```bash
cocoa /path/to/repo
```
#### Options
Results are truncated by default. To print all results, use the verbose option:
```bash
cocoa /path/to/repo --verbose
```
Cocoa evaluates the main branch by default. To evaluate a different branch, use the branch argument:
```bash
cocoa /path/to/repo --branch branch-name
```
To evaluate files created or modified after a certain date, use the date option:
```bash
cocoa /path/to/repo --date YYYY-MM-DD
```
All options can be combined like so:
```bash
cocoa /path/to/repo --verbose --branch <branch-name> --date YYYY-MM-DD
```
### Checks
The code run multiple checks on each repo. For each check run there are three possibilities:
1. WARNING: Most likely this needs to be fixed.
1. INFO: Log information for additional context.
1. ERROR: A critical issue that needs to be addressed.
For each of the checks below we have denoted what the check generates.
- Branch Hygiene:
- [WARNING] Branch names
- [INFO] Commit information for live branches.
- File Hygiene:
- [ERROR] Unnecessary and cache file (such as .DS_Store or pycache files)
- Notebook Files (\*.ipynb):
- [ERROR] Cells per notebook < 10, lines per cell < 15 and 0 functions defined
- [ERROR] Linting: PyLint, Black, Flake and iSort
- Python Files
- [ERROR] All Code in Functions
- [ERROR] All functions have docstrings
- [ERROR] Code uses off-limit libraries (subprocess)
- [ERROR] Linting: PyLint, Black, Flake and iSort
### Github actions
There is a Github action located [here](.github/workflows/error.badges.yml) 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`.
Raw data
{
"_id": null,
"home_page": null,
"name": "dsi-cocoa",
"maintainer": "Nick Ross, Trevor Spreadbury",
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": null,
"keywords": "codebase analysis, uchicago dsi",
"author": null,
"author_email": "Nick Ross <tspread@uchicago.edu>, Trevor Spreadbury <tspread@uchicago.edu>",
"download_url": "https://files.pythonhosted.org/packages/05/b5/b6453d74e549a312095a7019cb8e51de7d362adab88ee2a846ab0be768c5/dsi_cocoa-0.5.9.tar.gz",
"platform": null,
"description": "# Clinic Opinionated Codebase Oversight and Analysis\n\n[![Cocoa Error Analysis](https://github.com/dsi-clinic/cocoa/actions/workflows/error.badges.yml/badge.svg)](https://github.com/dsi-clinic/cocoa/actions/workflows/error.badges.yml)\n\n[![Pre-commit](https://github.com/dsi-clinic/cocoa/actions/workflows/main.workflow.yml/badge.svg)](https://github.com/dsi-clinic/cocoa/actions/workflows/main.workflow.yml)\n\nThis repository was developed in order to generate automated reports on how well codebases adhere to the [coding standards](https://github.com/dsi-clinic/coding-standards) of the University of Chicago's DSI [Clinic course](https://datascience.uchicago.edu/education/data-science-clinic/).\n\nThe 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.\n\n## Installation\nThis package depends on `ruff` being available in your environment.\n\n```bash\npython3 -m pip install dsi-cocoa ruff==0.4.10\n```\n\n## cocoa\n\nThis 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:\n\n1. We want to be able to clone `cocoa` and then use it as part of their process.\n2. We want administrators to be able to give it a list of repos to generate reports on all repos.\n3. (Eventually) We want it to be able to run as a github action _on the repo itself_.\n4. (Eventually) We want to be able to have adminstrative repo that can run it on other repos.\n\n### How to run\n\nVia command line:\n\n```bash\ncocoa /path/to/repo\n```\n\n#### Options\n\nResults are truncated by default. To print all results, use the verbose option:\n\n```bash\ncocoa /path/to/repo --verbose\n```\n\nCocoa evaluates the main branch by default. To evaluate a different branch, use the branch argument:\n\n```bash\ncocoa /path/to/repo --branch branch-name\n```\n\n\nTo evaluate files created or modified after a certain date, use the date option:\n\n```bash\ncocoa /path/to/repo --date YYYY-MM-DD\n```\n\nAll options can be combined like so:\n\n```bash\ncocoa /path/to/repo --verbose --branch <branch-name> --date YYYY-MM-DD\n```\n\n\n### Checks\n\nThe code run multiple checks on each repo. For each check run there are three possibilities:\n\n1. WARNING: Most likely this needs to be fixed.\n1. INFO: Log information for additional context.\n1. ERROR: A critical issue that needs to be addressed.\n\nFor each of the checks below we have denoted what the check generates.\n\n- Branch Hygiene:\n - [WARNING] Branch names\n - [INFO] Commit information for live branches.\n- File Hygiene:\n - [ERROR] Unnecessary and cache file (such as .DS_Store or pycache files)\n- Notebook Files (\\*.ipynb):\n - [ERROR] Cells per notebook < 10, lines per cell < 15 and 0 functions defined\n - [ERROR] Linting: PyLint, Black, Flake and iSort\n- Python Files\n - [ERROR] All Code in Functions\n - [ERROR] All functions have docstrings\n - [ERROR] Code uses off-limit libraries (subprocess)\n - [ERROR] Linting: PyLint, Black, Flake and iSort\n\n### Github actions\n\nThere is a Github action located [here](.github/workflows/error.badges.yml) 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.\n\nTo 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`.\n",
"bugtrack_url": null,
"license": null,
"summary": "Clinic Opinionated Codebase Oversight and Analysis",
"version": "0.5.9",
"project_urls": null,
"split_keywords": [
"codebase analysis",
" uchicago dsi"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "0908d859da0272b2cd4f7a3b67a568fb43cb403ff99c6a804da485edbc9186c1",
"md5": "2b6b9e48e5f9e13d4a4acd5e939ad706",
"sha256": "50f4bb46b3b53ddd42e854e79740b73b7912f72ee1b9126246d2cc8ba51b01ca"
},
"downloads": -1,
"filename": "dsi_cocoa-0.5.9-py3-none-any.whl",
"has_sig": false,
"md5_digest": "2b6b9e48e5f9e13d4a4acd5e939ad706",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 10262,
"upload_time": "2024-07-02T17:30:28",
"upload_time_iso_8601": "2024-07-02T17:30:28.814968Z",
"url": "https://files.pythonhosted.org/packages/09/08/d859da0272b2cd4f7a3b67a568fb43cb403ff99c6a804da485edbc9186c1/dsi_cocoa-0.5.9-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "05b5b6453d74e549a312095a7019cb8e51de7d362adab88ee2a846ab0be768c5",
"md5": "4adfc6e49a2c194b7d64ac39e8b84e9c",
"sha256": "624f60757dc669fae2b1dc52ef50b1536c81e2779e0a5bd7db389164b75f14a5"
},
"downloads": -1,
"filename": "dsi_cocoa-0.5.9.tar.gz",
"has_sig": false,
"md5_digest": "4adfc6e49a2c194b7d64ac39e8b84e9c",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 14126,
"upload_time": "2024-07-02T17:30:39",
"upload_time_iso_8601": "2024-07-02T17:30:39.484251Z",
"url": "https://files.pythonhosted.org/packages/05/b5/b6453d74e549a312095a7019cb8e51de7d362adab88ee2a846ab0be768c5/dsi_cocoa-0.5.9.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-07-02 17:30:39",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "dsi-cocoa"
}