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 CLI Reference 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.3.tar.gz (189.9 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.3-py3-none-any.whl (103.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ks_scrutiny-3.1.3.tar.gz
  • Upload date:
  • Size: 189.9 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.3.tar.gz
Algorithm Hash digest
SHA256 5e1b90d896192ac3de815fc1405f64dbc194b612687c687b14dc38653aac1abf
MD5 b20890764bbd67be5c5c18d4c45747cf
BLAKE2b-256 d1a280ec11da184267017badb27f0f590e397d3b1d9c4f201af651e80f2a1db4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ks_scrutiny-3.1.3-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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 8d29606305c139615dda4000e44efa6d2a603d7bd17f4705a50245d14e6c59d5
MD5 ab263b3be98e8db5a8b234521b172a9e
BLAKE2b-256 9d051218c0b727c38542b36ef7c7079081d3e194903ec988bbd130f163aa0319

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