Python Package

Code Consistency

Enforcing consistent coding standards and style across a Python codebase.

Early Access: Until 2026-12-31

Consistency is not a cosmetic extra in mgpy: a clear tooling and style path reduces review friction, false positives and unstable reports.

Key points

  • CLI: On Windows the examples use the recommended py -3.12 -m <module> ... form (for example py -3.12 -m manifestguard ...). On Linux/macOS this usually maps to python3.12 -m ....
  • Ruff is the preferred single engine for linting, formatting and import organization.
  • One shared pyproject.toml is more reliable than many competing tool configurations.
  • Fix the root cause of recurring findings instead of hiding them behind suppressions.

Recommended mgpy workflow

  1. Define one shared ruleset in the repository instead of per-developer variants.
  2. Stabilize Ruff fixes and formatting before running mgpy extended checks.
  3. Run mgpy afterwards so reports are generated on top of a calm style baseline.

Quick start

py -3.12 -m ruff check . --fix
py -3.12 -m ruff format .
py -3.12 -m manifestguard check --extended