Dogmatic
An opinionated Python linter and formatter built on Ruff, with native rules for typed data boundaries, explicit dependency injection, async execution, pytest, named constants, and focused application modules.
uv tool install dogmatic
dogmatic check .
dogmatic format .
The Python package also supports python -m dogmatic. Dogmatic uses Ruff's
configuration format, including [tool.ruff] in pyproject.toml, ruff.toml,
and existing rule selectors and suppressions.
Dogmatic's release version is independent of its Ruff engine version. Ruff's
required-version setting checks the engine version, currently 0.16.6.
All custom checks and companion application policies are enabled by default. No policy download or enablement flags are required. The executable includes offline explanations, configuration examples, and the complete default policy:
dogmatic guide
dogmatic guide --starter
dogmatic guide --policy
dogmatic rule custom-repository-boundary
dogmatic config lint.custom
Most rules work immediately. Repository boundaries require module mappings;
application-specific validators, clients, and setup functions can be registered
with lint.custom. Merge the starter configuration into your existing
pyproject.toml and replace its example package names.
Application modules exceeding 300 code lines are flagged for review and splitting
into focused submodules. Comments and docstrings do not count; tests, stubs, and
notebooks are exempt. Configure lint.custom.max-module-lines to change the limit.
dogmatic check . also flags repeated consecutive statement blocks within and across application
modules, starting at five statements. This includes executable module code, main guards,
class bodies, functions, and nested control flow; declarations alone do not qualify. Configure lint.custom.min-duplicate-statements
to adjust this threshold. Comments, docstrings, spacing, and consistent local-variable
renames are ignored. External APIs, literal values, and variable-use relationships
must match. Cross-module detection requires a CLI file collection and does
not run on stdin or in the language server.
Three additional default rules suggest shared abstractions when code differs:
custom-duplicate-algorithm recognizes consistent policy-constant substitutions,
custom-duplicate-workflow allows a small number of inserted steps, and
custom-duplicate-computation compares sums and collection-building loops with
comprehensions. Their offline explainers describe thresholds and exclusions.
These are heuristic findings for review, with no automatic fixes; each rule can
be disabled independently through the usual selectors.
Project settings and CLI flags override defaults. Use lint.ignore for targeted
exceptions; lint.select replaces the selection. --isolated keeps Dogmatic's
defaults while ignoring configuration files. --no-preview disables the default
preview custom rules. Formatter preview is unchanged.
Dogmatic includes Ruff, originally developed by Astral Software Inc., under the MIT license. The upstream project is available at astral-sh/ruff. Dogmatic is an independent distribution; its application-specific policies are not upstream Ruff rules.
Dogmatic also checks framework leakage, repository transaction ownership, ambient
clocks and randomness, queries inside loops, empty operational-error returns,
repeated parameter groups, boolean workflow switches, domain input mutation, and
broad dependencies with narrow usage. These rules are independently selectable
and enabled by default. Architecture checks require explicit module mappings;
broad dependencies require type registration. dogmatic guide explains each rule
and its limits, and dogmatic guide --starter includes configuration examples.
custom-sequential-await flags potentially independent awaited calls executed in
sequence or simple loops. It suggests reviewing asyncio.gather or task groups,
while leaving dependent operations and existing task drains alone. The bundled
guide explains ordering, bounded concurrency, and suppression of intentional
sequential execution.
custom-too-many-data-parameters recommends reviewing functions with six or more
data parameters. The dataclass rule also checks fixed tuple return records with
three or more fields and nested fixed records. Configure the limits with
lint.custom.max-data-parameters and lint.custom.max-tuple-return-fields.
The bundled guide explains dependency exclusions, named-record constructors, and
return-contract deduplication.
Metadata
Release files for dogmatic 0.1.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| dogmatic-0.1.5-py3-none-macosx_11_0_arm64.whl | Python 3 | none | macOS 11.0+ ARM64 | Details |
Release files / dogmatic-0.1.5-py3-none-macosx_11_0_arm64.whl
| Download URL | dogmatic-0.1.5-py3-none-macosx_11_0_arm64.whl |
|---|---|
| Size | 13.0 MB |
| Tags | Python 3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
7a8bba449d899a65fb3131d672e3ddf596c0149e40ee8a33f43f1ecf4cd1a113
|
|
BLAKE2b-256 checksum How to use checksums |
b6f5f3705e8993aef5b99877898f423b1f9246eecd5152654a3089eceecdc1cc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.11
|