Skip to main content

Unified code quality orchestration; linters, formatters, type checkers, and security analyzers in one CLI

Project description

Scrutiny

Unified code quality orchestration for Python projects.

Scrutiny runs Ruff (formatter + linter), Mypy, Radon, and Bandit in a single command with tiered strictness, automatic pyproject.toml generation, context-aware defaults, and structured logging. Configure once, enforce everywhere.

Installation

# All tools
pip install ks-scrutiny[all]

# Specific tools only
pip install ks-scrutiny[ruff,mypy]

# Core package only (install tools separately)
pip install ks-scrutiny

pyproject.toml Management

Scrutiny automatically generates or merges your pyproject.toml on every run by default (--generate-config is enabled). If no pyproject.toml exists, it creates one from templates. If one already exists, it merges non-destructively — only adding missing keys while preserving everything you've already set.

Managed sections: [tool.ruff], [tool.mypy], [tool.bandit]

All other tool sections (pytest, coverage, black, isort, etc.) are never touched.

Scenario Default (merge) With --override-config
Key exists in your file Preserved Replaced with generated
Key missing from your file Added Added
Unmanaged tool sections Untouched Untouched

Generated settings are tier-aware — the rules, strictness, and thresholds written to your config match your selected tier (essential, standard, strict, or insane).

By default, --override-config and --include-test-config are disabled. Use --override-config to replace entire managed sections with generated values, and --include-test-config to also generate [tool.pytest.ini_options] and [tool.coverage.*] sections.

Quick Start

# Run with strict tier (default)
scrutiny

# Run on a specific directory
scrutiny src/

# Essential tier (core correctness only)
scrutiny --essential

# Check tool availability
scrutiny --doctor

Output Example

======================================================================
Code Quality Analysis
  Project:   my-project
  Tools:     ruff_formatter, ruff_linter, mypy, radon, bandit
  Tier:      strict
  Security:  enabled
  Context:   cli
  Mode:      standard
  Framework: none
  Config:    pyproject.toml unchanged
======================================================================

Running ruff_formatter...
[ruff_formatter]
  Files: 12
  Issues: 0
  Time: 0.02s
  Checked: formatting consistency
  Result: all files formatted

Running ruff_linter...
[ruff_linter]
  Files: 12
  Issues: 0
  Time: 0.03s
  Checked: 54 lint rule groups
  Result: no issues found

Running mypy...
[mypy]
  Files: 12
  Issues: 0
  Time: 0.45s
  Checked: strict type checking, unreachable code, untyped globals
  Result: no type errors

Running radon...
[radon]
  Files: 12
  Issues: 0
  Time: 0.08s
  Checked: cyclomatic complexity (threshold B, max score 10)
  Result: all functions within threshold

Running bandit...
[bandit]
  Files: 12
  Issues: 0
  Time: 0.15s
  Checked: security (MEDIUM+ severity, MEDIUM+ confidence)
  Result: no findings

======================================================================
Script Code: 0
All checks passed (12 files, 0.73s)
  ruff_formatter ... passed
  ruff_linter    ... passed
  mypy           ... passed
  radon          ... passed
  bandit         ... passed
======================================================================

Configuration Tiers

Tier Description Use Case
--essential Core correctness only Legacy codebases, quick checks
--standard Quality + correctness Production-ready code
--strict Maximum rigor (default) Enforced style and best practices
--insane Every rule enabled Bulletproof but noisy

Each tier includes all rules from the tier below it.

CLI Flags (Summary)

Flag Description
--tool ruff|mypy|radon|bandit Run only specified tool(s)
--fix / --check-only Enable/disable auto-fix
--parallel / --no-parallel Parallel tool execution
--generate-config Create/merge pyproject.toml
--show-config Display effective configuration
--doctor Check tool availability
-q / -v / --detailed Output verbosity

See docs/cli.md for the complete reference.

Documentation

License

See LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ks_scrutiny-3.1.2.tar.gz (189.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ks_scrutiny-3.1.2-py3-none-any.whl (103.7 kB view details)

Uploaded Python 3

File details

Details for the file ks_scrutiny-3.1.2.tar.gz.

File metadata

  • Download URL: ks_scrutiny-3.1.2.tar.gz
  • Upload date:
  • Size: 189.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for ks_scrutiny-3.1.2.tar.gz
Algorithm Hash digest
SHA256 adf57e37c73b850cbe031723299155229d723ca0acbf81e1d5391fc2df6028c7
MD5 627a580f3173c1e4bf631632ff76c4fc
BLAKE2b-256 51b889244cbd5be23d98ecdd290f583d8b0bbba463c4142f645d17ee456025a7

See more details on using hashes here.

File details

Details for the file ks_scrutiny-3.1.2-py3-none-any.whl.

File metadata

  • Download URL: ks_scrutiny-3.1.2-py3-none-any.whl
  • Upload date:
  • Size: 103.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for ks_scrutiny-3.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d942ff245bce2f9fb8060b7c1936c448aa7ab342f2227e455ddb369af779610a
MD5 3f6352c5f3375b239a329c509eec1946
BLAKE2b-256 03ce89e7a339fbc6ae22ae5b78b91dc7092d100aeddd1773aa49befde0961bb9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page