Metadata-Version: 2.4
Name: scopio
Version: 0.1.1
Summary: Code metrics auditor with SQLite history, diffs and quality gates.
Author-email: "Gabriel P. Monte" <gabrielpmonte@users.noreply.github.com>
License-Expression: MIT
Project-URL: Homepage, https://github.com/gabrielpmonte/scopio
Project-URL: Repository, https://github.com/gabrielpmonte/scopio
Project-URL: Issues, https://github.com/gabrielpmonte/scopio/issues
Keywords: metrics,code-quality,ccn,lizard,scc,audit,ci
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Topic :: Software Development :: Quality Assurance
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: click>=8.1
Requires-Dist: tomli>=1.2; python_version < "3.11"
Provides-Extra: dev
Requires-Dist: pytest>=8; extra == "dev"
Dynamic: license-file

# scopio

Code metrics auditor with SQLite history, diffs and quality gates.

## Install

```bash
pip install scopio
```

## Quick Start

```bash
scopio --config scopio.toml run
```

## Usage

### Run audit

```bash
scopio --config scopio.toml run
scopio --config scopio.toml run --verbose
scopio --config scopio.toml run --incremental
```

### Report history

```bash
scopio report --project wrong-web --limit 10
```

### Diff between audits

```bash
scopio diff --project wrong-web
```

### Diff report with file-level detail

```bash
scopio diff-report --project wrong-web --files --threshold-ccn 6
```

### CI integration

```bash
scopio ci --project wrong-web --fail-on-regression
```

### Clean old audits

```bash
scopio clean --keep 50
```

### Archive old data

```bash
scopio archive --older-than 2026-01-01 --format csv
```

### Initialize config

```bash
scopio init
```

## Configuration

```toml
[discovery]
ignore_hidden = true
projects = ["my-project"]

[filters]
global_dirs = ["node_modules", "target", "dist", "build"]
minified_files = ["*.min.js", "*.min.css"]
ignored_langs = ["JSON", "Markdown", "TOML"]

[quality_gates]
max_ccn = 10.0
max_warnings = 10
max_ccn_trend_increase = 0.2
trend_sensitive_projects = []

[quality_gates.per_project]
# "my-project" = { max_ccn = 12.0, max_warnings = 15 }

[quality_gates.per_language]
# Python = { max_ccn = 12.0, max_warnings = 20 }
```

## GitHub Actions

```yaml
name: Scopio
on:
  push:
    branches: [main]
  pull_request:
    branches: [main]

jobs:
  scopio:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-python@v5
        with:
          python-version: "3.11"
      - name: Install scopio
        run: pip install scopio
      - name: Run scopio
        run: scopio ci --project my-project --fail-on-regression
```

## License

MIT
