smelt-cli 0.3.0__tar.gz → 0.5.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/.pre-commit-hooks.yaml +2 -2
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/CHANGELOG.md +149 -1
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/CONTRIBUTING.md +21 -8
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/Cargo.lock +1 -1
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/Cargo.toml +1 -1
- smelt_cli-0.5.0/PKG-INFO +179 -0
- smelt_cli-0.5.0/README.md +163 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/docs/README.md +1 -1
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/docs/adoption.md +57 -1
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/docs/agent-workflow.md +2 -2
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/docs/cli.md +31 -3
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/docs/configuration.md +112 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/docs/integrations.md +14 -8
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/docs/proposals/config-structure.md +2 -2
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/docs/rules/README.md +11 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/docs/rules/SMT104.md +3 -2
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/docs/rules/SMT108.md +3 -3
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/docs/rules/SMT109.md +2 -1
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/docs/rules/SMT305.md +1 -1
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/docs/rules/SMT306.md +2 -2
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/docs/rules/SMT309.md +2 -2
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/docs/rules/SMT313.md +1 -1
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/docs/rules/SMT316.md +1 -1
- smelt_cli-0.5.0/docs/rules/SMT321.md +36 -0
- smelt_cli-0.5.0/docs/rules/SMT322.md +41 -0
- smelt_cli-0.5.0/docs/rules/SMT323.md +42 -0
- smelt_cli-0.5.0/docs/rules/SMT324.md +53 -0
- smelt_cli-0.5.0/docs/rules/SMT325.md +34 -0
- smelt_cli-0.5.0/docs/rules/SMT326.md +42 -0
- smelt_cli-0.5.0/docs/rules/SMT327.md +43 -0
- smelt_cli-0.5.0/docs/rules/SMT328.md +44 -0
- smelt_cli-0.5.0/docs/rules/SMT329.md +42 -0
- smelt_cli-0.5.0/docs/rules/SMT330.md +43 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/docs/rules/SMT424.md +1 -1
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/docs/rules/SMT426.md +1 -1
- smelt_cli-0.5.0/docs/rules/SMT431.md +42 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/docs/rules/SMT901.md +2 -2
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/docs/structure.md +62 -6
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/docs/upgrading.md +121 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/pyproject.toml +2 -1
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/scripts/benchmark_checks.py +1 -1
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/scripts/benchmark_hooks.py +4 -2
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/scripts/smoke_distribution.py +1 -1
- smelt_cli-0.5.0/smelt/analysis/call_order.py +166 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/analysis/context.py +1 -1
- smelt_cli-0.5.0/smelt/analysis/discriminators.py +135 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/analysis/exports.py +31 -27
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/analysis/facade_usage.py +109 -46
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/analysis/imports.py +22 -20
- smelt_cli-0.5.0/smelt/analysis/lazy_exports.py +390 -0
- smelt_cli-0.5.0/smelt/analysis/navigation.py +374 -0
- smelt_cli-0.5.0/smelt/analysis/none_default_rewrite.py +110 -0
- smelt_cli-0.5.0/smelt/analysis/none_defaults.py +170 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/analysis/ordering.py +245 -154
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/analysis/parsing.py +3 -10
- smelt_cli-0.5.0/smelt/analysis/providers.py +183 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/analysis/python_version.py +5 -3
- smelt_cli-0.5.0/smelt/analysis/settings.py +176 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/analysis/test_outcomes.py +37 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/analysis/test_timing.py +17 -4
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/cli/app.py +63 -34
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/cli/commands/adopt.py +45 -3
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/cli/commands/check.py +53 -23
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/cli/commands/info.py +15 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/cli/support.py +1 -1
- smelt_cli-0.5.0/smelt/config/composition.py +175 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/config/errors.py +3 -1
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/config/loader.py +41 -12
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/config/models.py +21 -4
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/config/schema.py +10 -1
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/config/validation.py +14 -8
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/diagnostics/debt.py +92 -28
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/diagnostics/groups.py +64 -5
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/diagnostics/render/text.py +42 -8
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/docs.py +19 -16
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/engine/briefing.py +13 -1
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/engine/cache.py +2 -2
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/engine/check.py +141 -99
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/engine/coverage.py +12 -6
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/engine/evaluation.py +38 -22
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/engine/file_checks.py +4 -4
- smelt_cli-0.5.0/smelt/engine/none_default_fixes.py +70 -0
- smelt_cli-0.5.0/smelt/engine/ordering_fixes.py +80 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/engine/result_cache.py +1 -1
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/engine/rule_settings.py +35 -35
- smelt_cli-0.5.0/smelt/engine/source_fixes.py +80 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/engine/staged.py +1 -1
- smelt_cli-0.5.0/smelt/engine/workspace.py +11 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/rules/activation.py +7 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/rules/base.py +8 -6
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/rules/catalog.json +167 -1
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/rules/common.py +2 -2
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/rules/dependencies/composition_root.py +2 -2
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/rules/dependencies/cycles.py +90 -14
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/rules/dependencies/facades.py +19 -3
- smelt_cli-0.5.0/smelt/rules/dependencies/fanout.py +152 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/rules/dependencies/features.py +3 -3
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/rules/dependencies/interfaces.py +2 -2
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/rules/dependencies/layers.py +2 -2
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/rules/dependencies/third_party.py +2 -2
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/rules/meta.py +4 -3
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/rules/registry.py +16 -5
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/rules/structure/assignments.py +2 -2
- smelt_cli-0.5.0/smelt/rules/structure/call_order.py +48 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/rules/structure/contracts.py +2 -2
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/rules/structure/coverage.py +4 -4
- smelt_cli-0.5.0/smelt/rules/structure/discriminators.py +56 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/rules/structure/enum_values.py +2 -2
- smelt_cli-0.5.0/smelt/rules/structure/exports.py +79 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/rules/structure/headers.py +44 -7
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/rules/structure/import_style.py +2 -2
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/rules/structure/layout.py +4 -4
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/rules/structure/members.py +4 -3
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/rules/structure/module_symbols.py +2 -2
- smelt_cli-0.5.0/smelt/rules/structure/naming.py +243 -0
- smelt_cli-0.5.0/smelt/rules/structure/navigation.py +183 -0
- smelt_cli-0.5.0/smelt/rules/structure/none_defaults.py +51 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/rules/structure/ordering.py +3 -2
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/rules/structure/package_imports.py +2 -2
- smelt_cli-0.5.0/smelt/rules/structure/providers.py +48 -0
- smelt_cli-0.5.0/smelt/rules/structure/settings.py +50 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/rules/structure/type_dispatch.py +2 -2
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/rules/testing/awaits.py +2 -2
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/rules/testing/cases.py +2 -2
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/rules/testing/location.py +105 -105
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/rules/testing/mocking.py +4 -4
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/rules/testing/outcomes.py +14 -6
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/rules/testing/private_access.py +2 -2
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/rules/testing/public_attributes.py +2 -2
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/rules/testing/public_functions.py +2 -2
- smelt_cli-0.5.0/smelt/rules/testing/randomness.py +76 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/rules/testing/timing.py +10 -4
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt.schema.json +736 -103
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt.yml +10 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/tests/analysis/test_context.py +8 -8
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/tests/analysis/test_contracts.py +4 -4
- smelt_cli-0.5.0/tests/analysis/test_lazy_exports.py +150 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/tests/analysis/test_module_symbols.py +2 -2
- smelt_cli-0.5.0/tests/analysis/test_none_default_rewrite.py +36 -0
- smelt_cli-0.5.0/tests/analysis/test_none_defaults.py +22 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/tests/analysis/test_ordering_rewrite.py +43 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/tests/analysis/test_parsing.py +1 -1
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/tests/analysis/test_python_version.py +4 -4
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/tests/analysis/test_retained.py +2 -2
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/tests/analysis/test_test_helpers.py +1 -0
- smelt_cli-0.5.0/tests/cli/commands/test_adopt.py +169 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/tests/cli/test_app.py +330 -106
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/tests/cli/test_session.py +39 -6
- smelt_cli-0.5.0/tests/config/test_composition.py +209 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/tests/config/test_loader.py +13 -10
- smelt_cli-0.5.0/tests/diagnostics/test_debt.py +154 -0
- smelt_cli-0.5.0/tests/diagnostics/test_groups.py +288 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/tests/engine/test_briefing.py +38 -13
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/tests/engine/test_cache.py +49 -19
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/tests/engine/test_changes.py +65 -18
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/tests/engine/test_check.py +28 -4
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/tests/engine/test_coverage.py +29 -5
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/tests/engine/test_evaluation.py +45 -6
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/tests/engine/test_file_checks.py +6 -6
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/tests/engine/test_inference.py +1 -1
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/tests/engine/test_native_git.py +1 -1
- smelt_cli-0.5.0/tests/engine/test_none_default_fixes.py +164 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/tests/engine/test_ordering_fixes.py +4 -4
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/tests/engine/test_paths.py +5 -5
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/tests/engine/test_rule_settings.py +3 -3
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/tests/engine/test_schema.py +9 -0
- smelt_cli-0.5.0/tests/engine/test_source_fixes.py +26 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/tests/engine/test_staged.py +165 -29
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/tests/helpers.py +1 -1
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/tests/rules/dependencies/test_composition_root.py +6 -6
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/tests/rules/dependencies/test_cycles.py +130 -8
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/tests/rules/dependencies/test_facades.py +164 -2
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/tests/rules/dependencies/test_fanout.py +118 -1
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/tests/rules/dependencies/test_features.py +13 -13
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/tests/rules/dependencies/test_interfaces.py +4 -4
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/tests/rules/dependencies/test_layers.py +1 -1
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/tests/rules/dependencies/test_third_party.py +2 -2
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/tests/rules/structure/test_assignments.py +1 -1
- smelt_cli-0.5.0/tests/rules/structure/test_call_order.py +86 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/tests/rules/structure/test_contracts.py +8 -8
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/tests/rules/structure/test_coverage.py +13 -17
- smelt_cli-0.5.0/tests/rules/structure/test_discriminators.py +318 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/tests/rules/structure/test_enum_values.py +1 -1
- smelt_cli-0.5.0/tests/rules/structure/test_exports.py +84 -0
- smelt_cli-0.5.0/tests/rules/structure/test_headers.py +354 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/tests/rules/structure/test_import_style.py +2 -2
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/tests/rules/structure/test_layout.py +6 -6
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/tests/rules/structure/test_members.py +37 -1
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/tests/rules/structure/test_module_symbols.py +1 -1
- smelt_cli-0.5.0/tests/rules/structure/test_naming.py +531 -0
- smelt_cli-0.5.0/tests/rules/structure/test_navigation.py +362 -0
- smelt_cli-0.5.0/tests/rules/structure/test_none_defaults.py +284 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/tests/rules/structure/test_ordering.py +10 -10
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/tests/rules/structure/test_package_imports.py +1 -1
- smelt_cli-0.5.0/tests/rules/structure/test_providers.py +115 -0
- smelt_cli-0.5.0/tests/rules/structure/test_settings.py +106 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/tests/rules/structure/test_type_dispatch.py +1 -1
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/tests/rules/test_activation.py +7 -4
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/tests/rules/test_registry.py +8 -6
- smelt_cli-0.5.0/tests/rules/testing/__init__.py +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/tests/rules/testing/test_awaits.py +5 -5
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/tests/rules/testing/test_cases.py +1 -1
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/tests/rules/testing/test_location.py +5 -5
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/tests/rules/testing/test_mocking.py +1 -1
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/tests/rules/testing/test_outcomes.py +64 -8
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/tests/rules/testing/test_private_access.py +7 -7
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/tests/rules/testing/test_public_attributes.py +2 -2
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/tests/rules/testing/test_public_functions.py +15 -15
- smelt_cli-0.5.0/tests/rules/testing/test_randomness.py +108 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/tests/rules/testing/test_timing.py +9 -4
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/tests/test_docs.py +1 -1
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/uv.lock +1 -1
- smelt_cli-0.3.0/PKG-INFO +0 -115
- smelt_cli-0.3.0/README.md +0 -99
- smelt_cli-0.3.0/smelt/engine/ordering_fixes.py +0 -132
- smelt_cli-0.3.0/smelt/engine/workspace.py +0 -5
- smelt_cli-0.3.0/smelt/rules/dependencies/fanout.py +0 -81
- smelt_cli-0.3.0/smelt/rules/structure/naming.py +0 -132
- smelt_cli-0.3.0/tests/diagnostics/test_groups.py +0 -137
- smelt_cli-0.3.0/tests/rules/structure/test_headers.py +0 -179
- smelt_cli-0.3.0/tests/rules/structure/test_naming.py +0 -258
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/.editorconfig +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/.gitattributes +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/.github/dependabot.yml +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/.github/pull_request_template.md +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/.github/workflows/ci.yml +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/.github/workflows/release.yml +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/.gitignore +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/.pre-commit-config.yml +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/.python-version +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/docs/architecture.md +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/docs/benchmarks/incremental-followup-2026-10-31.json +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/docs/benchmarks/native-checks-2026-10-31.json +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/docs/benchmarks/native-git-retained-state-2026-10-31.json +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/docs/benchmarks/precommit-performance-2026-10-30.json +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/docs/benchmarks/review-feedback-2026-10-31.json +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/docs/benchmarks/staged-checks-2026-10-30.json +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/docs/benchmarks/staged-policy-cache-2026-10-31.json +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/docs/facade-export-evaluation.json +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/docs/review.md +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/docs/rule-selection.md +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/docs/rules/SMT101.md +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/docs/rules/SMT102.md +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/docs/rules/SMT103.md +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/docs/rules/SMT105.md +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/docs/rules/SMT106.md +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/docs/rules/SMT107.md +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/docs/rules/SMT301.md +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/docs/rules/SMT302.md +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/docs/rules/SMT307.md +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/docs/rules/SMT308.md +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/docs/rules/SMT310.md +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/docs/rules/SMT311.md +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/docs/rules/SMT312.md +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/docs/rules/SMT314.md +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/docs/rules/SMT315.md +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/docs/rules/SMT317.md +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/docs/rules/SMT318.md +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/docs/rules/SMT319.md +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/docs/rules/SMT320.md +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/docs/rules/SMT401.md +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/docs/rules/SMT420.md +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/docs/rules/SMT421.md +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/docs/rules/SMT422.md +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/docs/rules/SMT423.md +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/docs/rules/SMT425.md +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/docs/rules/SMT427.md +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/docs/rules/SMT428.md +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/docs/rules/SMT429.md +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/docs/rules/SMT430.md +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/docs/rules/SMT902.md +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/docs/rules/SMT903.md +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/docs/test-quality-evaluation.json +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/docs/testing.md +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/docs/vision.md +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/native/git.rs +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/native/main.rs +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/native/worker.rs +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/scripts/benchmark_session.py +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/scripts/evaluate.py +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/scripts/generate.py +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/__init__.py +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/__main__.py +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/analysis/__init__.py +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/analysis/annotations.py +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/analysis/cache.py +45 -45
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/analysis/contracts.py +26 -26
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/analysis/coverage.py +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/analysis/definition_blocks.py +377 -377
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/analysis/enum_values.py +14 -14
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/analysis/errors.py +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/analysis/files.py +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/analysis/function_usage.py +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/analysis/graphs.py +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/analysis/identity.py +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/analysis/import_cache.py +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/analysis/literals.py +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/analysis/member_state.py +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/analysis/members.py +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/analysis/module_symbols.py +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/analysis/ordering_rewrite.py +28 -28
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/analysis/package_exports.py +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/analysis/retained.py +10 -10
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/analysis/syntax.py +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/analysis/test_awaits.py +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/analysis/test_cases.py +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/analysis/test_deadlines.py +28 -28
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/analysis/test_helpers.py +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/analysis/test_subprocesses.py +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/analysis/test_syntax.py +96 -96
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/analysis/type_dispatch.py +24 -24
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/analysis/workspace.py +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/cli/__init__.py +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/cli/commands/__init__.py +10 -10
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/cli/commands/discover.py +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/cli/session.py +35 -35
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/cli/session_slots.py +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/config/__init__.py +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/config/discovery.py +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/config/patterns.py +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/config/source.py +3 -3
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/diagnostics/__init__.py +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/diagnostics/dedupe.py +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/diagnostics/render/__init__.py +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/diagnostics/render/machine.py +4 -4
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/diagnostics/report.py +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/diagnostics/suppressions.py +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/diagnostics/violation.py +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/engine/__init__.py +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/engine/changes.py +38 -38
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/engine/git_source.py +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/engine/inference.py +50 -50
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/engine/mirror_inference.py +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/engine/native_git.py +49 -49
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/engine/paths.py +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/engine/schema.py +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/model/__init__.py +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/model/architecture.py +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/py.typed +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/rules/__init__.py +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/rules/dependencies/__init__.py +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/rules/member_names.py +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/rules/structure/__init__.py +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/smelt/rules/testing/__init__.py +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/tests/__init__.py +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/tests/analysis/__init__.py +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/tests/analysis/test_annotations.py +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/tests/analysis/test_enum_values.py +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/tests/analysis/test_exports.py +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/tests/analysis/test_identity.py +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/tests/analysis/test_ordering.py +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/tests/analysis/test_test_awaits.py +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/tests/analysis/test_test_cases.py +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/tests/analysis/test_test_deadlines.py +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/tests/analysis/test_test_outcomes.py +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/tests/analysis/test_test_syntax.py +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/tests/analysis/test_test_timing.py +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/tests/analysis/test_type_dispatch.py +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/tests/analysis/test_workspace.py +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/tests/cli/__init__.py +0 -0
- {smelt_cli-0.3.0/tests/config → smelt_cli-0.5.0/tests/cli/commands}/__init__.py +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/tests/cli/test_session_slots.py +0 -0
- {smelt_cli-0.3.0/tests/diagnostics → smelt_cli-0.5.0/tests/config}/__init__.py +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/tests/config/test_validation.py +0 -0
- {smelt_cli-0.3.0/tests/diagnostics/render → smelt_cli-0.5.0/tests/diagnostics}/__init__.py +0 -0
- {smelt_cli-0.3.0/tests/engine → smelt_cli-0.5.0/tests/diagnostics/render}/__init__.py +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/tests/diagnostics/render/conftest.py +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/tests/diagnostics/render/test_machine.py +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/tests/diagnostics/render/test_text.py +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/tests/diagnostics/test_suppressions.py +0 -0
- {smelt_cli-0.3.0/tests/fixtures/gateway/src/gateway → smelt_cli-0.5.0/tests/engine}/__init__.py +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/tests/engine/test_mirror_inference.py +0 -0
- /smelt_cli-0.3.0/tests/fixtures/gateway/smelt.yaml → /smelt_cli-0.5.0/tests/fixtures/gateway/smelt.yml +0 -0
- {smelt_cli-0.3.0/tests/fixtures/gateway/src/gateway/features → smelt_cli-0.5.0/tests/fixtures/gateway/src/gateway}/__init__.py +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/tests/fixtures/gateway/src/gateway/bootstrap.py +0 -0
- {smelt_cli-0.3.0/tests/fixtures/gateway/src/gateway/features/billing → smelt_cli-0.5.0/tests/fixtures/gateway/src/gateway/features}/__init__.py +0 -0
- {smelt_cli-0.3.0/tests/fixtures/gateway/src/gateway/features/billing/application → smelt_cli-0.5.0/tests/fixtures/gateway/src/gateway/features/billing}/__init__.py +0 -0
- {smelt_cli-0.3.0/tests/fixtures/gateway/src/gateway/features/billing/domain → smelt_cli-0.5.0/tests/fixtures/gateway/src/gateway/features/billing/application}/__init__.py +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/tests/fixtures/gateway/src/gateway/features/billing/application/invoices.py +0 -0
- {smelt_cli-0.3.0/tests/fixtures/gateway/src/gateway/features/voice → smelt_cli-0.5.0/tests/fixtures/gateway/src/gateway/features/billing/domain}/__init__.py +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/tests/fixtures/gateway/src/gateway/features/billing/domain/money.py +0 -0
- {smelt_cli-0.3.0/tests/fixtures/gateway/src/gateway/features/voice/api → smelt_cli-0.5.0/tests/fixtures/gateway/src/gateway/features/voice}/__init__.py +0 -0
- {smelt_cli-0.3.0/tests/fixtures/gateway/src/gateway/features/voice/application → smelt_cli-0.5.0/tests/fixtures/gateway/src/gateway/features/voice/api}/__init__.py +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/tests/fixtures/gateway/src/gateway/features/voice/api/routes.py +0 -0
- {smelt_cli-0.3.0/tests/fixtures/gateway/src/gateway/features/voice/domain → smelt_cli-0.5.0/tests/fixtures/gateway/src/gateway/features/voice/application}/__init__.py +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/tests/fixtures/gateway/src/gateway/features/voice/application/ports.py +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/tests/fixtures/gateway/src/gateway/features/voice/application/session.py +0 -0
- {smelt_cli-0.3.0/tests/fixtures/gateway/src/gateway/features/voice/infra → smelt_cli-0.5.0/tests/fixtures/gateway/src/gateway/features/voice/domain}/__init__.py +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/tests/fixtures/gateway/src/gateway/features/voice/domain/session.py +0 -0
- {smelt_cli-0.3.0/tests/fixtures/gateway/src/gateway/shared → smelt_cli-0.5.0/tests/fixtures/gateway/src/gateway/features/voice/infra}/__init__.py +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/tests/fixtures/gateway/src/gateway/features/voice/infra/sql.py +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/tests/fixtures/gateway/src/gateway/main.py +0 -0
- {smelt_cli-0.3.0/tests/model → smelt_cli-0.5.0/tests/fixtures/gateway/src/gateway/shared}/__init__.py +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/tests/fixtures/gateway/src/gateway/shared/clock.py +0 -0
- {smelt_cli-0.3.0/tests/rules → smelt_cli-0.5.0/tests/model}/__init__.py +0 -0
- {smelt_cli-0.3.0 → smelt_cli-0.5.0}/tests/model/test_architecture.py +0 -0
- {smelt_cli-0.3.0/tests/rules/dependencies → smelt_cli-0.5.0/tests/rules}/__init__.py +0 -0
- {smelt_cli-0.3.0/tests/rules/structure → smelt_cli-0.5.0/tests/rules/dependencies}/__init__.py +0 -0
- {smelt_cli-0.3.0/tests/rules/testing → smelt_cli-0.5.0/tests/rules/structure}/__init__.py +0 -0
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
- id: smelt
|
|
2
2
|
name: smelt
|
|
3
|
-
description: Check Python architecture boundaries against smelt.
|
|
3
|
+
description: Check Python architecture boundaries against smelt.yml.
|
|
4
4
|
entry: smelt check
|
|
5
5
|
language: python
|
|
6
6
|
pass_filenames: false
|
|
7
|
-
|
|
7
|
+
always_run: true
|
|
8
8
|
require_serial: true
|
|
9
9
|
- id: smelt-staged
|
|
10
10
|
name: smelt (new staged findings)
|
|
@@ -7,6 +7,152 @@ current configuration and complete rule contracts, see the [README](README.md),
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.5.0] - 2026-11-02
|
|
11
|
+
|
|
12
|
+
Report schema 2, YAML version 1 and the default rule set remain unchanged.
|
|
13
|
+
Debt writes now use grouped baseline version 2, which older Smelt versions cannot
|
|
14
|
+
read. Existing version-1 baselines remain readable; unscoped SMT321 debt needs
|
|
15
|
+
review and explicit re-recording. Update installation, hook and CI pins together
|
|
16
|
+
to `0.5.0` (`v0.5.0`) before rewriting baselines, and refresh the editor schema.
|
|
17
|
+
See the [upgrade checklist](docs/upgrading.md#040-to-050).
|
|
18
|
+
|
|
19
|
+
- Contributor checks now require an issue/ticket reference for TODO comments
|
|
20
|
+
through Ruff TD003. Tracked TODOs remain allowed; Smelt's rule catalog is unchanged.
|
|
21
|
+
|
|
22
|
+
- Document SMT317's activation and developer-facing extraction evidence with
|
|
23
|
+
concrete query-helper regressions. Inherited-class exclusions and the existing
|
|
24
|
+
advisory behavior are preserved; no duplicate static-method rule is added.
|
|
25
|
+
|
|
26
|
+
- Optional SMT329 (`rules: {caller-before-callee: hint}`) reviews step-down reading
|
|
27
|
+
order for direct same-visibility functions and ordinary methods. Recursive,
|
|
28
|
+
shadowed and definition-time-dependent pairs are retained; SMT313's public-first
|
|
29
|
+
categories take precedence. No definitions are moved automatically.
|
|
30
|
+
|
|
31
|
+
- Optional SMT328 (`rules: {redundant-dishka-provider: hint}`) reviews Dishka
|
|
32
|
+
provider methods that only forward dependencies to a constructor. Findings
|
|
33
|
+
include a direct registration candidate with recognized decorator options.
|
|
34
|
+
Resource factories and additional logic remain valid; no automatic rewrite.
|
|
35
|
+
|
|
36
|
+
- Optional SMT327 (`rules: {secret-settings-field: warning}`) reviews secret-named
|
|
37
|
+
Pydantic settings fields accepting plain `str`/`bytes`, including optional and
|
|
38
|
+
annotated types. Correct secret types and nonsecret names remain valid.
|
|
39
|
+
Findings omit default values; no annotations or consumers are rewritten.
|
|
40
|
+
|
|
41
|
+
- Optional SMT326 (`rules: {no-base-class-suffix: error}`) reviews class definitions
|
|
42
|
+
such as `_MessageBase`. SMT323 retains its existing prefix semantics. Imports,
|
|
43
|
+
aliases and test classes remain outside scope; no automatic rename.
|
|
44
|
+
|
|
45
|
+
- Optional SMT330 (`rules: {package-only-dunder-all: error}`) restricts module
|
|
46
|
+
`__all__` declarations to package `__init__.py` files. Package overrides and
|
|
47
|
+
reasoned suppressions retain deliberate compatibility exports; no automatic move.
|
|
48
|
+
|
|
49
|
+
- Optional SMT431 (`rules: {nondeterministic-test-data: warning}`) reviews known
|
|
50
|
+
random/UUID data generators in tests and fixtures. Prefer fixed test inputs or
|
|
51
|
+
seeded local generators; intentional randomness tests can retain reasoned
|
|
52
|
+
suppressions. Production generators are unaffected; no automatic rewrite.
|
|
53
|
+
|
|
54
|
+
- SMT108 now reviews mixed package-facade and implementation imports with
|
|
55
|
+
`bundle_imports_at: 2`, includes missing export proposals and blocks bundling
|
|
56
|
+
advice when proposed caller/facade edges close a known runtime import cycle.
|
|
57
|
+
|
|
58
|
+
- Debt baselines now write grouped JSON version 2: repeated rule/path/message
|
|
59
|
+
metadata appears once, while every accepted fingerprint and duplicate occurrence
|
|
60
|
+
remains available for matching. Version-1 files remain readable; `smelt debt
|
|
61
|
+
--prune` upgrades assessed entries without accepting new debt. Use `smelt debt
|
|
62
|
+
--show [PATHS]` for a compact, read-only baseline summary, or add `--format json`
|
|
63
|
+
for the grouped data. [SMT321](docs/rules/SMT321.md) now distinguishes enclosing
|
|
64
|
+
functions in debt and changed checks, so fixing one function cannot silently
|
|
65
|
+
accept an identical new violation in another. Old unscoped SMT321 debt requires
|
|
66
|
+
review and explicit re-recording. See [adoption](docs/adoption.md).
|
|
67
|
+
|
|
68
|
+
- Package contracts now support `module_docstrings: require`, activating
|
|
69
|
+
[SMT325](docs/rules/SMT325.md) `missing-module-docstring` for every analyzed
|
|
70
|
+
production module, including empty package initializers. Empty/blank docstrings
|
|
71
|
+
do not satisfy the requirement. Choose `forbid` for the existing
|
|
72
|
+
[SMT309](docs/rules/SMT309.md) convention; use a reasoned file suppression or an
|
|
73
|
+
explicit nested `allow` policy for exceptions. Defaults remain unchanged.
|
|
74
|
+
|
|
75
|
+
- Optional [SMT324](docs/rules/SMT324.md), enabled with
|
|
76
|
+
`rules: {prefer-str-enum-discriminator: hint}`, reviews single-string `Literal`
|
|
77
|
+
fields named `type`, `kind` or `tag` for shared `StrEnum` members. Keep narrow
|
|
78
|
+
`Literal[EventType.MEMBER]` annotations and matching enum defaults. This syntax
|
|
79
|
+
review does not prove union membership or rewrite code; Python targets before
|
|
80
|
+
3.11 and general multi-value Literals remain unchanged.
|
|
81
|
+
|
|
82
|
+
## [0.4.0] - 2026-11-01
|
|
83
|
+
|
|
84
|
+
Report schema 2, YAML version 1 and the default rule set remain unchanged.
|
|
85
|
+
Custom rules must update `BaseRule` imports to `Rule` and annotations for the
|
|
86
|
+
former `Rule` protocol to `RuleContract`. Update installation, hook and CI pins
|
|
87
|
+
together to `0.4.0` (`v0.4.0`) and refresh the editor schema. See the
|
|
88
|
+
[upgrade checklist](docs/upgrading.md#030-to-040).
|
|
89
|
+
|
|
90
|
+
- Use `.yml` consistently in configuration examples, fixtures and maintainer
|
|
91
|
+
scripts. `smelt init` now creates `smelt.yml`, which takes precedence when both
|
|
92
|
+
supported filenames exist. Existing `smelt.yaml` files still work. The published
|
|
93
|
+
`.pre-commit-hooks.yaml` manifest retains its required filename. Integration
|
|
94
|
+
instructions consistently use prek.
|
|
95
|
+
|
|
96
|
+
- Optional [SMT323](docs/rules/SMT323.md), enabled with
|
|
97
|
+
`rules: {no-base-class-prefix: error}`, rejects class definitions such as
|
|
98
|
+
`BaseRepository` and `_BaseRepository` in favor of responsibility-based names.
|
|
99
|
+
Imports, third-party inheritance, `Baseline` and `Base64` remain valid. Package
|
|
100
|
+
rule overrides can disable the convention; checks never rename symbols.
|
|
101
|
+
Smelt enables the convention for its own sources; the default set is unchanged.
|
|
102
|
+
- Smelt also enables the opt-in `deep-object-navigation` Law of Demeter review
|
|
103
|
+
for its own sources. Facade analysis receives its file inventory directly,
|
|
104
|
+
and filesystem/Python-target analysis receives its source store explicitly.
|
|
105
|
+
SMT322 recognizes statically evidenced module/data namespaces and known value
|
|
106
|
+
APIs, preserving unknown collaborator findings. Changes to imported record
|
|
107
|
+
definitions are considered on every check; no code is executed or rewritten.
|
|
108
|
+
Unproven namespaces remain advisory review candidates, with known receiver
|
|
109
|
+
types and the unresolved step included for agent API-contract review. A finding
|
|
110
|
+
alone does not require an architecture change.
|
|
111
|
+
- Rule implementations now inherit `smelt.rules.base.Rule` instead of `BaseRule`.
|
|
112
|
+
The former structural `Rule` protocol is named `RuleContract`; lazy rule
|
|
113
|
+
implementations retain the same interface. Update custom rule imports and
|
|
114
|
+
type annotations accordingly.
|
|
115
|
+
- Independent workspaces can share a local policy fragment with `extends` and
|
|
116
|
+
explicit child overrides. Mappings merge; lists replace, including `[]`.
|
|
117
|
+
Project paths remain relative to the selected workspace. `config show --sources`
|
|
118
|
+
explains effective inputs and origins; staged checks and cache dependencies
|
|
119
|
+
include all bases. Both published hooks now run on every commit, including
|
|
120
|
+
policy-only edits. See [shared configuration](docs/configuration.md#shared-local-policy).
|
|
121
|
+
|
|
122
|
+
- New opt-in [SMT322](docs/rules/SMT322.md) `deep-object-navigation` reviews
|
|
123
|
+
method calls reached through multiple stored instance attributes, such as
|
|
124
|
+
`self.browser.input.motor().aim()`. Enable with
|
|
125
|
+
`rules: {deep-object-navigation: hint}` or `--select SMT322`; package rule
|
|
126
|
+
overrides and inline suppressions preserve intentional navigation. Direct
|
|
127
|
+
collaborator calls, pure data reads and direct-collaborator fluent chains
|
|
128
|
+
remain quiet. This bounded syntax review has no automatic rewrite.
|
|
129
|
+
- [SMT901](docs/rules/SMT901.md) diagnoses unknown inline suppression identifiers,
|
|
130
|
+
including readable rule names where stable SMT codes are required. Known
|
|
131
|
+
inactive rules retain their narrowed-check behavior.
|
|
132
|
+
- [SMT426](docs/rules/SMT426.md) groups shared-helper operations by one repair in
|
|
133
|
+
text and adds deterministic `shared_helper` JSON groups. Individual findings,
|
|
134
|
+
identities, counts, suppressions and debt remain unchanged. [SMT424](docs/rules/SMT424.md)
|
|
135
|
+
explains known helper inference limits at the affected call sites.
|
|
136
|
+
- [SMT104](docs/rules/SMT104.md) adds the opt-in `cycles: [modules]` scope and
|
|
137
|
+
independent `type_checking_cycles: ignore`. Existing scopes are explicitly
|
|
138
|
+
labeled as aggregated; witnesses include edge phases. Default scopes stay unchanged.
|
|
139
|
+
- [SMT109](docs/rules/SMT109.md) accepts optional, statically verified
|
|
140
|
+
`structure.canonical_exports` ownership and distinguishes same-root/other-root
|
|
141
|
+
importers. Existing exports inform the review; frequency alone never expands API.
|
|
142
|
+
- Literal lazy-export tables with a matching guarded `import_module`/`getattr`
|
|
143
|
+
forwarder now contribute export identity and visibility evidence. Unsupported
|
|
144
|
+
dynamic handlers, escaped/mutated tables and type stubs alone remain unverified.
|
|
145
|
+
- [SMT313](docs/rules/SMT313.md) permits bounded ordering fixes around unrelated
|
|
146
|
+
nested-function dictionaries and `nonlocal` closure writes. Reflection on
|
|
147
|
+
unknown receivers or ordered namespaces retains its manual-review barrier.
|
|
148
|
+
|
|
149
|
+
- New opt-in [SMT321](docs/rules/SMT321.md) `implicit-optional-default`
|
|
150
|
+
reviews `parameter or fallback` for explicitly optional parameters with a
|
|
151
|
+
`None` default. Enable with `rules: {implicit-optional-default: warning}` or
|
|
152
|
+
`--select SMT321`. Use `--fix --unsafe-fixes` to replace it with an explicit
|
|
153
|
+
`is not None` conditional after reviewing intentional falsy defaults. Plain
|
|
154
|
+
`--fix` preserves existing truthiness behavior.
|
|
155
|
+
|
|
10
156
|
## [0.3.0] - 2026-11-01
|
|
11
157
|
|
|
12
158
|
### Upgrade first
|
|
@@ -424,7 +570,9 @@ smelt explain SMT313 --format json
|
|
|
424
570
|
- Import fanout, match suggestions and missing-assertion checks are review aids;
|
|
425
571
|
their default severities differ. Configure policy and severity deliberately.
|
|
426
572
|
|
|
427
|
-
[Unreleased]: https://github.com/mathisarends/smelt/compare/v0.
|
|
573
|
+
[Unreleased]: https://github.com/mathisarends/smelt/compare/v0.5.0...HEAD
|
|
574
|
+
[0.5.0]: https://github.com/mathisarends/smelt/compare/v0.4.0...v0.5.0
|
|
575
|
+
[0.4.0]: https://github.com/mathisarends/smelt/compare/v0.3.0...v0.4.0
|
|
428
576
|
[0.3.0]: https://github.com/mathisarends/smelt/compare/v0.2.0...v0.3.0
|
|
429
577
|
[0.2.0]: https://github.com/mathisarends/smelt/compare/v0.1.6...v0.2.0
|
|
430
578
|
[0.1.6]: https://github.com/mathisarends/smelt/compare/v0.1.5...v0.1.6
|
|
@@ -62,7 +62,9 @@ new findings against HEAD. Do not record debt or disable rules to adopt a change
|
|
|
62
62
|
Prefer private helpers and test public behavior. A direct unit test of a parser,
|
|
63
63
|
rewriter or cache invalidation boundary can use a local `SMT420` exception with a
|
|
64
64
|
specific reason; in multiline imports put it on the imported name. Entry points
|
|
65
|
-
used by excluded maintainer scripts
|
|
65
|
+
used by excluded maintainer scripts retain a specific visibility suppression
|
|
66
|
+
naming the actual consumer. Keep `__all__` declarations in package `__init__.py`
|
|
67
|
+
files; do not add module export lists merely to silence visibility reviews.
|
|
66
68
|
|
|
67
69
|
The checker selects rules through generated `smelt/rules/catalog.json` metadata
|
|
68
70
|
and imports implementations only when needed. Register implementation paths in
|
|
@@ -95,7 +97,7 @@ Normal checks stay read-only. A new rule does not need a fixer or a new index.
|
|
|
95
97
|
|
|
96
98
|
## One rule, one catalog entry
|
|
97
99
|
|
|
98
|
-
New
|
|
100
|
+
New Rule subclasses are off by default. Choose activation alongside the rule:
|
|
99
101
|
|
|
100
102
|
Fixed-pattern source/test reviews are selected directly by a problem name in
|
|
101
103
|
`rules`; do not add `review_*`, `require_*` or other duplicate boolean switches.
|
|
@@ -122,7 +124,7 @@ also activate opt-in rules, while explicit off/ignore and strict coverage retain
|
|
|
122
124
|
their precedence. The generated catalog and CLI metadata derive activation from
|
|
123
125
|
the rule class; there is no second registration list of activation decisions.
|
|
124
126
|
|
|
125
|
-
Use `
|
|
127
|
+
Use `Rule`, a stable code, a unique kebab-case name, a category, explicit
|
|
126
128
|
`requires` and a complete `RuleDoc`. Allocate an unused code from the live catalog:
|
|
127
129
|
|
|
128
130
|
| Range | Category |
|
|
@@ -173,6 +175,17 @@ metadata, and generated-file freshness. Duplicate codes or names also fail when
|
|
|
173
175
|
|
|
174
176
|
## Regressions from real projects
|
|
175
177
|
|
|
178
|
+
TODO comments must reference the issue or ticket that explains the unfinished
|
|
179
|
+
work. Ruff TD003 checks this convention in local checks and CI. For example:
|
|
180
|
+
|
|
181
|
+
```python
|
|
182
|
+
# TODO: support the additional layout after the policy is specified.
|
|
183
|
+
# https://github.com/mathisarends/smelt/issues/66
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
Use an actual issue for the work being deferred. This policy permits tracked
|
|
187
|
+
TODOs; it does not ban them or add a duplicate Smelt diagnostic.
|
|
188
|
+
|
|
176
189
|
Reduce the example to synthetic files using `tests.helpers.write_project`, or a
|
|
177
190
|
small layout under `tests/fixtures/`. Keep the behavior that exposed the defect,
|
|
178
191
|
including workspace roots or namespace portions when relevant. Tests must run
|
|
@@ -257,20 +270,20 @@ environment name must match the workflow exactly.
|
|
|
257
270
|
### Release procedure
|
|
258
271
|
|
|
259
272
|
1. Review changes since the last tag. Update the [upgrade guide](docs/upgrading.md),
|
|
260
|
-
README
|
|
273
|
+
README examples and pinned hook/CI examples in
|
|
261
274
|
[integrations](docs/integrations.md), including any report-format migration.
|
|
262
275
|
Move `Unreleased` entries to a dated version section and update the changelog's
|
|
263
276
|
comparison links. Bump matching versions in `pyproject.toml` and `Cargo.toml`,
|
|
264
277
|
run `uv lock` and `cargo check` to refresh both lockfiles, and merge the release
|
|
265
278
|
preparation into `main` after CI passes. Each release needs a new PyPI version.
|
|
266
279
|
2. From an up-to-date, clean `main` checkout, create and push the corresponding tag.
|
|
267
|
-
For example, after merging version `0.
|
|
280
|
+
For example, after merging version `0.5.0`:
|
|
268
281
|
|
|
269
282
|
```bash
|
|
270
283
|
git switch main
|
|
271
284
|
git pull --ff-only
|
|
272
|
-
git tag v0.
|
|
273
|
-
git push origin v0.
|
|
285
|
+
git tag v0.5.0
|
|
286
|
+
git push origin v0.5.0
|
|
274
287
|
```
|
|
275
288
|
|
|
276
289
|
3. Follow the `Publish to PyPI` run in
|
|
@@ -288,7 +301,7 @@ environment name must match the workflow exactly.
|
|
|
288
301
|
Maintainers and coding agents with permission to push release tags can use this
|
|
289
302
|
procedure without local PyPI credentials. Ordinary branch pushes and pull requests
|
|
290
303
|
do not publish. Manual workflow runs must select an existing `v`-prefixed tag
|
|
291
|
-
(`gh workflow run release.yml --ref v0.
|
|
304
|
+
(`gh workflow run release.yml --ref v0.5.0`); branch runs skip publishing.
|
|
292
305
|
|
|
293
306
|
If the upload fails because account configuration is missing, finish that setup
|
|
294
307
|
and rerun the failed publishing job so it reuses the validated build artifacts.
|
smelt_cli-0.5.0/PKG-INFO
ADDED
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: smelt-cli
|
|
3
|
+
Version: 0.5.0
|
|
4
|
+
Requires-Dist: grimp>=3.17
|
|
5
|
+
Requires-Dist: packaging>=24.2
|
|
6
|
+
Requires-Dist: pydantic>=2.13.5
|
|
7
|
+
Requires-Dist: pyyaml>=6.0.3
|
|
8
|
+
Summary: Static guardrails for Python codebases maintained by humans and coding agents.
|
|
9
|
+
Author-email: Mathis Arends <mathisarends27@gmail.com>
|
|
10
|
+
Requires-Python: >=3.12
|
|
11
|
+
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
|
|
12
|
+
Project-URL: Documentation, https://github.com/mathisarends/smelt#readme
|
|
13
|
+
Project-URL: Issues, https://github.com/mathisarends/smelt/issues
|
|
14
|
+
Project-URL: Repository, https://github.com/mathisarends/smelt
|
|
15
|
+
|
|
16
|
+
# smelt
|
|
17
|
+
|
|
18
|
+
**A linter for Python architecture boundaries and code smells.**
|
|
19
|
+
|
|
20
|
+
If the same feedback keeps coming up in code review, make it a rule. Smelt puts
|
|
21
|
+
those decisions in `smelt.yml`, where coding agents can read them, check their
|
|
22
|
+
changes and fix findings before opening a PR. Commit hooks and CI enforce the
|
|
23
|
+
same policy.
|
|
24
|
+
|
|
25
|
+
Keep database imports out of application code. Keep package internals behind
|
|
26
|
+
their public API. Catch truthiness fallbacks that discard valid values, or tests
|
|
27
|
+
that wait without a timeout. Choose the checks that match your project from the
|
|
28
|
+
[rule catalog](docs/rules/README.md), or [add a rule](CONTRIBUTING.md) for a
|
|
29
|
+
recurring pattern.
|
|
30
|
+
|
|
31
|
+
## Get started
|
|
32
|
+
|
|
33
|
+
Requires Python 3.12+. Install **`smelt-cli`** from PyPI:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
uv tool install smelt-cli
|
|
37
|
+
smelt init --maintainability
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Review the generated `smelt.yml`: it proposes a starting policy from your layout
|
|
41
|
+
and selects source and test checks. You decide which conventions to adopt.
|
|
42
|
+
Small libraries can use individual rules without declaring layers or features.
|
|
43
|
+
|
|
44
|
+
## Turn review feedback into policy
|
|
45
|
+
|
|
46
|
+
For a project with `src/app/` and `tests/`, this policy encodes two recurring
|
|
47
|
+
review comments: application code must not depend on infrastructure, and optional
|
|
48
|
+
defaults should distinguish `None` from valid falsy values.
|
|
49
|
+
|
|
50
|
+
```yaml
|
|
51
|
+
# smelt.yml
|
|
52
|
+
version: 1
|
|
53
|
+
|
|
54
|
+
project:
|
|
55
|
+
root_packages: [app]
|
|
56
|
+
source_roots: [src]
|
|
57
|
+
test_roots: [tests]
|
|
58
|
+
|
|
59
|
+
architecture:
|
|
60
|
+
layers:
|
|
61
|
+
domain: {path: domain, may_depend_on: []}
|
|
62
|
+
application: {path: application, may_depend_on: [domain]}
|
|
63
|
+
infrastructure: {path: infrastructure, may_depend_on: [domain, application]}
|
|
64
|
+
|
|
65
|
+
rules:
|
|
66
|
+
implicit-optional-default: warning
|
|
67
|
+
unbounded-test-wait: warning
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Smelt catches an import that crosses the declared boundary:
|
|
71
|
+
|
|
72
|
+
```python
|
|
73
|
+
# src/app/application/orders.py
|
|
74
|
+
from app.infrastructure.database import SqlOrderRepository # SMT101
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Application code should depend on an interface in an allowed layer; wire the
|
|
78
|
+
concrete repository in your composition root. Smelt also flags this fallback:
|
|
79
|
+
|
|
80
|
+
```python
|
|
81
|
+
def page_size(limit: int | None = None) -> int:
|
|
82
|
+
return limit or 100 # SMT321: also replaces an explicit 0
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
If only `None` means "not supplied", use
|
|
86
|
+
`limit if limit is not None else 100`. If treating zero as missing is deliberate,
|
|
87
|
+
keep it with a reasoned exception.
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
smelt check --show-hints --fail-on warning
|
|
91
|
+
smelt explain SMT101 # why it fired and how to fix it
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
The same configuration can describe [feature boundaries and third-party dependencies](docs/architecture.md),
|
|
95
|
+
[package APIs and source conventions](docs/structure.md), and
|
|
96
|
+
[test conventions](docs/testing.md). Most checks require explicit selection or
|
|
97
|
+
an applicable policy; see [rule activation](docs/rule-selection.md).
|
|
98
|
+
|
|
99
|
+
## Catch it at commit time
|
|
100
|
+
|
|
101
|
+
Smelt uses the pre-commit hook format. With [prek](https://prek.j178.dev/installation/),
|
|
102
|
+
add this to `.pre-commit-config.yml`:
|
|
103
|
+
|
|
104
|
+
```yaml
|
|
105
|
+
repos:
|
|
106
|
+
- repo: local
|
|
107
|
+
hooks:
|
|
108
|
+
- id: smelt-staged
|
|
109
|
+
name: smelt
|
|
110
|
+
entry: smelt check --staged --fail-on warning
|
|
111
|
+
language: python
|
|
112
|
+
additional_dependencies: [smelt-cli==0.5.0]
|
|
113
|
+
pass_filenames: false
|
|
114
|
+
always_run: true
|
|
115
|
+
require_serial: true
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
prek install
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
The hook installs a pinned wheel in its own environment and checks the Git index,
|
|
123
|
+
including partial staging, deletions and policy changes. New warnings and errors
|
|
124
|
+
block the commit. The agent gets a finding, fixes it, stages the change and retries.
|
|
125
|
+
Existing pre-commit setups can use the same configuration.
|
|
126
|
+
|
|
127
|
+
Use `smelt check --fail-on warning` in CI for the full project check. See
|
|
128
|
+
[integrations](docs/integrations.md) for GitHub Actions, source hooks and other
|
|
129
|
+
installation options. `prek run --all-files` runs the hook too, but the staged
|
|
130
|
+
hook still checks the index; use `smelt check` to review the working tree.
|
|
131
|
+
|
|
132
|
+
## Give agents a short feedback loop
|
|
133
|
+
|
|
134
|
+
Add this to your `AGENTS.md` or `CLAUDE.md`:
|
|
135
|
+
|
|
136
|
+
```md
|
|
137
|
+
Before editing, run `smelt context <feature-or-path>` to read the applicable policy.
|
|
138
|
+
After editing, run `smelt check --changed --format json` and address new findings.
|
|
139
|
+
Use `smelt explain <code>` for the rule's intent and repair advice.
|
|
140
|
+
Run focused tests, stage your changes, then run `prek run --all-files`.
|
|
141
|
+
Inspect and stage any hook fixes, and rerun until the checks pass.
|
|
142
|
+
Do not disable rules or record debt just to pass a check.
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
Findings include locations, evidence and repair advice. Changed checks compare
|
|
146
|
+
with `HEAD` by default; use `--changed --base origin/main` to review a branch.
|
|
147
|
+
For an existing codebase, [debt baselines](docs/adoption.md) let you adopt a policy
|
|
148
|
+
without requiring every old finding to be fixed in the first PR.
|
|
149
|
+
|
|
150
|
+
### Fast enough to run between edits
|
|
151
|
+
|
|
152
|
+
Local checks reuse a worker and cache analysis by content. Staged checks read Git
|
|
153
|
+
objects directly, including partially staged files, and reuse unchanged results.
|
|
154
|
+
An edit still checks its effects on other modules.
|
|
155
|
+
|
|
156
|
+
One documented benchmark used 250 modules with 12 methods each on Windows 11 /
|
|
157
|
+
Python 3.14. Warm medians, including process startup:
|
|
158
|
+
|
|
159
|
+
| Check | Unchanged retry | After a Python edit |
|
|
160
|
+
| --- | ---: | ---: |
|
|
161
|
+
| Staged CLI, transitive imports + member checks | 49 ms | 380 ms |
|
|
162
|
+
| Complete prek hook, member checks | 227 ms | 612 ms |
|
|
163
|
+
|
|
164
|
+
These are measured examples, not a latency guarantee. The first cache build took
|
|
165
|
+
about 2.6–3.9 seconds in that run; installation and other hooks are excluded.
|
|
166
|
+
See the [setup, raw samples and reproduction commands](docs/agent-workflow.md#native-git-retained-worker-state-and-bounded-failure-handling)
|
|
167
|
+
for the exact policies and timings.
|
|
168
|
+
|
|
169
|
+
## Learn more
|
|
170
|
+
|
|
171
|
+
- [Configuration](docs/configuration.md) and [rule catalog](docs/rules/README.md)
|
|
172
|
+
- [Upgrading](docs/upgrading.md) and [changelog](CHANGELOG.md)
|
|
173
|
+
- [Documentation index](docs/README.md) and [contributing](CONTRIBUTING.md)
|
|
174
|
+
|
|
175
|
+
Smelt analyzes Python source statically. Use it alongside tests, a type checker
|
|
176
|
+
and Ruff; advisory findings still need review. See [scope and limits](docs/vision.md).
|
|
177
|
+
Run Smelt with a Python version that can parse your code. Release wheels include
|
|
178
|
+
the native client; building from source requires Rust 1.88+ and a platform linker.
|
|
179
|
+
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
# smelt
|
|
2
|
+
|
|
3
|
+
**A linter for Python architecture boundaries and code smells.**
|
|
4
|
+
|
|
5
|
+
If the same feedback keeps coming up in code review, make it a rule. Smelt puts
|
|
6
|
+
those decisions in `smelt.yml`, where coding agents can read them, check their
|
|
7
|
+
changes and fix findings before opening a PR. Commit hooks and CI enforce the
|
|
8
|
+
same policy.
|
|
9
|
+
|
|
10
|
+
Keep database imports out of application code. Keep package internals behind
|
|
11
|
+
their public API. Catch truthiness fallbacks that discard valid values, or tests
|
|
12
|
+
that wait without a timeout. Choose the checks that match your project from the
|
|
13
|
+
[rule catalog](docs/rules/README.md), or [add a rule](CONTRIBUTING.md) for a
|
|
14
|
+
recurring pattern.
|
|
15
|
+
|
|
16
|
+
## Get started
|
|
17
|
+
|
|
18
|
+
Requires Python 3.12+. Install **`smelt-cli`** from PyPI:
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
uv tool install smelt-cli
|
|
22
|
+
smelt init --maintainability
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Review the generated `smelt.yml`: it proposes a starting policy from your layout
|
|
26
|
+
and selects source and test checks. You decide which conventions to adopt.
|
|
27
|
+
Small libraries can use individual rules without declaring layers or features.
|
|
28
|
+
|
|
29
|
+
## Turn review feedback into policy
|
|
30
|
+
|
|
31
|
+
For a project with `src/app/` and `tests/`, this policy encodes two recurring
|
|
32
|
+
review comments: application code must not depend on infrastructure, and optional
|
|
33
|
+
defaults should distinguish `None` from valid falsy values.
|
|
34
|
+
|
|
35
|
+
```yaml
|
|
36
|
+
# smelt.yml
|
|
37
|
+
version: 1
|
|
38
|
+
|
|
39
|
+
project:
|
|
40
|
+
root_packages: [app]
|
|
41
|
+
source_roots: [src]
|
|
42
|
+
test_roots: [tests]
|
|
43
|
+
|
|
44
|
+
architecture:
|
|
45
|
+
layers:
|
|
46
|
+
domain: {path: domain, may_depend_on: []}
|
|
47
|
+
application: {path: application, may_depend_on: [domain]}
|
|
48
|
+
infrastructure: {path: infrastructure, may_depend_on: [domain, application]}
|
|
49
|
+
|
|
50
|
+
rules:
|
|
51
|
+
implicit-optional-default: warning
|
|
52
|
+
unbounded-test-wait: warning
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Smelt catches an import that crosses the declared boundary:
|
|
56
|
+
|
|
57
|
+
```python
|
|
58
|
+
# src/app/application/orders.py
|
|
59
|
+
from app.infrastructure.database import SqlOrderRepository # SMT101
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Application code should depend on an interface in an allowed layer; wire the
|
|
63
|
+
concrete repository in your composition root. Smelt also flags this fallback:
|
|
64
|
+
|
|
65
|
+
```python
|
|
66
|
+
def page_size(limit: int | None = None) -> int:
|
|
67
|
+
return limit or 100 # SMT321: also replaces an explicit 0
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
If only `None` means "not supplied", use
|
|
71
|
+
`limit if limit is not None else 100`. If treating zero as missing is deliberate,
|
|
72
|
+
keep it with a reasoned exception.
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
smelt check --show-hints --fail-on warning
|
|
76
|
+
smelt explain SMT101 # why it fired and how to fix it
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
The same configuration can describe [feature boundaries and third-party dependencies](docs/architecture.md),
|
|
80
|
+
[package APIs and source conventions](docs/structure.md), and
|
|
81
|
+
[test conventions](docs/testing.md). Most checks require explicit selection or
|
|
82
|
+
an applicable policy; see [rule activation](docs/rule-selection.md).
|
|
83
|
+
|
|
84
|
+
## Catch it at commit time
|
|
85
|
+
|
|
86
|
+
Smelt uses the pre-commit hook format. With [prek](https://prek.j178.dev/installation/),
|
|
87
|
+
add this to `.pre-commit-config.yml`:
|
|
88
|
+
|
|
89
|
+
```yaml
|
|
90
|
+
repos:
|
|
91
|
+
- repo: local
|
|
92
|
+
hooks:
|
|
93
|
+
- id: smelt-staged
|
|
94
|
+
name: smelt
|
|
95
|
+
entry: smelt check --staged --fail-on warning
|
|
96
|
+
language: python
|
|
97
|
+
additional_dependencies: [smelt-cli==0.5.0]
|
|
98
|
+
pass_filenames: false
|
|
99
|
+
always_run: true
|
|
100
|
+
require_serial: true
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
prek install
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
The hook installs a pinned wheel in its own environment and checks the Git index,
|
|
108
|
+
including partial staging, deletions and policy changes. New warnings and errors
|
|
109
|
+
block the commit. The agent gets a finding, fixes it, stages the change and retries.
|
|
110
|
+
Existing pre-commit setups can use the same configuration.
|
|
111
|
+
|
|
112
|
+
Use `smelt check --fail-on warning` in CI for the full project check. See
|
|
113
|
+
[integrations](docs/integrations.md) for GitHub Actions, source hooks and other
|
|
114
|
+
installation options. `prek run --all-files` runs the hook too, but the staged
|
|
115
|
+
hook still checks the index; use `smelt check` to review the working tree.
|
|
116
|
+
|
|
117
|
+
## Give agents a short feedback loop
|
|
118
|
+
|
|
119
|
+
Add this to your `AGENTS.md` or `CLAUDE.md`:
|
|
120
|
+
|
|
121
|
+
```md
|
|
122
|
+
Before editing, run `smelt context <feature-or-path>` to read the applicable policy.
|
|
123
|
+
After editing, run `smelt check --changed --format json` and address new findings.
|
|
124
|
+
Use `smelt explain <code>` for the rule's intent and repair advice.
|
|
125
|
+
Run focused tests, stage your changes, then run `prek run --all-files`.
|
|
126
|
+
Inspect and stage any hook fixes, and rerun until the checks pass.
|
|
127
|
+
Do not disable rules or record debt just to pass a check.
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
Findings include locations, evidence and repair advice. Changed checks compare
|
|
131
|
+
with `HEAD` by default; use `--changed --base origin/main` to review a branch.
|
|
132
|
+
For an existing codebase, [debt baselines](docs/adoption.md) let you adopt a policy
|
|
133
|
+
without requiring every old finding to be fixed in the first PR.
|
|
134
|
+
|
|
135
|
+
### Fast enough to run between edits
|
|
136
|
+
|
|
137
|
+
Local checks reuse a worker and cache analysis by content. Staged checks read Git
|
|
138
|
+
objects directly, including partially staged files, and reuse unchanged results.
|
|
139
|
+
An edit still checks its effects on other modules.
|
|
140
|
+
|
|
141
|
+
One documented benchmark used 250 modules with 12 methods each on Windows 11 /
|
|
142
|
+
Python 3.14. Warm medians, including process startup:
|
|
143
|
+
|
|
144
|
+
| Check | Unchanged retry | After a Python edit |
|
|
145
|
+
| --- | ---: | ---: |
|
|
146
|
+
| Staged CLI, transitive imports + member checks | 49 ms | 380 ms |
|
|
147
|
+
| Complete prek hook, member checks | 227 ms | 612 ms |
|
|
148
|
+
|
|
149
|
+
These are measured examples, not a latency guarantee. The first cache build took
|
|
150
|
+
about 2.6–3.9 seconds in that run; installation and other hooks are excluded.
|
|
151
|
+
See the [setup, raw samples and reproduction commands](docs/agent-workflow.md#native-git-retained-worker-state-and-bounded-failure-handling)
|
|
152
|
+
for the exact policies and timings.
|
|
153
|
+
|
|
154
|
+
## Learn more
|
|
155
|
+
|
|
156
|
+
- [Configuration](docs/configuration.md) and [rule catalog](docs/rules/README.md)
|
|
157
|
+
- [Upgrading](docs/upgrading.md) and [changelog](CHANGELOG.md)
|
|
158
|
+
- [Documentation index](docs/README.md) and [contributing](CONTRIBUTING.md)
|
|
159
|
+
|
|
160
|
+
Smelt analyzes Python source statically. Use it alongside tests, a type checker
|
|
161
|
+
and Ruff; advisory findings still need review. See [scope and limits](docs/vision.md).
|
|
162
|
+
Run Smelt with a Python version that can parse your code. Release wheels include
|
|
163
|
+
the native client; building from source requires Rust 1.88+ and a platform linker.
|
|
@@ -13,7 +13,7 @@ guide for the decision or task at hand:
|
|
|
13
13
|
| Choose checks and understand what enables them | [Rule activation](rule-selection.md) and the [rule catalog](rules/README.md) |
|
|
14
14
|
| Interpret commands, changed checks and machine-readable reports | [CLI and reports](cli.md) |
|
|
15
15
|
| Introduce Smelt to an existing codebase | [Adoption and debt](adoption.md) |
|
|
16
|
-
| Set up an agent loop, prek
|
|
16
|
+
| Set up an agent loop, prek or CI | [Agents, hooks and CI](integrations.md) |
|
|
17
17
|
| Extend Smelt, run its checks or publish a release | [Contributing](../CONTRIBUTING.md) |
|
|
18
18
|
| Review staged agent changes, caching and performance | [Agent workflow](agent-workflow.md) |
|
|
19
19
|
| Understand project direction and known gaps | [Vision](vision.md) and [review backlog](review.md) |
|