Skip to main content

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.

Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

dogmatic-0.1.4-py3-none-macosx_11_0_arm64.whl (12.9 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

File details

Details for the file dogmatic-0.1.4-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for dogmatic-0.1.4-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 906b59da7a56482be39b17369234aec4a45eaf01f887edfd16edecd66c2e15dc
MD5 21f4ba4dfb12bae6caa6b9dbab7c43c2
BLAKE2b-256 58c89223bfb57f3a030ed233334e34454343538973aa780f128f6487596ab265

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.4 This release

1 file

0.1.3

1 file

0.1.2

1 file

0.1.1

1 file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page