sarj-python-lint 1.144.1__tar.gz → 1.146.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.
Files changed (348) hide show
  1. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/PKG-INFO +1 -1
  2. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/pyproject.toml +1 -1
  3. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/_rule_descriptors.py +28 -1
  4. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/_local_source.py +21 -0
  5. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/_opaque_contracts.py +2 -2
  6. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/_registry.py +6 -0
  7. sarj_python_lint-1.146.0/src/sarj_python_lint/rules/_sdk_metadata_fields.py +201 -0
  8. sarj_python_lint-1.146.0/src/sarj_python_lint/rules/no_generic_json_parser.py +264 -0
  9. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/no_invalid_pydantic_bypass.py +1 -1
  10. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/no_raw_connection_in_tests.py +104 -51
  11. sarj_python_lint-1.146.0/src/sarj_python_lint/rules/no_value_error_forwarder.py +135 -0
  12. sarj_python_lint-1.146.0/src/sarj_python_lint/rules/prefer_defaultdict.py +168 -0
  13. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/prefer_match_type_dispatch.py +162 -0
  14. sarj_python_lint-1.146.0/src/sarj_python_lint/rules/prefer_pydantic_field_bounds.py +243 -0
  15. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/prefer_pytest_dependency_fixtures.py +246 -14
  16. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/prefer_typed_mapping_get.py +159 -2
  17. sarj_python_lint-1.144.1/src/sarj_python_lint/rules/no_generic_json_parser.py +0 -147
  18. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/.gitignore +0 -0
  19. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/LICENSE +0 -0
  20. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/README.md +0 -0
  21. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/__init__.py +0 -0
  22. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/__main__.py +0 -0
  23. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/_analysis_session.py +0 -0
  24. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/_autofix.py +0 -0
  25. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/_autofix_aliases.py +0 -0
  26. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/_autofix_annotations.py +0 -0
  27. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/_autofix_comments.py +0 -0
  28. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/_autofix_declared_contracts.py +0 -0
  29. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/_autofix_declared_tests.py +0 -0
  30. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/_autofix_docs.py +0 -0
  31. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/_autofix_enums.py +0 -0
  32. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/_autofix_exhaustiveness.py +0 -0
  33. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/_autofix_inert.py +0 -0
  34. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/_autofix_parameters.py +0 -0
  35. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/_autofix_repeated.py +0 -0
  36. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/_autofix_security.py +0 -0
  37. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/_autofix_sql_projection.py +0 -0
  38. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/_autofix_tests.py +0 -0
  39. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/_closed_sql_literal.py +0 -0
  40. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/_file_context.py +0 -0
  41. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/_filesystem.py +0 -0
  42. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/_fixes.py +0 -0
  43. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/_parallel.py +0 -0
  44. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/_prepared_sources.py +0 -0
  45. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/_python_target.py +0 -0
  46. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/_ratchet_cli.py +0 -0
  47. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/_secret_names.py +0 -0
  48. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/_source.py +0 -0
  49. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/_version.py +0 -0
  50. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/application_logging.py +0 -0
  51. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/autofix.py +0 -0
  52. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/benchmark.py +0 -0
  53. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/cast_access.py +0 -0
  54. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/interpreter_argv.py +0 -0
  55. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/json_boundary.py +0 -0
  56. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/py.typed +0 -0
  57. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/ratchet.py +0 -0
  58. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rule_base.py +0 -0
  59. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rule_metadata.py +0 -0
  60. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/__init__.py +0 -0
  61. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/_annotation_origins.py +0 -0
  62. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/_annotation_semantics.py +0 -0
  63. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/_ast_index.py +0 -0
  64. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/_ast_names.py +0 -0
  65. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/_ast_position.py +0 -0
  66. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/_async_lifecycle.py +0 -0
  67. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/_binding_inventory.py +0 -0
  68. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/_closed_helpers.py +0 -0
  69. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/_comment_narration.py +0 -0
  70. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/_comments.py +0 -0
  71. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/_contract_annotation.py +0 -0
  72. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/_copy_on_write.py +0 -0
  73. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/_data_union_discriminator.py +0 -0
  74. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/_declared_contracts.py +0 -0
  75. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/_dict_key_views.py +0 -0
  76. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/_docstrings.py +0 -0
  77. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/_exports.py +0 -0
  78. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/_fastapi.py +0 -0
  79. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/_fastapi_access.py +0 -0
  80. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/_first_party.py +0 -0
  81. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/_fixed_record.py +0 -0
  82. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/_fixture_contracts.py +0 -0
  83. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/_generic_payload.py +0 -0
  84. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/_httpx_clients.py +0 -0
  85. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/_imports.py +0 -0
  86. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/_inert_model_annotation.py +0 -0
  87. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/_inherited_contract.py +0 -0
  88. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/_local_alias_fix.py +0 -0
  89. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/_logging.py +0 -0
  90. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/_loguru.py +0 -0
  91. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/_mapping_shape_callbacks.py +0 -0
  92. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/_namespace_access.py +0 -0
  93. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/_native_namespace_capability.py +0 -0
  94. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/_native_object_contracts.py +0 -0
  95. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/_nominal_project.py +0 -0
  96. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/_nullable_outcome.py +0 -0
  97. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/_numeric_proof.py +0 -0
  98. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/_paths.py +0 -0
  99. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/_postgres.py +0 -0
  100. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/_project_index.py +0 -0
  101. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/_prose_budget.py +0 -0
  102. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/_pydantic_field_contract.py +0 -0
  103. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/_pytest.py +0 -0
  104. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/_pytest_contract_parameters.py +0 -0
  105. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/_resolved_operation_signature.py +0 -0
  106. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/_resource_provenance.py +0 -0
  107. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/_route_shapes.py +0 -0
  108. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/_runtime_bindings.py +0 -0
  109. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/_runtime_names.py +0 -0
  110. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/_runtime_registry.py +0 -0
  111. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/_service_http_callbacks.py +0 -0
  112. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/_set_fields.py +0 -0
  113. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/_sql.py +0 -0
  114. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/_static_json_alias.py +0 -0
  115. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/_store_sql.py +0 -0
  116. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/_store_writes.py +0 -0
  117. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/_suppression_comments.py +0 -0
  118. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/_test_assertions.py +0 -0
  119. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/_test_composition.py +0 -0
  120. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/_test_provenance.py +0 -0
  121. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/_transactional_sql.py +0 -0
  122. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/_type_guard_symbols.py +0 -0
  123. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/_value_models.py +0 -0
  124. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/async_cleanup_registered_synchronously.py +0 -0
  125. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/async_executor_shutdown.py +0 -0
  126. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/async_mock_call_without_await_assertion.py +0 -0
  127. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/async_subprocess_cancellation_cleanup.py +0 -0
  128. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/cancel_owned_task_without_join.py +0 -0
  129. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/complex_postgres_query_requires_architecture_review.py +0 -0
  130. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/defect_xfail_requires_explicit_strict.py +0 -0
  131. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/delete_route_returns_no_content.py +0 -0
  132. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/docstring_args_restate_signature.py +0 -0
  133. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/docstring_returns_restate_signature.py +0 -0
  134. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/duplicate_adjacent_exception_handler.py +0 -0
  135. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/duplicate_closed_pure_helper.py +0 -0
  136. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/duplicate_pytest_fixture_params.py +0 -0
  137. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/excessive_commentary.py +0 -0
  138. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/failed_probe_zero_threshold.py +0 -0
  139. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/fakes_in_shared_location.py +0 -0
  140. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/fastapi_class_router_contract.py +0 -0
  141. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/fastapi_explicit_openapi_contract.py +0 -0
  142. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/fastapi_route_declares_security.py +0 -0
  143. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/iac_source_coupled_test.py +0 -0
  144. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/invalid_pydantic_field_default.py +0 -0
  145. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/mock_without_spec.py +0 -0
  146. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/named_record_at_boundaries.py +0 -0
  147. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/nan_hidden_by_builtin_min.py +0 -0
  148. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/negative_only_http_status_assertion.py +0 -0
  149. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/no_analytical_aggregation_in_postgres_store.py +0 -0
  150. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/no_any_mapping_types.py +0 -0
  151. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/no_async_client_in_constructor.py +0 -0
  152. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/no_async_function_cache.py +0 -0
  153. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/no_before_validator_input_mutation.py +0 -0
  154. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/no_blanket_suppression.py +0 -0
  155. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/no_broad_keyword_capture.py +0 -0
  156. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/no_comment_cruft.py +0 -0
  157. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/no_conflicting_pydantic_alias_validation.py +0 -0
  158. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/no_conftest_test_module_import.py +0 -0
  159. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/no_contradictory_type_guard.py +0 -0
  160. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/no_copied_inherited_docstring.py +0 -0
  161. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/no_cors_wildcard_with_credentials.py +0 -0
  162. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/no_create_verb_in_post_path.py +0 -0
  163. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/no_custom_control_flow_exception.py +0 -0
  164. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/no_database_programmability.py +0 -0
  165. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/no_defaulted_environment_setting.py +0 -0
  166. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/no_delete_statement.py +0 -0
  167. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/no_discarded_tagged_outcome.py +0 -0
  168. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/no_discarded_validation_result.py +0 -0
  169. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/no_dual_shape_model_field_reader.py +0 -0
  170. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/no_dunder_all.py +0 -0
  171. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/no_duplicate_dunder_all_entry.py +0 -0
  172. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/no_duplicate_field_validator_body.py +0 -0
  173. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/no_dynamic_builtins.py +0 -0
  174. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/no_exception_text_in_500_detail.py +0 -0
  175. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/no_excessive_cognitive_complexity.py +0 -0
  176. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/no_fastapi_on_event.py +0 -0
  177. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/no_file_level_escape_hatch_suppression.py +0 -0
  178. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/no_first_party_private_import.py +0 -0
  179. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/no_fixed_sleep_before_assert.py +0 -0
  180. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/no_fixed_sleep_in_loop.py +0 -0
  181. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/no_folded_bad_request_not_found.py +0 -0
  182. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/no_frozen_after_validator_field_write.py +0 -0
  183. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/no_generic_single_export_module.py +0 -0
  184. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/no_hasattr.py +0 -0
  185. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/no_hidden_constructor_fallback.py +0 -0
  186. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/no_impossible_pydantic_field_bounds.py +0 -0
  187. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/no_injected_module_loader.py +0 -0
  188. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/no_input_model_mutation.py +0 -0
  189. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/no_interpreter_source_arguments.py +0 -0
  190. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/no_invalid_argument_name_suppression.py +0 -0
  191. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/no_invalid_pydantic_validator_return.py +0 -0
  192. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/no_loguru_exc_info.py +0 -0
  193. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/no_loguru_printf_format.py +0 -0
  194. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/no_magic_arithmetic.py +0 -0
  195. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/no_mocked_pydantic_value_object.py +0 -0
  196. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/no_mutating_container_transform.py +0 -0
  197. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/no_mutating_input_with_result.py +0 -0
  198. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/no_nested_pydantic_field_validator.py +0 -0
  199. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/no_nonlocal_statement.py +0 -0
  200. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/no_nullable_dependency_fallback.py +0 -0
  201. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/no_offset_pagination.py +0 -0
  202. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/no_partial_type_is.py +0 -0
  203. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/no_positional_psycopg_row_escape.py +0 -0
  204. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/no_psycopg_execution_in_loop.py +0 -0
  205. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/no_psycopg_execution_outside_injected_owner.py +0 -0
  206. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/no_random_uuid_in_sql.py +0 -0
  207. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/no_raw_source_text_test_oracle.py +0 -0
  208. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/no_recording_store.py +0 -0
  209. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/no_redundant_attribute_unpacking.py +0 -0
  210. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/no_redundant_literal_description.py +0 -0
  211. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/no_redundant_local_alias.py +0 -0
  212. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/no_redundant_module_alias_exports.py +0 -0
  213. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/no_redundant_sql_alias.py +0 -0
  214. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/no_repeated_string_literal.py +0 -0
  215. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/no_repeated_test_body.py +0 -0
  216. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/no_restated_comment.py +0 -0
  217. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/no_secret_in_log.py +0 -0
  218. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/no_select_star.py +0 -0
  219. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/no_service_behavior_in_settings.py +0 -0
  220. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/no_shallow_container_type_guard.py +0 -0
  221. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/no_shallow_record_type_guard.py +0 -0
  222. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/no_shared_mutable_default.py +0 -0
  223. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/no_slash_collection_root_under_prefix.py +0 -0
  224. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/no_string_concat_in_loop.py +0 -0
  225. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/no_swallowed_asyncio_cancellation.py +0 -0
  226. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/no_sys_path_mutation.py +0 -0
  227. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/no_tautological_expect.py +0 -0
  228. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/no_test_comments.py +0 -0
  229. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/no_test_method_grafting.py +0 -0
  230. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/no_typed_doc_sections.py +0 -0
  231. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/no_unique_violation_message_match.py +0 -0
  232. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/no_unknown_pydantic_validator_field.py +0 -0
  233. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/no_unnecessary_docstring.py +0 -0
  234. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/no_unobserved_task_exception.py +0 -0
  235. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/no_unscoped_async_client_factory.py +0 -0
  236. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/no_unused_copy_result.py +0 -0
  237. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/no_unused_underscored_keyword_parameter.py +0 -0
  238. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/no_unused_value_marker.py +0 -0
  239. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/no_vague_suppression_description.py +0 -0
  240. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/no_whole_request_response_payload_in_log.py +0 -0
  241. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/no_work_verb_get_route.py +0 -0
  242. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/numeric_literal_separators.py +0 -0
  243. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/opaque_parametrize_case_needs_id.py +0 -0
  244. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/over_mocked_test.py +0 -0
  245. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/phase_label_comment.py +0 -0
  246. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/prefer_application_model_joins.py +0 -0
  247. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/prefer_autospec_for_callable_mock.py +0 -0
  248. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/prefer_bulk_upsert.py +0 -0
  249. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/prefer_class_row.py +0 -0
  250. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/prefer_collection_comprehension.py +0 -0
  251. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/prefer_configured_cloud_scope.py +0 -0
  252. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/prefer_constant_time_secret_compare.py +0 -0
  253. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/prefer_coordinated_state_owner.py +0 -0
  254. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/prefer_declarative_batch_validation.py +0 -0
  255. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/prefer_direct_import_module.py +0 -0
  256. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/prefer_discriminated_model_union.py +0 -0
  257. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/prefer_explicit_class_contract.py +0 -0
  258. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/prefer_explicit_value_model_construction.py +0 -0
  259. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/prefer_fstring_over_concat.py +0 -0
  260. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/prefer_grouped_settings.py +0 -0
  261. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/prefer_immutable_module_constant.py +0 -0
  262. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/prefer_injected_dependency_over_monkeypatch.py +0 -0
  263. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/prefer_injected_service.py +0 -0
  264. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/prefer_library_fake.py +0 -0
  265. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/prefer_match_assert_never.py +0 -0
  266. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/prefer_match_exception_dispatch.py +0 -0
  267. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/prefer_match_value_dispatch.py +0 -0
  268. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/prefer_module_level_constant.py +0 -0
  269. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/prefer_monkeypatch_for_process_state_in_test.py +0 -0
  270. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/prefer_monotonic_for_elapsed_time.py +0 -0
  271. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/prefer_namedtuple_over_tuple_return.py +0 -0
  272. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/prefer_native_string_check.py +0 -0
  273. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/prefer_nominal_id_types.py +0 -0
  274. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/prefer_nominal_mapping_keys.py +0 -0
  275. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/prefer_non_nullable_collection.py +0 -0
  276. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/prefer_optional_composite.py +0 -0
  277. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/prefer_or_pattern.py +0 -0
  278. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/prefer_outcome_variants.py +0 -0
  279. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/prefer_precise_object_contract.py +0 -0
  280. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/prefer_psycopg_executemany.py +0 -0
  281. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/prefer_pydantic_json_value.py +0 -0
  282. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/prefer_pydantic_model_assertion.py +0 -0
  283. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/prefer_pytest_fixture_contract.py +0 -0
  284. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/prefer_pytest_fixture_injection.py +0 -0
  285. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/prefer_regex_fullmatch.py +0 -0
  286. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/prefer_required_constructor_parameters.py +0 -0
  287. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/prefer_runtime_validation.py +0 -0
  288. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/prefer_self_documenting_constant.py +0 -0
  289. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/prefer_self_type_annotation.py +0 -0
  290. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/prefer_semantic_temporal_types.py +0 -0
  291. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/prefer_set_isdisjoint.py +0 -0
  292. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/prefer_single_psycopg_cursor.py +0 -0
  293. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/prefer_str_enum.py +0 -0
  294. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/prefer_struct_over_namedtuple.py +0 -0
  295. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/prefer_typed_cli.py +0 -0
  296. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/prefer_typed_settings_field.py +0 -0
  297. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/prefer_validated_uuid_comparison.py +0 -0
  298. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/prefer_walrus_awaited_none_guard.py +0 -0
  299. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/prefer_walrus_comprehension_filter.py +0 -0
  300. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/prefer_walrus_regex_match.py +0 -0
  301. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/prefer_walrus_stream_loop.py +0 -0
  302. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/production_derived_test_cases.py +0 -0
  303. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/psycopg_sql_format_field_mismatch.py +0 -0
  304. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/pytest_fixture_returns_bare_tuple.py +0 -0
  305. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/pytest_fixture_returns_closed_resource.py +0 -0
  306. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/redundant_class_docstring.py +0 -0
  307. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/redundant_docstring.py +0 -0
  308. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/redundant_module_docstring.py +0 -0
  309. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/redundant_test_constructor_forwarder.py +0 -0
  310. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/repeated_kwarg_heavy_call_in_test.py +0 -0
  311. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/repeated_static_call_cases.py +0 -0
  312. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/repeated_test_composition.py +0 -0
  313. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/repeated_unimplemented_test_contract.py +0 -0
  314. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/require_constrained_api_integer.py +0 -0
  315. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/require_exp_on_jwt_decode.py +0 -0
  316. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/require_explicit_contract_implementation.py +0 -0
  317. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/require_explicit_psycopg_transaction.py +0 -0
  318. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/require_explicit_service_contract.py +0 -0
  319. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/require_hidden_settings_input.py +0 -0
  320. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/require_injectable_retry_sleep.py +0 -0
  321. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/require_keyword_only_swap_prone_params.py +0 -0
  322. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/require_nodecode_for_splitting_settings_field.py +0 -0
  323. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/require_port_for_service.py +0 -0
  324. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/require_precise_factory_signature.py +0 -0
  325. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/require_public_dependency_contract.py +0 -0
  326. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/require_pydantic_for_external_json.py +0 -0
  327. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/require_pydantic_for_mapping_shape.py +0 -0
  328. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/require_pydantic_for_structured_payload.py +0 -0
  329. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/require_pydantic_ordinal_lower_bound.py +0 -0
  330. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/restated_test_docstring.py +0 -0
  331. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/service_singleton_delegates_to_bulk.py +0 -0
  332. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/shared_mutable_pydantic_factory.py +0 -0
  333. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/stepdown.py +0 -0
  334. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/store_field_update_reuses_upsert.py +0 -0
  335. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/store_get_delegates_to_bulk_read.py +0 -0
  336. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/store_insert_requires_explicit_conflict_policy.py +0 -0
  337. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/store_insert_requires_on_conflict.py +0 -0
  338. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/store_mutation_command_fanout.py +0 -0
  339. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/subprocess_kill_without_reap.py +0 -0
  340. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/test_without_explicit_oracle.py +0 -0
  341. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/timestamp_order_requires_tiebreaker.py +0 -0
  342. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/trailing_value_narration.py +0 -0
  343. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/typed_error_reasons.py +0 -0
  344. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/uncontrolled_randomness_in_test.py +0 -0
  345. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/unused_mock_setup.py +0 -0
  346. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/rules/unused_test_factory_option.py +0 -0
  347. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/sql_literals.py +0 -0
  348. {sarj_python_lint-1.144.1 → sarj_python_lint-1.146.0}/src/sarj_python_lint/suppression_policy.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: sarj-python-lint
3
- Version: 1.144.1
3
+ Version: 1.146.0
4
4
  Summary: Custom Python lint rules — AST-based, pre-commit-friendly, hypermodern defaults
5
5
  Project-URL: Homepage, https://code-standards.sarj.ai/rules/python/
6
6
  Project-URL: Documentation, https://code-standards.sarj.ai/rules/python/
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "sarj-python-lint"
3
- version = "1.144.1"
3
+ version = "1.146.0"
4
4
  description = "Custom Python lint rules — AST-based, pre-commit-friendly, hypermodern defaults"
5
5
  readme = "README.md"
6
6
  authors = [{ name = "sarj-ai" }]
@@ -8,6 +8,33 @@ from sarj_python_lint.rule_metadata import RuleDescriptor
8
8
 
9
9
  SCHEMA_VERSION = 1
10
10
  DESCRIPTORS: tuple[RuleDescriptor, ...] = (
11
+ RuleDescriptor(
12
+ rule_id=RuleId("prefer-pydantic-field-bounds"),
13
+ module="sarj_python_lint.rules.prefer_pydantic_field_bounds",
14
+ class_name="PreferPydanticFieldBounds",
15
+ code="SARJ582",
16
+ description="Declare simple integer field bounds instead of an after-model validator.",
17
+ aliases=(),
18
+ enabled_by_default=True,
19
+ ),
20
+ RuleDescriptor(
21
+ rule_id=RuleId("no-value-error-forwarder"),
22
+ module="sarj_python_lint.rules.no_value_error_forwarder",
23
+ class_name="NoValueErrorForwarder",
24
+ code="SARJ580",
25
+ description="Raise ValueError at the failure boundary instead of forwarding through a helper.",
26
+ aliases=(),
27
+ enabled_by_default=True,
28
+ ),
29
+ RuleDescriptor(
30
+ rule_id=RuleId("prefer-defaultdict"),
31
+ module="sarj_python_lint.rules.prefer_defaultdict",
32
+ class_name="PreferDefaultdict",
33
+ code="SARJ579",
34
+ description="Use defaultdict(list) for a locally owned list-grouping dictionary.",
35
+ aliases=(),
36
+ enabled_by_default=True,
37
+ ),
11
38
  RuleDescriptor(
12
39
  rule_id=RuleId("no-nonlocal-statement"),
13
40
  module="sarj_python_lint.rules.no_nonlocal_statement",
@@ -346,7 +373,7 @@ DESCRIPTORS: tuple[RuleDescriptor, ...] = (
346
373
  module="sarj_python_lint.rules.prefer_typed_mapping_get",
347
374
  class_name="PreferTypedMappingGet",
348
375
  code="SARJ535",
349
- description="Read named fields from typed records instead of schema-free mappings.",
376
+ description="Read named fields through declared contracts instead of ad hoc mapping parsing.",
350
377
  aliases=(),
351
378
  enabled_by_default=True,
352
379
  ),
@@ -85,6 +85,27 @@ class LocalSourceFacts:
85
85
  return LocalSourceKeys(frozenset(self._resolutions), frozenset(self._modules))
86
86
 
87
87
 
88
+ def unshadowed_import_namespace(current: Path, namespace: str, *, facts: FirstPartyFacts) -> bool:
89
+ if not namespace.isidentifier() or (root := facts.project_root(current)) is None:
90
+ return False
91
+ try:
92
+ absolute = current if current.is_absolute() else current.resolve()
93
+ except OSError:
94
+ return False
95
+ for base in _import_bases(absolute, root, 0):
96
+ if not _safe_path(base, root):
97
+ return False
98
+ for candidate in (base / namespace, base / f"{namespace}.py"):
99
+ try:
100
+ candidate.lstat()
101
+ except FileNotFoundError:
102
+ continue
103
+ except OSError:
104
+ return False
105
+ return False
106
+ return True
107
+
108
+
88
109
  def _resolve_module(current: Path, module: str | None, level: int, *, facts: FirstPartyFacts) -> Path | None:
89
110
  if ".." in current.parts or level > _MAX_ANCESTORS:
90
111
  return None
@@ -653,7 +653,7 @@ class OpaqueContractFacts:
653
653
  value = statement.value
654
654
  else:
655
655
  return None
656
- return value if value is not None and _statement_dominates(statement, at, self.context) else None
656
+ return value if value is not None and statement_dominates(statement, at, self.context) else None
657
657
 
658
658
  def _raw_annotation(self, parameter: ast.arg | None) -> bool:
659
659
  return (
@@ -1231,7 +1231,7 @@ def _statement_suites(parent: ast.AST) -> Iterator[list[ast.stmt]]:
1231
1231
  return
1232
1232
 
1233
1233
 
1234
- def _statement_dominates(statement: ast.stmt, at: ast.AST, context: PythonFileContext) -> bool:
1234
+ def statement_dominates(statement: ast.stmt, at: ast.AST, context: PythonFileContext) -> bool:
1235
1235
  owner = context.parents.get(statement)
1236
1236
  if owner is None or statement.lineno >= source_position(at)[0]:
1237
1237
  return False
@@ -265,11 +265,13 @@ from sarj_python_lint.rules.no_sys_path_mutation import NoSysPathMutation
265
265
  from sarj_python_lint.rules.no_unknown_pydantic_validator_field import NoUnknownPydanticValidatorField
266
266
  from sarj_python_lint.rules.no_unobserved_task_exception import NoUnobservedTaskException
267
267
  from sarj_python_lint.rules.no_unscoped_async_client_factory import NoUnscopedAsyncClientFactory
268
+ from sarj_python_lint.rules.no_value_error_forwarder import NoValueErrorForwarder
268
269
  from sarj_python_lint.rules.no_work_verb_get_route import NoWorkVerbGetRoute
269
270
  from sarj_python_lint.rules.numeric_literal_separators import NumericLiteralSeparators
270
271
  from sarj_python_lint.rules.prefer_application_model_joins import PreferApplicationModelJoins
271
272
  from sarj_python_lint.rules.prefer_bulk_upsert import PreferBulkUpsert
272
273
  from sarj_python_lint.rules.prefer_coordinated_state_owner import PreferCoordinatedStateOwner
274
+ from sarj_python_lint.rules.prefer_defaultdict import PreferDefaultdict
273
275
  from sarj_python_lint.rules.prefer_direct_import_module import PreferDirectImportModule
274
276
  from sarj_python_lint.rules.prefer_discriminated_model_union import PreferDiscriminatedModelUnion
275
277
  from sarj_python_lint.rules.prefer_explicit_class_contract import PreferExplicitClassContract
@@ -280,6 +282,7 @@ from sarj_python_lint.rules.prefer_optional_composite import PreferOptionalCompo
280
282
  from sarj_python_lint.rules.prefer_outcome_variants import PreferOutcomeVariants
281
283
  from sarj_python_lint.rules.prefer_precise_object_contract import PreferPreciseObjectContract
282
284
  from sarj_python_lint.rules.prefer_psycopg_executemany import PreferPsycopgExecutemany
285
+ from sarj_python_lint.rules.prefer_pydantic_field_bounds import PreferPydanticFieldBounds
283
286
  from sarj_python_lint.rules.prefer_pydantic_model_assertion import PreferPydanticModelAssertion
284
287
  from sarj_python_lint.rules.prefer_pytest_dependency_fixtures import PreferPytestDependencyFixtures
285
288
  from sarj_python_lint.rules.prefer_runtime_validation import PreferRuntimeValidation
@@ -305,6 +308,9 @@ from sarj_python_lint.rules.test_without_explicit_oracle import NoExplicitTestOr
305
308
 
306
309
  _AUTHORING_REGISTRY: Mapping[str, type[Rule]] = MappingProxyType(
307
310
  {
311
+ PreferPydanticFieldBounds.id: PreferPydanticFieldBounds,
312
+ NoValueErrorForwarder.id: NoValueErrorForwarder,
313
+ PreferDefaultdict.id: PreferDefaultdict,
308
314
  NoNonlocalStatement.id: NoNonlocalStatement,
309
315
  NoUnscopedAsyncClientFactory.id: NoUnscopedAsyncClientFactory,
310
316
  PsycopgSqlFormatFieldMismatch.id: PsycopgSqlFormatFieldMismatch,
@@ -0,0 +1,201 @@
1
+ from __future__ import annotations
2
+
3
+ import ast
4
+ from typing import TYPE_CHECKING
5
+
6
+ from sarj_python_lint.rules._local_source import unshadowed_import_namespace
7
+ from sarj_python_lint.rules._opaque_contracts import statement_dominates
8
+ from sarj_python_lint.rules._type_guard_symbols import guard_symbols_ambiguous
9
+
10
+
11
+ if TYPE_CHECKING:
12
+ from collections.abc import Sequence
13
+
14
+ from sarj_python_lint._file_context import PythonFileContext
15
+ from sarj_python_lint.rules.require_pydantic_for_mapping_shape import MappingShapeFacts
16
+
17
+
18
+ _MESSAGE_TYPES = frozenset({"livekit.agents.llm.ChatMessage", "livekit.agents.llm.chat_context.ChatMessage"})
19
+ _MODULE_ROOTS = frozenset(owner.partition(".")[0] for owner in _MESSAGE_TYPES)
20
+ _MAX_GET_ARGUMENTS = 2
21
+ _PATCH_TARGETS = frozenset(
22
+ {"unittest.mock.patch", "unittest.mock.patch.object", "unittest.mock.patch.multiple", "unittest.mock.patch.dict"}
23
+ )
24
+
25
+
26
+ def sdk_metadata_reads(facts: MappingShapeFacts) -> list[ast.Call]:
27
+ context = facts.context
28
+ candidates = _conditional_reads(context)
29
+ if not candidates or not any(
30
+ target.module == "livekit" or target.module.startswith("livekit.")
31
+ for target in context.module_imports.bindings.values()
32
+ ):
33
+ return []
34
+ if not _api_contract_available(facts):
35
+ return []
36
+ assertions = context.nodes(ast.Assert)
37
+ closed: dict[ast.AST, bool] = {}
38
+ found: dict[ast.AST, ast.Call] = {}
39
+ for call in candidates:
40
+ if facts.raw_boundary(call) or context.suppressions.is_suppressed(call.lineno, "SARJ535"):
41
+ continue
42
+ receiver = call.func
43
+ if not isinstance(receiver, ast.Attribute) or not isinstance(receiver.value, ast.Attribute):
44
+ continue
45
+ value = receiver.value.value
46
+ if isinstance(value, ast.Name) and (binding := _typed_receiver(value, call, facts, assertions, closed)):
47
+ found.setdefault(binding, call)
48
+ return list(found.values())
49
+
50
+
51
+ def _conditional_reads(context: PythonFileContext) -> list[ast.Call]:
52
+ candidates = [
53
+ call
54
+ for call in context.nodes(ast.Call)
55
+ if isinstance(call.func, ast.Attribute)
56
+ and call.func.attr == "get"
57
+ and isinstance(call.func.value, ast.Attribute)
58
+ and call.func.value.attr == "extra"
59
+ and isinstance(call.func.value.value, ast.Name)
60
+ and 1 <= len(call.args) <= _MAX_GET_ARGUMENTS
61
+ and not call.keywords
62
+ and isinstance(call.args[0], ast.Constant)
63
+ and isinstance(call.args[0].value, str)
64
+ and _condition(call, context)
65
+ ]
66
+ return sorted(candidates, key=lambda node: (node.lineno, node.col_offset))
67
+
68
+
69
+ def _api_contract_available(facts: MappingShapeFacts) -> bool:
70
+ if facts.provenance.wildcard or facts.provenance.dynamic_namespace:
71
+ return False
72
+ if guard_symbols_ambiguous(facts.context, frozenset({"isinstance"})) or not _external_api(facts):
73
+ return False
74
+ return not any(
75
+ facts.qualified(call.func, call) in _PATCH_TARGETS for call in facts.context.nodes(ast.Call)
76
+ ) and _class_uses_are_stable(facts)
77
+
78
+
79
+ def _external_api(facts: MappingShapeFacts) -> bool:
80
+ context = facts.context
81
+ return all(
82
+ unshadowed_import_namespace(context.path, namespace, facts=context.session.first_party)
83
+ for namespace in _MODULE_ROOTS
84
+ )
85
+
86
+
87
+ def _class_uses_are_stable(facts: MappingShapeFacts) -> bool:
88
+ context = facts.context
89
+ for node in context.nodes(ast.Name, ast.Attribute):
90
+ if facts.qualified(node, node) not in _MESSAGE_TYPES:
91
+ continue
92
+ parent = context.parents.get(node)
93
+ if isinstance(parent, ast.Call) and (
94
+ parent.func is node or (_type_test(parent, facts) is not None and parent.args[1] is node)
95
+ ):
96
+ continue
97
+ current: ast.AST = node
98
+ while isinstance(parent, ast.Subscript | ast.BinOp | ast.Tuple | ast.List):
99
+ current, parent = parent, context.parents.get(parent)
100
+ match parent:
101
+ case ast.arg(annotation=annotation) | ast.AnnAssign(annotation=annotation) if annotation is current:
102
+ continue
103
+ case ast.FunctionDef(returns=annotation) | ast.AsyncFunctionDef(returns=annotation) if (
104
+ annotation is current
105
+ ):
106
+ continue
107
+ case _:
108
+ return False
109
+ return True
110
+
111
+
112
+ def _condition(call: ast.Call, context: PythonFileContext) -> bool:
113
+ current: ast.AST = call
114
+ while (parent := context.parents.get(current)) is not None:
115
+ if isinstance(parent, ast.If | ast.While | ast.IfExp):
116
+ return parent.test is current
117
+ if not isinstance(parent, ast.BoolOp) and not (
118
+ isinstance(parent, ast.UnaryOp) and isinstance(parent.op, ast.Not)
119
+ ):
120
+ return False
121
+ current = parent
122
+ return False
123
+
124
+
125
+ def _type_test(node: ast.AST | None, facts: MappingShapeFacts) -> ast.Call | None:
126
+ match node:
127
+ case ast.Call(func=func, args=[_, _], keywords=[]) if facts.builtin(func, "isinstance", node):
128
+ return node
129
+ case _:
130
+ return None
131
+
132
+
133
+ def _typed_receiver(
134
+ value: ast.Name,
135
+ call: ast.Call,
136
+ facts: MappingShapeFacts,
137
+ assertions: Sequence[ast.Assert],
138
+ closed: dict[ast.AST, bool],
139
+ ) -> ast.AST | None:
140
+ binding = facts.provenance.runtime_binding(value.id, value)
141
+ if binding is None:
142
+ return None
143
+ if binding not in closed:
144
+ closed[binding] = _closed_receiver(value, binding, facts)
145
+ if not closed[binding]:
146
+ return None
147
+ annotation = binding.annotation if isinstance(binding, ast.arg) else None
148
+ parent = facts.context.parents.get(binding)
149
+ if isinstance(parent, ast.AnnAssign):
150
+ annotation = parent.annotation
151
+ if annotation is not None and _message_annotation(annotation, facts):
152
+ return binding
153
+ for assertion in assertions:
154
+ test = _type_test(assertion.test, facts)
155
+ if test is None:
156
+ continue
157
+ if (
158
+ _same_binding(test.args[0], value, facts)
159
+ and _message_annotation(test.args[1], facts)
160
+ and statement_dominates(assertion, call, facts.context)
161
+ ):
162
+ return binding
163
+ return None
164
+
165
+
166
+ def _closed_receiver(value: ast.Name, binding: ast.AST, facts: MappingShapeFacts) -> bool:
167
+ if value.id in facts.provenance.mutated | facts.provenance.external_bindings:
168
+ return False
169
+ return all(_receiver_read(read, facts) for read in facts.provenance.binding_reads(value.id, binding))
170
+
171
+
172
+ def _receiver_read(read: ast.Name, facts: MappingShapeFacts) -> bool:
173
+ parent = facts.context.parents.get(read)
174
+ if _type_test(parent, facts) is not None and isinstance(parent, ast.Call) and parent.args[0] is read:
175
+ return True
176
+ if not isinstance(parent, ast.Attribute) or parent.value is not read or not isinstance(parent.ctx, ast.Load):
177
+ return False
178
+ outer = facts.context.parents.get(parent)
179
+ if isinstance(outer, ast.Call) and outer.func is parent:
180
+ return False
181
+ if parent.attr != "extra":
182
+ return True
183
+ return (
184
+ isinstance(outer, ast.Attribute)
185
+ and outer.attr == "get"
186
+ and isinstance(call := facts.context.parents.get(outer), ast.Call)
187
+ and call.func is outer
188
+ )
189
+
190
+
191
+ def _message_annotation(annotation: ast.expr, facts: MappingShapeFacts) -> bool:
192
+ resolved = facts.resolve_annotation(annotation)
193
+ return resolved is not None and facts.qualified(resolved.expression, resolved.at) in _MESSAGE_TYPES
194
+
195
+
196
+ def _same_binding(left: ast.expr, right: ast.Name, facts: MappingShapeFacts) -> bool:
197
+ return (
198
+ isinstance(left, ast.Name)
199
+ and (binding := facts.provenance.runtime_binding(left.id, left)) is not None
200
+ and binding is facts.provenance.runtime_binding(right.id, right)
201
+ )
@@ -0,0 +1,264 @@
1
+ from __future__ import annotations
2
+
3
+ import ast
4
+ from pathlib import PurePosixPath
5
+ from typing import TYPE_CHECKING, final, override
6
+
7
+ from sarj_python_lint.rule_base import (
8
+ AutofixPolicy,
9
+ Diagnostic,
10
+ ExampleFile,
11
+ ExampleOutcome,
12
+ Rule,
13
+ RuleCategory,
14
+ RuleDocumentation,
15
+ RuleExample,
16
+ Severity,
17
+ )
18
+ from sarj_python_lint.rules._annotation_origins import AnnotationOrigins
19
+
20
+
21
+ if TYPE_CHECKING:
22
+ from sarj_python_lint._file_context import PythonFileContext
23
+ from sarj_python_lint.rules._imports import ImportIndex
24
+
25
+
26
+ _PYDANTIC = frozenset({"pydantic", "pydantic.root_model", "pydantic.type_adapter", "pydantic.types"})
27
+ _TYPING = frozenset({"typing", "typing_extensions"})
28
+
29
+
30
+ @final
31
+ class NoGenericJsonParser(Rule):
32
+ id = "no-generic-json-parser"
33
+ code = "SARJ552"
34
+ documentation = RuleDocumentation(
35
+ default_level=Severity.WARNING,
36
+ summary="Parse consumed JSON fields with a bespoke declarative model instead of an open JSON parser.",
37
+ rationale="An open JSON domain validates syntax and value kinds without declaring required fields or their relationships; consumers must then reconstruct the contract manually.",
38
+ remediation="Declare only the fields the consumer needs in a named Pydantic model and use model_validate_json or model_validate. Allow unrelated fields when the wire contract permits them. Document an exact-code exception for genuinely schema-agnostic infrastructure.",
39
+ category=RuleCategory.CORRECTNESS,
40
+ autofix=AutofixPolicy.NONE,
41
+ limitations=(
42
+ "Reports import-proven TypeAdapter construction and RootModel bases containing JsonValue, Json, Any or object, including module-local explicit type aliases. Inline RootModel validation is checked only for the optional open record described below; ordinary inline JSON plumbing remains unchanged. Tests remain in scope; generated files are excluded.",
43
+ "A direct stable total=False TypedDict whose nonempty field set is entirely JsonValue, Any or object also leaves every value open. Required, mixed/domain-valued, inherited, decorated and configured records remain allowed, as do ordinary annotations and arbitrary-JSON model fields. Imported aliases and recursive arbitrary unions without a canonical open type are not inferred.",
44
+ "Generic schema infrastructure may need a reasoned local suppression. No model or complete request schema is synthesized automatically.",
45
+ ),
46
+ examples=(
47
+ RuleExample(
48
+ example_id="generic-response-parser",
49
+ title="An open JSON mapping does not declare the response fields",
50
+ outcome=ExampleOutcome.MATCH,
51
+ files=(
52
+ ExampleFile.python(
53
+ "tests/test_api.py",
54
+ "from pydantic import JsonValue, RootModel\nclass Response(RootModel[dict[str, JsonValue]]):\n pass\n",
55
+ ),
56
+ ),
57
+ focus_path=PurePosixPath("tests/test_api.py"),
58
+ expected_count=1,
59
+ public=True,
60
+ ),
61
+ RuleExample(
62
+ example_id="partial-declarative-response",
63
+ title="Declare just the field this consumer needs",
64
+ outcome=ExampleOutcome.NO_MATCH,
65
+ files=(
66
+ ExampleFile.python(
67
+ "tests/test_api.py",
68
+ "from pydantic import BaseModel\nclass Response(BaseModel):\n version: int\n",
69
+ ),
70
+ ),
71
+ focus_path=PurePosixPath("tests/test_api.py"),
72
+ expected_count=0,
73
+ public=True,
74
+ ),
75
+ ),
76
+ )
77
+ description = documentation.summary
78
+
79
+ @override
80
+ def check_context(self, context: PythonFileContext) -> list[Diagnostic]:
81
+ if (
82
+ context.generated
83
+ or context.tree is None
84
+ or not any(name in context.symbol_source for name in ("TypeAdapter", "RootModel"))
85
+ ):
86
+ return []
87
+ imports = context.imports
88
+ aliases = {
89
+ statement.name.id: statement.value
90
+ for statement in context.tree.body
91
+ if isinstance(statement, ast.TypeAlias)
92
+ }
93
+ candidates = _open_parser_nodes(context, imports, aliases)
94
+ return [
95
+ Diagnostic(
96
+ context.path,
97
+ node.lineno,
98
+ node.col_offset + 1,
99
+ self.code,
100
+ "Replace this open JSON parser with a named model declaring the consumed fields.",
101
+ severity=Severity.WARNING,
102
+ )
103
+ for node in candidates
104
+ if not context.suppressions.is_suppressed(node.lineno, self.code)
105
+ ]
106
+
107
+
108
+ def _open_parser_nodes(
109
+ context: PythonFileContext, imports: ImportIndex, aliases: dict[str, ast.expr]
110
+ ) -> list[ast.expr]:
111
+ tree = context.tree
112
+ if tree is None:
113
+ return []
114
+ candidates: list[ast.expr] = []
115
+ records = {
116
+ statement.name: statement
117
+ for statement in tree.body
118
+ if isinstance(statement, ast.ClassDef) and _optional_record_declaration(statement, imports)
119
+ }
120
+ for call in context.nodes(ast.Call):
121
+ schema = _parser_schema(call, context, imports, records)
122
+ if schema is not None and _open_schema(schema, imports, aliases, context=context, records=records):
123
+ candidates.append(call)
124
+ for owner in context.nodes(ast.ClassDef):
125
+ candidates.extend(_open_root_bases(owner, imports, aliases, context=context, records=records))
126
+ return sorted(candidates, key=lambda node: (node.lineno, node.col_offset))
127
+
128
+
129
+ def _parser_schema(
130
+ call: ast.Call, context: PythonFileContext, imports: ImportIndex, records: dict[str, ast.ClassDef]
131
+ ) -> ast.expr | None:
132
+ if not imports.resolves(call.func, sources=_PYDANTIC, symbol="TypeAdapter"):
133
+ schema = _inline_root_schema(call, context)
134
+ return (
135
+ schema
136
+ if (
137
+ isinstance(schema, ast.Name)
138
+ and schema.id in records
139
+ and _open_optional_record(records[schema.id], schema, context)
140
+ )
141
+ else None
142
+ )
143
+ if call.args:
144
+ return call.args[0]
145
+ return next((keyword.value for keyword in call.keywords if keyword.arg == "type"), None)
146
+
147
+
148
+ def _open_root_bases(
149
+ owner: ast.ClassDef,
150
+ imports: ImportIndex,
151
+ aliases: dict[str, ast.expr],
152
+ *,
153
+ context: PythonFileContext,
154
+ records: dict[str, ast.ClassDef],
155
+ ) -> list[ast.Subscript]:
156
+ return [
157
+ base
158
+ for base in owner.bases
159
+ if isinstance(base, ast.Subscript)
160
+ and imports.resolves(base.value, sources=_PYDANTIC, symbol="RootModel")
161
+ and _open_schema(base.slice, imports, aliases, context=context, records=records)
162
+ ]
163
+
164
+
165
+ def _open_schema(
166
+ node: ast.expr,
167
+ imports: ImportIndex,
168
+ aliases: dict[str, ast.expr],
169
+ seen: frozenset[str] = frozenset(),
170
+ *,
171
+ context: PythonFileContext,
172
+ records: dict[str, ast.ClassDef],
173
+ ) -> bool:
174
+ facts = AnnotationOrigins(context)
175
+ for item in ast.walk(node):
176
+ if not isinstance(item, ast.expr):
177
+ continue
178
+ if facts.qualified(item, item) in {
179
+ "pydantic.JsonValue",
180
+ "pydantic.types.JsonValue",
181
+ "pydantic.Json",
182
+ "pydantic.types.Json",
183
+ }:
184
+ return True
185
+ if facts.qualified(item, item) in {"typing.Any", "typing_extensions.Any"}:
186
+ return True
187
+ if isinstance(item, ast.Name):
188
+ record = records.get(item.id)
189
+ if record is not None and _open_optional_record(record, item, context):
190
+ return True
191
+ if facts.builtin(item, "object", item):
192
+ return True
193
+ if (
194
+ item.id in aliases
195
+ and item.id not in seen
196
+ and not facts.shadowed(item.id, item)
197
+ and facts.alias_value(item, item) is aliases[item.id]
198
+ and _open_schema(aliases[item.id], imports, aliases, seen | {item.id}, context=context, records=records)
199
+ ):
200
+ return True
201
+ return False
202
+
203
+
204
+ def _inline_root_schema(call: ast.Call, context: PythonFileContext) -> ast.expr | None:
205
+ target = call.func
206
+ if isinstance(target, ast.Attribute) and target.attr in {"model_validate", "model_validate_json"}:
207
+ target = target.value
208
+ if not isinstance(target, ast.Subscript):
209
+ return None
210
+ qualified = AnnotationOrigins(context).qualified(target.value, call)
211
+ return target.slice if qualified in {"pydantic.RootModel", "pydantic.root_model.RootModel"} else None
212
+
213
+
214
+ def _optional_record_declaration(node: ast.ClassDef, imports: ImportIndex) -> bool:
215
+ return (
216
+ not node.decorator_list
217
+ and not node.type_params
218
+ and len(node.bases) == 1
219
+ and imports.resolves(node.bases[0], sources=_TYPING, symbol="TypedDict")
220
+ and len(node.keywords) == 1
221
+ and node.keywords[0].arg == "total"
222
+ and isinstance(node.keywords[0].value, ast.Constant)
223
+ and node.keywords[0].value.value is False
224
+ )
225
+
226
+
227
+ def _open_optional_record(node: ast.ClassDef, use: ast.Name, context: PythonFileContext) -> bool:
228
+ facts = AnnotationOrigins(context)
229
+ provenance = facts.provenance
230
+ if (
231
+ facts.shadowed(use.id, use)
232
+ or provenance.wildcard
233
+ or provenance.dynamic_namespace
234
+ or use.id in provenance.mutated | provenance.external_bindings
235
+ or provenance.binding(use.id, use) is not node
236
+ ):
237
+ return False
238
+ fields: list[ast.expr] = []
239
+ for statement in node.body:
240
+ if isinstance(statement, ast.AnnAssign) and isinstance(statement.target, ast.Name) and statement.value is None:
241
+ fields.append(statement.annotation)
242
+ elif not (
243
+ isinstance(statement, ast.Pass)
244
+ or (
245
+ isinstance(statement, ast.Expr)
246
+ and isinstance(statement.value, ast.Constant)
247
+ and isinstance(statement.value.value, str)
248
+ )
249
+ ):
250
+ return False
251
+ return bool(fields) and all(_arbitrary_value(field, facts) for field in fields)
252
+
253
+
254
+ def _arbitrary_value(node: ast.expr, facts: AnnotationOrigins) -> bool:
255
+ resolved = facts.resolve_annotation(node)
256
+ if resolved is None:
257
+ return False
258
+ value, at = resolved.expression, resolved.at
259
+ return facts.builtin(value, "object", at) or facts.qualified(value, at) in {
260
+ "pydantic.JsonValue",
261
+ "pydantic.types.JsonValue",
262
+ "typing.Any",
263
+ "typing_extensions.Any",
264
+ }
@@ -42,7 +42,7 @@ _PASSIVE_CONFIG = frozenset({"frozen", "strict", "validate_default"})
42
42
  _MODEL_APIS = frozenset({"model_construct", "model_validate", "model_validate_json", "model_validate_strings"})
43
43
  _MAX_ANNOTATION_DEPTH = 64
44
44
  _MAX_ANNOTATION_NODES = 1024
45
- _MAX_LITERAL_TEXT = 65536
45
+ _MAX_LITERAL_TEXT = 65_536
46
46
  _UNKNOWN_LITERAL: Final = object()
47
47
  _PAIR_ARITY = 2
48
48