From 7ab2bc461a0503c51089382523c2a32c09b59d65 Mon Sep 17 00:00:00 2001 From: Robin Quintero Date: Sat, 10 Feb 2024 17:57:24 -0500 Subject: [PATCH] feat(docs): #2 update readme --- README.md | 35 ++++++++++++++--------------------- 1 file changed, 14 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 39770a6..9e1a6be 100644 --- a/README.md +++ b/README.md @@ -3,34 +3,27 @@ An extremely fast Python library to calculate the cognitive complexity of python files, written in Rust. -## Installation +## Getting Started -```bash -pip install complexipy -``` +### Installation -## Usage - -To calculate the cognitive complexity of a single file, you can use the -following command: +**complexipy** is available as +[`complexipy`](https://pypi.org/project/complexipy/) on PyPI (Python >= 3.11): ```bash -complexipy path/to/file.py +pip install complexipy ``` -To calculate the cognitive complexity of a directory, you can use the following -command: +### Usage -```bash -complexipy path/to/directory -``` - -by default the maximum cognitive complexity is 15, you can change it using the -`-m` option, for example: +To run **complexipy** you can use the following command: -```bash -complexipy path/to/directory -m 20 -``` +
+complexipy .                         # Use complexipy to analyze the current directory and any subdirectories with python files
+complexipy path/to/directory         # Use complexipy to analyze a specific directory and any subdirectories with python files
+complexipy path/to/file.py           # Use complexipy to analyze a specific file
+complexipy path/to/file.py -m 20     # Use the -m option to set the maximum congnitive complexity, default is 15
+
For example, given the following file: @@ -52,7 +45,7 @@ The cognitive complexity of the file is 3, and the output of the command `complexipy path/to/file.py` will be: ```bash -───────────────────────────── complexipy 0.1.0 🐙 ────────────────────────────── +───────────────── complexipy 0.1.0 🐙 ───────────────── test_decorator.py Analysis completed! 🎉 Summary