Standalone Usage
Installation
Homebrew
CodeLimit is available on Homebrew:
brew install codelimit
Pipx
To install the standalone version of CodeLimit in an isolated Python environment using pipx run:
pipx install codelimit
PyPi
To install the standalone version of CodeLimit for your default Python installation run:
python -m pip install codelimit
Platform binaries
Binaries for different platforms (macOS, Linux, Windows) are available on the latest release page.
Usage
Run CodeLimit without arguments to see the usage page:
$ codelimit
Usage: codelimit [OPTIONS] COMMAND [ARGS]...
CodeLimit: Your refactoring alarm.
╭─ Options ────────────────────────────────────────────────────────────────────╮
│ --verbose -v Verbose output │
│ --exclude TEXT Glob patterns for exclusion [default: None] │
│ --version -V Show version │
│ --help Show this message and exit. │
╰──────────────────────────────────────────────────────────────────────────────╯
╭─ Commands ───────────────────────────────────────────────────────────────────╮
│ check Check file(s) │
│ scan Scan a codebase │
│ report Show report for codebase │
│ app CodeLimit GitHub App commands │
╰──────────────────────────────────────────────────────────────────────────────╯
Scanning a codebase
To scan a complete codebase run:
codelimit scan path/to/codebase
Viewing a report
To view the report with hard-to-maintain and unmaintainable functions of a codebase that was scanned before run:
Checking files
To check a single file or list of files for functions that need refactoring, run:
codelimit check a.py b.py c.py