syntopica-codeality-py 0.2.1__tar.gz → 0.2.3__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.
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/CHANGELOG.md +33 -7
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/PKG-INFO +14 -1
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/README.md +13 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/codeality-py.toml +1 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/pyproject.toml +1 -1
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/assets/codeality-py-ci.yml +2 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/assets/codeality-py.toml +3 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/assets/pyproject-sections.toml +7 -2
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/config/baseline_config.py +3 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/config/load_config.py +2 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/gate/gate_result.py +4 -1
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/gate/gate_stages.py +6 -0
- syntopica_codeality_py-0.2.3/src/codeality_py/gate/over_budget_detail.py +24 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/gate/run_gate.py +1 -1
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/gate/run_stage.py +7 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/gate/stage.py +2 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/gate/stage_status.py +2 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/roles/test_file_patterns.py +1 -1
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/tests/config/test_load_config.py +10 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/tests/gate/test_gate_stages.py +13 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/tests/gate/test_run_gate.py +35 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/tests/init/test_plan_init.py +23 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/tests/init/test_render_asset.py +10 -9
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/tests/roles/test_matches_glob.py +1 -1
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/uv.lock +1 -1
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/.gitignore +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/LICENSE +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/mypy.ini +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/ruff.toml +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/__init__.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/assets/importlinter.ini +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/assets/mypy.ini +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/assets/ruff.toml +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/baseline/__init__.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/baseline/baseline_file.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/baseline/classified_findings.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/baseline/classify_findings.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/baseline/finding_context.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/baseline/fingerprint.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/baseline/fingerprint_context.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/baseline/read_baseline.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/baseline/write_baseline.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/cli.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/commands/__init__.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/commands/baseline_check_command.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/commands/baseline_command.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/commands/baseline_update_command.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/commands/check_command.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/commands/checked_project.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/commands/gate_command.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/commands/init_command.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/commands/project_option.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/config/__init__.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/config/check_schema_version.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/config/config_error.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/config/default_generated_globs.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/config/discover_source_roots.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/config/discover_test_roots.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/config/limits.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/config/module_role.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/config/override.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/config/parse_overrides.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/config/parse_roles.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/config/parse_rule_codes.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/config/pyproject_layout_hints.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/config/read_config_document.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/config/reject_duplicate_role_claims.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/config/reject_unknown_keys.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/engine/__init__.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/engine/check_project.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/engine/check_result.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/engine/check_source_file.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/engine/fingerprint_findings.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/engine/rule_registry.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/gate/__init__.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/gate/build_stage_result.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/gate/stage_kind.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/gate/stage_result.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/init/__init__.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/init/add_missing_rules.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/init/apply_init.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/init/current_branch.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/init/first_party_packages.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/init/has_ruff_table.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/init/managed_asset_files.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/init/managed_file.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/init/merge_pyproject_sections.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/init/merge_quality_group.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/init/merge_ruff_config.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/init/plan_asset_file.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/init/plan_disposition.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/init/plan_init.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/init/plan_pyproject.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/init/plan_ruff.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/init/plan_shadowed_ruff.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/init/python_floor_minor.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/init/read_asset.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/init/read_requires_python.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/init/render_asset.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/init/render_nested_workflow.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/init/repository_root.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/init/workflow_target.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/model/__init__.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/model/finding.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/model/location.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/model/rule_code.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/model/severity.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/parsing/__init__.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/parsing/infrastructure_error.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/parsing/parse_source_file.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/parsing/read_source_text.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/parsing/source_file.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/parsing/syntax_error_finding.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/report/__init__.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/report/exit_code.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/report/finding_document.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/report/findings_summary.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/report/render_gate_report.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/report/render_json_report.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/report/render_text_report.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/report/stage_document.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/roles/__init__.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/roles/assign_module_role.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/roles/compile_glob.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/roles/matches_any_pattern.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/roles/matches_glob.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/rules/__init__.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/rules/barrel_only_init.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/rules/count_code_lines.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/rules/data_unit_findings.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/rules/docstring_line_spans.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/rules/file_matches_unit.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/rules/grab_bag_names.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/rules/is_allowed_barrel_statement.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/rules/is_column_list.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/rules/is_docstring_statement.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/rules/is_sql_literal.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/rules/is_static_dunder_assignment.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/rules/is_type_checking_block.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/rules/joined_string_text.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/rules/looks_like_sql.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/rules/max_file_lines.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/rules/no_grab_bag_names.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/rules/no_inline_sql.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/rules/one_primary_unit.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/rules/ordinary_unit_findings.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/rules/sql_subject.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/rules/unit_finding.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/suppression/__init__.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/suppression/apply_suppressions.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/suppression/build_suppression.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/suppression/covering_suppression.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/suppression/is_overridden.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/suppression/parse_suppression_line.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/suppression/parse_suppressions.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/suppression/suppression.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/traversal/__init__.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/traversal/collect_source_files.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/traversal/default_excludes.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/traversal/gitignore_matcher.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/traversal/walk_root.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/units/__init__.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/units/coalesce_overloads.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/units/coalesce_singledispatch.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/units/collect_declarations.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/units/count_primary_declarations.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/units/declaration.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/units/declaration_for.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/units/declaration_kind.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/units/decorator_name.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/units/decorator_names.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/units/is_main_guard.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/units/is_private_local_handler.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/units/legacy_type_alias.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/units/literal_string_names.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/units/merge_stray_letters.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/units/named_declaration.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/units/overload_family_length.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/units/resolve_exported_names.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/units/to_snake_case.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/units/top_level_statements.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/tests/baseline/test_classify_findings.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/tests/commands/test_baseline_command.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/tests/commands/test_check_command.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/tests/config/test_pyproject_layout_hints.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/tests/conftest.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/tests/init/test_merge_ruff_config.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/tests/model/test_finding.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/tests/model/test_rule_code.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/tests/parsing/test_parse_source_file.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/tests/roles/test_assign_module_role.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/tests/rules/test_barrel_only_init.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/tests/rules/test_file_matches_unit.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/tests/rules/test_max_file_lines.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/tests/rules/test_no_grab_bag_names.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/tests/rules/test_no_inline_sql.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/tests/rules/test_one_primary_unit.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/tests/test_cli_version.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/tests/traversal/test_collect_source_files.py +0 -0
- {syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/tests/units/test_to_snake_case.py +0 -0
|
@@ -4,6 +4,32 @@ All notable changes to `syntopica-codeality-py` are documented here. The format
|
|
|
4
4
|
follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and the project
|
|
5
5
|
adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
6
6
|
|
|
7
|
+
## 0.2.3
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- `test-budget-seconds` in `codeality-py.toml`: the gate reports the pytest
|
|
12
|
+
stage as `over-budget` when the suite passes but takes longer, and the detail
|
|
13
|
+
carries pytest's slowest-durations table and the suite-time procedure. A
|
|
14
|
+
consumer's suite had grown to 31 minutes with every gate green; one profiling
|
|
15
|
+
pass found a checker re-parsing the same file 620 951 times per run
|
|
16
|
+
(2026-09-22). Unset, the suite is unbudgeted, so no existing gate changes
|
|
17
|
+
colour on upgrade.
|
|
18
|
+
- The pytest stage always runs with `--durations=10`, so the measurement is in
|
|
19
|
+
the output before anyone asks for it.
|
|
20
|
+
- `init` scaffolds `pytest-xdist` with `addopts = "-ra -n auto"` and a
|
|
21
|
+
`test-budget-seconds = 300` in `codeality-py.toml`: a suite written parallel
|
|
22
|
+
from its first test stays isolated. A project with its own `[tool.pytest]`
|
|
23
|
+
table keeps it, as before.
|
|
24
|
+
|
|
25
|
+
## 0.2.2
|
|
26
|
+
|
|
27
|
+
### Changed
|
|
28
|
+
|
|
29
|
+
- The CI workflow `init --ci` writes now checks out without persisting the
|
|
30
|
+
GitHub token in the runner's git config. Nothing in that workflow pushes, so
|
|
31
|
+
the credential only widened what a compromised step could reach.
|
|
32
|
+
|
|
7
33
|
## 0.2.1
|
|
8
34
|
|
|
9
35
|
### Fixed
|
|
@@ -51,7 +77,7 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
|
51
77
|
- `init --ci` in a project nested inside a repository writes the workflow at the
|
|
52
78
|
repository root, named `quality-<project>.yml`, with every step running from
|
|
53
79
|
the project directory. GitHub reads workflows only from the root, so the file
|
|
54
|
-
scaffolded inside `tools/
|
|
80
|
+
scaffolded inside `tools/nested-tool` was never picked up.
|
|
55
81
|
|
|
56
82
|
## 0.1.10
|
|
57
83
|
|
|
@@ -96,7 +122,7 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
|
96
122
|
`[tool.ruff]`. Ruff reads one configuration per directory, so the file wins
|
|
97
123
|
outright and the table is never read - silently. The pair builds itself over
|
|
98
124
|
time: init writes the file when no table exists, and a table arrives later.
|
|
99
|
-
Found in
|
|
125
|
+
Found in consumer-a, which spent a release linting against a config nobody
|
|
100
126
|
read; once the shadow was removed, 1707 findings resolved to 6 real ones.
|
|
101
127
|
|
|
102
128
|
### Changed
|
|
@@ -114,7 +140,7 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
|
114
140
|
- `init` no longer adds the quality dependency group to a project whose
|
|
115
141
|
`requires-python` floor is below 3.11: the group carries
|
|
116
142
|
`syntopica-codeality-py`, and declaring it there makes every uv resolution
|
|
117
|
-
unsatisfiable. Found adopting the baseline in `
|
|
143
|
+
unsatisfiable. Found adopting the baseline in `consumer-b`, which declares
|
|
118
144
|
`>=3.8` for its Raspberry Pi target.
|
|
119
145
|
|
|
120
146
|
## 0.1.6
|
|
@@ -123,7 +149,7 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
|
123
149
|
|
|
124
150
|
- `[audit] ignore-vulns` in `codeality-py.toml`: accepted advisories, each
|
|
125
151
|
expected to carry a written reason, reach pip-audit as `--ignore-vuln` flags.
|
|
126
|
-
Found adopting the baseline in `
|
|
152
|
+
Found adopting the baseline in `consumer-c`, where platformio 6.x pins
|
|
127
153
|
starlette below the patched release and the gate had no way to accept the
|
|
128
154
|
documented risk.
|
|
129
155
|
- `init` records the discovered `import-package`, so coverage measures the
|
|
@@ -141,7 +167,7 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
|
141
167
|
|
|
142
168
|
- Root discovery now reads the layout a `pyproject.toml` already declares -
|
|
143
169
|
pytest's `pythonpath` and `testpaths`, hatch's wheel `packages` - before
|
|
144
|
-
guessing from directories. Found adopting the baseline in `
|
|
170
|
+
guessing from directories. Found adopting the baseline in `consumer-c`, a
|
|
145
171
|
firmware host whose Python lives under `host/src` where directory scanning
|
|
146
172
|
sees nothing.
|
|
147
173
|
- The test per-file-ignores pattern is `**/tests/**`, so it also reaches nested
|
|
@@ -195,7 +221,7 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
|
195
221
|
identifies itself, a naming rule (`BPY002`, `BPY003`) identifies its symbol,
|
|
196
222
|
and everything else uses the offending line's content plus an occurrence
|
|
197
223
|
counter, so it survives edits elsewhere in the file. Found adopting the
|
|
198
|
-
baseline in
|
|
224
|
+
baseline in consumer-a, where 155 findings recorded as only 91 entries.
|
|
199
225
|
|
|
200
226
|
## 0.1.1
|
|
201
227
|
|
|
@@ -205,7 +231,7 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
|
205
231
|
separator and `**` crosses it. They were matched with `fnmatch`, whose `*`
|
|
206
232
|
crosses separators, so a role or override written for the scripts in a
|
|
207
233
|
repository root silently claimed every file in the tree. Found while adopting
|
|
208
|
-
the baseline in
|
|
234
|
+
the baseline in consumer-a, where `entrypoint = ["*.py"]` matched all 106
|
|
209
235
|
files instead of the 40 at the root and hid 25 real `BPY002` findings.
|
|
210
236
|
|
|
211
237
|
## 0.1.0
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: syntopica-codeality-py
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.3
|
|
4
4
|
Summary: Structural linter and config scaffolder for Python: atomic files, placement, size caps, no inline SQL
|
|
5
5
|
Project-URL: Homepage, https://github.com/syntopica/codeality
|
|
6
6
|
Project-URL: Issues, https://github.com/syntopica/codeality/issues
|
|
@@ -82,6 +82,19 @@ rather than skipping it.
|
|
|
82
82
|
| `BPY005` | `barrel-only-init` | `__init__.py` holds imports, `__all__` and nothing else. |
|
|
83
83
|
| `BPY006` | `no-inline-sql` | SQL lives in resource files, not in string literals. |
|
|
84
84
|
|
|
85
|
+
## Suite time budget
|
|
86
|
+
|
|
87
|
+
```toml
|
|
88
|
+
# codeality-py.toml
|
|
89
|
+
test-budget-seconds = 300
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Past the budget a passing suite is a finding: the pytest stage reports
|
|
93
|
+
`over-budget`, exits 1, and its detail carries the slowest tests. The
|
|
94
|
+
procedure - profile, make the unit under test cheaper, parallelise, serialise
|
|
95
|
+
what must stay shared - is in
|
|
96
|
+
[docs/standards/testing.md](https://github.com/syntopica/codeality/blob/main/docs/standards/testing.md#suite-time-budget).
|
|
97
|
+
|
|
85
98
|
## Exit codes
|
|
86
99
|
|
|
87
100
|
| Code | Meaning |
|
|
@@ -39,6 +39,19 @@ rather than skipping it.
|
|
|
39
39
|
| `BPY005` | `barrel-only-init` | `__init__.py` holds imports, `__all__` and nothing else. |
|
|
40
40
|
| `BPY006` | `no-inline-sql` | SQL lives in resource files, not in string literals. |
|
|
41
41
|
|
|
42
|
+
## Suite time budget
|
|
43
|
+
|
|
44
|
+
```toml
|
|
45
|
+
# codeality-py.toml
|
|
46
|
+
test-budget-seconds = 300
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Past the budget a passing suite is a finding: the pytest stage reports
|
|
50
|
+
`over-budget`, exits 1, and its detail carries the slowest tests. The
|
|
51
|
+
procedure - profile, make the unit under test cheaper, parallelise, serialise
|
|
52
|
+
what must stay shared - is in
|
|
53
|
+
[docs/standards/testing.md](https://github.com/syntopica/codeality/blob/main/docs/standards/testing.md#suite-time-budget).
|
|
54
|
+
|
|
42
55
|
## Exit codes
|
|
43
56
|
|
|
44
57
|
| Code | Meaning |
|
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "syntopica-codeality-py"
|
|
7
|
-
version = "0.2.
|
|
7
|
+
version = "0.2.3"
|
|
8
8
|
description = "Structural linter and config scaffolder for Python: atomic files, placement, size caps, no inline SQL"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.11"
|
|
@@ -17,6 +17,8 @@ jobs:
|
|
|
17
17
|
python-version: ['3.11', '3.13']
|
|
18
18
|
steps:
|
|
19
19
|
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
|
|
20
|
+
with:
|
|
21
|
+
persist-credentials: false
|
|
20
22
|
|
|
21
23
|
- name: Install uv
|
|
22
24
|
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7.6.0
|
|
@@ -4,6 +4,9 @@ source-roots = ["src"]
|
|
|
4
4
|
test-roots = ["tests"]
|
|
5
5
|
respect-gitignore = true
|
|
6
6
|
coverage-threshold = 80
|
|
7
|
+
# The gate reports the pytest stage as over-budget past this many seconds.
|
|
8
|
+
# A suite that grows past it gets profiled, not more hardware.
|
|
9
|
+
test-budget-seconds = 300
|
|
7
10
|
|
|
8
11
|
[limits]
|
|
9
12
|
max-file-lines = 150
|
|
@@ -6,12 +6,16 @@
|
|
|
6
6
|
known_first_party = ["CHANGE_ME"]
|
|
7
7
|
|
|
8
8
|
[tool.deptry.per_rule_ignores]
|
|
9
|
-
|
|
9
|
+
# pytest-xdist is a pytest plugin, loaded by the -n in addopts, never imported.
|
|
10
|
+
DEP002 = ["pytest-xdist"]
|
|
10
11
|
# Test tooling legitimately lives in a dev group and is imported only by tests.
|
|
11
12
|
DEP004 = ["pytest", "pytest_asyncio", "pytest_cov"]
|
|
12
13
|
|
|
14
|
+
# One worker per core from the first test, so the suite is written isolated:
|
|
15
|
+
# a test that needs a shared port, file or process serialises on a lock in the
|
|
16
|
+
# code that uses it, never by ordering. `-n 0` runs in-process for a debugger.
|
|
13
17
|
[tool.pytest.ini_options]
|
|
14
|
-
addopts = "-ra"
|
|
18
|
+
addopts = "-ra -n auto"
|
|
15
19
|
testpaths = ["tests"]
|
|
16
20
|
|
|
17
21
|
[tool.coverage.run]
|
|
@@ -30,5 +34,6 @@ quality = [
|
|
|
30
34
|
"pip-audit>=2.7,<3",
|
|
31
35
|
"pytest>=8,<10",
|
|
32
36
|
"pytest-cov>=5,<8",
|
|
37
|
+
"pytest-xdist>=3,<4",
|
|
33
38
|
"ruff>=0.15,<1",
|
|
34
39
|
]
|
|
@@ -25,3 +25,6 @@ class BaselineConfig:
|
|
|
25
25
|
import_package: str | None = None
|
|
26
26
|
coverage_threshold: int = 0
|
|
27
27
|
audit_ignore_vulns: tuple[str, ...] = ()
|
|
28
|
+
# Seconds the pytest stage may take before the gate reports it. Zero
|
|
29
|
+
# leaves the suite unbudgeted.
|
|
30
|
+
test_budget_seconds: int = 0
|
{syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/config/load_config.py
RENAMED
|
@@ -25,6 +25,7 @@ _TOP_LEVEL_KEYS = {
|
|
|
25
25
|
"sql-resource-globs",
|
|
26
26
|
"import-package",
|
|
27
27
|
"coverage-threshold",
|
|
28
|
+
"test-budget-seconds",
|
|
28
29
|
"limits",
|
|
29
30
|
"audit",
|
|
30
31
|
"roles",
|
|
@@ -61,4 +62,5 @@ def load_config(project_root: Path) -> BaselineConfig:
|
|
|
61
62
|
import_package=document.get("import-package"),
|
|
62
63
|
coverage_threshold=int(document.get("coverage-threshold", 0)),
|
|
63
64
|
audit_ignore_vulns=tuple(audit.get("ignore-vulns", ())),
|
|
65
|
+
test_budget_seconds=int(document.get("test-budget-seconds", 0)),
|
|
64
66
|
)
|
{syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/gate/gate_result.py
RENAMED
|
@@ -6,6 +6,9 @@ from codeality_py.gate.stage_result import StageResult
|
|
|
6
6
|
from codeality_py.gate.stage_status import StageStatus
|
|
7
7
|
from codeality_py.report.exit_code import ExitCode
|
|
8
8
|
|
|
9
|
+
# A suite past its budget exits like any other finding: it is one.
|
|
10
|
+
_FINDINGS = (StageStatus.FINDINGS, StageStatus.OVER_BUDGET)
|
|
11
|
+
|
|
9
12
|
|
|
10
13
|
@dataclass(frozen=True, slots=True)
|
|
11
14
|
class GateResult:
|
|
@@ -18,6 +21,6 @@ class GateResult:
|
|
|
18
21
|
blocking = [stage for stage in self.stages if stage.kind.value == "required"]
|
|
19
22
|
if any(stage.status is StageStatus.FAILED_TO_RUN for stage in blocking):
|
|
20
23
|
return ExitCode.INFRASTRUCTURE
|
|
21
|
-
if any(stage.status
|
|
24
|
+
if any(stage.status in _FINDINGS for stage in blocking):
|
|
22
25
|
return ExitCode.FINDINGS
|
|
23
26
|
return ExitCode.OK
|
{syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/gate/gate_stages.py
RENAMED
|
@@ -12,6 +12,10 @@ def gate_stages(config: BaselineConfig) -> tuple[Stage, ...]:
|
|
|
12
12
|
Coverage is collected rather than merely configured. pip-audit audits the
|
|
13
13
|
installed environment, which the CI workflow builds with "uv sync
|
|
14
14
|
--locked", so what is audited is exactly what the lockfile pins.
|
|
15
|
+
|
|
16
|
+
pytest reports its slowest tests every run, so a suite that goes over its
|
|
17
|
+
budget hands the reader the measurement in the same output, and a suite
|
|
18
|
+
creeping towards it is visible before it gets there.
|
|
15
19
|
"""
|
|
16
20
|
roots = [*config.source_roots, *config.test_roots]
|
|
17
21
|
package = config.import_package or config.source_roots[0]
|
|
@@ -44,7 +48,9 @@ def gate_stages(config: BaselineConfig) -> tuple[Stage, ...]:
|
|
|
44
48
|
f"--cov={package}",
|
|
45
49
|
"--cov-report=term-missing",
|
|
46
50
|
f"--cov-fail-under={config.coverage_threshold}",
|
|
51
|
+
"--durations=10",
|
|
47
52
|
),
|
|
53
|
+
budget_seconds=float(config.test_budget_seconds),
|
|
48
54
|
),
|
|
49
55
|
Stage("pyrefly", StageKind.SHADOW, ("pyrefly", "check")),
|
|
50
56
|
)
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"""What the report says about a stage that passed too slowly."""
|
|
2
|
+
|
|
3
|
+
from codeality_py.gate.stage import Stage
|
|
4
|
+
|
|
5
|
+
# The suite-time procedure: profile the slowest tests, make the unit under
|
|
6
|
+
# test cheaper, then parallelise, then serialise what must stay shared.
|
|
7
|
+
PROCEDURE_URL = (
|
|
8
|
+
"https://github.com/syntopica/codeality/blob/main/docs/standards/testing.md#suite-time-budget"
|
|
9
|
+
)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def over_budget_detail(stage: Stage, elapsed: float, output: str) -> str:
|
|
13
|
+
"""Return the detail for a stage that succeeded past its budget.
|
|
14
|
+
|
|
15
|
+
It carries the last part of the stage's own output, which for pytest run
|
|
16
|
+
with ``--durations`` is the table of the slowest tests, so the reader
|
|
17
|
+
starts from the measurement rather than from the exit code.
|
|
18
|
+
"""
|
|
19
|
+
header = (
|
|
20
|
+
f"{stage.name} passed in {elapsed:.1f}s, over its budget of "
|
|
21
|
+
f"{stage.budget_seconds:g}s. Profile before adding hardware: {PROCEDURE_URL}"
|
|
22
|
+
)
|
|
23
|
+
tail = output[-2000:].strip()
|
|
24
|
+
return f"{header}\n{tail}" if tail else header
|
{syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/gate/run_gate.py
RENAMED
|
@@ -7,7 +7,7 @@ from codeality_py.gate.run_stage import run_stage
|
|
|
7
7
|
from codeality_py.gate.stage_kind import StageKind
|
|
8
8
|
from codeality_py.gate.stage_status import StageStatus
|
|
9
9
|
|
|
10
|
-
_BLOCKED = (StageStatus.FINDINGS, StageStatus.FAILED_TO_RUN)
|
|
10
|
+
_BLOCKED = (StageStatus.FINDINGS, StageStatus.OVER_BUDGET, StageStatus.FAILED_TO_RUN)
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
def run_gate(config: BaselineConfig, fail_fast: bool) -> GateResult:
|
{syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/gate/run_stage.py
RENAMED
|
@@ -6,6 +6,7 @@ import time
|
|
|
6
6
|
from pathlib import Path
|
|
7
7
|
|
|
8
8
|
from codeality_py.gate.build_stage_result import build_stage_result
|
|
9
|
+
from codeality_py.gate.over_budget_detail import over_budget_detail
|
|
9
10
|
from codeality_py.gate.stage import Stage
|
|
10
11
|
from codeality_py.gate.stage_kind import StageKind
|
|
11
12
|
from codeality_py.gate.stage_result import StageResult
|
|
@@ -49,4 +50,10 @@ def run_stage(stage: Stage, project_root: Path) -> StageResult:
|
|
|
49
50
|
part.strip() for part in (completed.stdout, completed.stderr) if part.strip()
|
|
50
51
|
)
|
|
51
52
|
detail = "" if completed.returncode == 0 else output[-2000:]
|
|
53
|
+
# A suite that passes but takes longer than it may is a finding of its
|
|
54
|
+
# own: the tail of its output holds pytest's slowest-durations table,
|
|
55
|
+
# which is where fixing it starts.
|
|
56
|
+
if status is StageStatus.PASSED and 0.0 < stage.budget_seconds < elapsed:
|
|
57
|
+
status = StageStatus.OVER_BUDGET
|
|
58
|
+
detail = over_budget_detail(stage, elapsed, output)
|
|
52
59
|
return build_stage_result(stage, status, completed.returncode, elapsed, detail)
|
{syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/tests/config/test_load_config.py
RENAMED
|
@@ -86,3 +86,13 @@ def test_an_unknown_rule_code_in_an_override_is_fatal(tmp_path: Path) -> None:
|
|
|
86
86
|
)
|
|
87
87
|
with pytest.raises(ConfigError, match="unknown rule code"):
|
|
88
88
|
load_config(tmp_path)
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
def test_the_suite_is_unbudgeted_unless_the_project_says_otherwise(tmp_path: Path) -> None:
|
|
92
|
+
(tmp_path / "src").mkdir()
|
|
93
|
+
assert load_config(tmp_path).test_budget_seconds == 0
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
def test_the_test_budget_is_read(tmp_path: Path) -> None:
|
|
97
|
+
_write(tmp_path, "schema-version = 1\ntest-budget-seconds = 300\n")
|
|
98
|
+
assert load_config(tmp_path).test_budget_seconds == 300
|
{syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/tests/gate/test_gate_stages.py
RENAMED
|
@@ -67,3 +67,16 @@ def test_a_missing_required_tool_still_fails_to_run(tmp_path: Path) -> None:
|
|
|
67
67
|
result = run_stage(stage, tmp_path)
|
|
68
68
|
assert result.status is StageStatus.FAILED_TO_RUN
|
|
69
69
|
assert result.exit_code == 127
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
def test_pytest_reports_its_slowest_tests_on_every_run() -> None:
|
|
73
|
+
"""The measurement a slow suite is fixed from is in the output already."""
|
|
74
|
+
config = BaselineConfig(project_root=Path("/p"), import_package="demo")
|
|
75
|
+
assert "--durations=10" in _commands(config)["pytest"]
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
def test_the_test_budget_reaches_the_pytest_stage_and_no_other() -> None:
|
|
79
|
+
config = BaselineConfig(project_root=Path("/p"), test_budget_seconds=300)
|
|
80
|
+
budgets = {stage.name: stage.budget_seconds for stage in gate_stages(config)}
|
|
81
|
+
assert budgets["pytest"] == 300.0
|
|
82
|
+
assert all(budget == 0.0 for name, budget in budgets.items() if name != "pytest")
|
|
@@ -83,3 +83,38 @@ def test_a_failing_stage_keeps_what_it_wrote_to_stderr(tmp_path: Path) -> None:
|
|
|
83
83
|
assert result.status is StageStatus.FINDINGS
|
|
84
84
|
assert "found on stdout" in result.detail
|
|
85
85
|
assert "found on stderr" in result.detail
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
def test_a_passing_stage_past_its_budget_is_over_budget(tmp_path: Path) -> None:
|
|
89
|
+
"""2026-09-22: a consumer's suite had grown to 31 minutes and every gate
|
|
90
|
+
was green, because a slow suite was not a finding. One profiling pass
|
|
91
|
+
found that a checker re-parsed the same file 620 951 times per run and
|
|
92
|
+
took it to four minutes; parallel workers took it to 32 seconds. The
|
|
93
|
+
gate has to be what says the number is too big.
|
|
94
|
+
"""
|
|
95
|
+
stage = Stage("sleep", StageKind.REQUIRED, ("sleep", "0.2"), budget_seconds=0.05)
|
|
96
|
+
result = run_stage(stage, tmp_path)
|
|
97
|
+
assert result.status is StageStatus.OVER_BUDGET
|
|
98
|
+
assert result.exit_code == 0
|
|
99
|
+
assert "over its budget of 0.05s" in result.detail
|
|
100
|
+
assert "testing.md#suite-time-budget" in result.detail
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
def test_an_unbudgeted_stage_passes_however_long_it_takes(tmp_path: Path) -> None:
|
|
104
|
+
result = run_stage(Stage("sleep", StageKind.REQUIRED, ("sleep", "0.05")), tmp_path)
|
|
105
|
+
assert result.status is StageStatus.PASSED
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
def test_a_failing_stage_past_its_budget_reports_the_failure(tmp_path: Path) -> None:
|
|
109
|
+
stage = Stage("false", StageKind.REQUIRED, ("false",), budget_seconds=0.000001)
|
|
110
|
+
assert run_stage(stage, tmp_path).status is StageStatus.FINDINGS
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
def test_over_budget_in_a_required_stage_exits_1() -> None:
|
|
114
|
+
result = GateResult(stages=(_stage_result(StageKind.REQUIRED, StageStatus.OVER_BUDGET),))
|
|
115
|
+
assert result.exit_code() is ExitCode.FINDINGS
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
def test_over_budget_in_a_shadow_stage_does_not_fail_the_gate() -> None:
|
|
119
|
+
result = GateResult(stages=(_stage_result(StageKind.SHADOW, StageStatus.OVER_BUDGET),))
|
|
120
|
+
assert result.exit_code() is ExitCode.OK
|
|
@@ -170,3 +170,26 @@ def test_a_ruff_toml_alone_is_not_a_conflict(tmp_path: Path) -> None:
|
|
|
170
170
|
(tmp_path / "pyproject.toml").write_text('[project]\nname = "demo"\n', encoding="utf-8")
|
|
171
171
|
dispositions = _dispositions(plan_init(tmp_path, "lib", with_ci=False))
|
|
172
172
|
assert dispositions["ruff.toml"] is PlanDisposition.CREATE
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
def test_a_new_project_runs_its_suite_on_every_core(tmp_path: Path) -> None:
|
|
176
|
+
"""A suite written parallel from its first test stays isolated; one
|
|
177
|
+
retrofitted later finds every shared port, file and process the hard way.
|
|
178
|
+
"""
|
|
179
|
+
(tmp_path / "pyproject.toml").write_text('[project]\nname = "demo"\n', encoding="utf-8")
|
|
180
|
+
plan = plan_init(tmp_path, "lib", with_ci=False)
|
|
181
|
+
pyproject = next(item for item in plan if item.path.name == "pyproject.toml").content
|
|
182
|
+
assert 'addopts = "-ra -n auto"' in pyproject
|
|
183
|
+
assert '"pytest-xdist>=3,<4"' in pyproject
|
|
184
|
+
assert 'DEP002 = ["pytest-xdist"]' in pyproject
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
def test_a_project_with_its_own_pytest_table_keeps_it(tmp_path: Path) -> None:
|
|
188
|
+
(tmp_path / "pyproject.toml").write_text(
|
|
189
|
+
'[project]\nname = "demo"\n\n[tool.pytest.ini_options]\naddopts = "-q"\n',
|
|
190
|
+
encoding="utf-8",
|
|
191
|
+
)
|
|
192
|
+
plan = plan_init(tmp_path, "lib", with_ci=False)
|
|
193
|
+
pyproject = next(item for item in plan if item.path.name == "pyproject.toml").content
|
|
194
|
+
assert 'addopts = "-q"' in pyproject
|
|
195
|
+
assert "-n auto" not in pyproject
|
{syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/tests/init/test_render_asset.py
RENAMED
|
@@ -94,11 +94,11 @@ def test_the_workflow_listens_on_the_checked_out_branch(tmp_path: Path) -> None:
|
|
|
94
94
|
|
|
95
95
|
|
|
96
96
|
def test_a_nested_project_finds_the_enclosing_repository(tmp_path: Path) -> None:
|
|
97
|
-
_checked_out(tmp_path, "
|
|
98
|
-
nested = tmp_path / "tools" / "
|
|
97
|
+
_checked_out(tmp_path, "nested-tool")
|
|
98
|
+
nested = tmp_path / "tools" / "nested-tool"
|
|
99
99
|
nested.mkdir(parents=True)
|
|
100
100
|
rendered = render_asset(read_asset("codeality-py-ci.yml"), nested)
|
|
101
|
-
assert "branches: [
|
|
101
|
+
assert "branches: [nested-tool]" in rendered
|
|
102
102
|
|
|
103
103
|
|
|
104
104
|
def test_a_detached_head_keeps_main(tmp_path: Path) -> None:
|
|
@@ -110,23 +110,24 @@ def test_a_detached_head_keeps_main(tmp_path: Path) -> None:
|
|
|
110
110
|
|
|
111
111
|
def test_a_nested_project_runs_its_workflow_from_its_directory(tmp_path: Path) -> None:
|
|
112
112
|
(tmp_path / ".git").mkdir()
|
|
113
|
-
nested = tmp_path / "tools" / "
|
|
113
|
+
nested = tmp_path / "tools" / "nested-tool"
|
|
114
114
|
nested.mkdir(parents=True)
|
|
115
115
|
rendered = render_asset(read_asset("codeality-py-ci.yml"), nested)
|
|
116
|
-
assert "working-directory: tools/
|
|
117
|
-
assert "path: tools/
|
|
116
|
+
assert "working-directory: tools/nested-tool" in rendered
|
|
117
|
+
assert "path: tools/nested-tool/pyrefly.json" in rendered
|
|
118
118
|
|
|
119
119
|
|
|
120
120
|
def test_a_nested_workflow_is_planned_at_the_repository_root(tmp_path: Path) -> None:
|
|
121
121
|
(tmp_path / ".git").mkdir()
|
|
122
|
-
nested = tmp_path / "tools" / "
|
|
122
|
+
nested = tmp_path / "tools" / "nested-tool"
|
|
123
123
|
nested.mkdir(parents=True)
|
|
124
|
-
(nested / "pyproject.toml").write_text('[project]\nname = "
|
|
124
|
+
(nested / "pyproject.toml").write_text('[project]\nname = "nested-tool"\n', encoding="utf-8")
|
|
125
125
|
workflow = next(
|
|
126
126
|
managed.path
|
|
127
127
|
for managed in plan_init(nested, "lib", with_ci=True)
|
|
128
128
|
if ".github" in str(managed.path)
|
|
129
129
|
)
|
|
130
130
|
assert (
|
|
131
|
-
workflow.resolve()
|
|
131
|
+
workflow.resolve()
|
|
132
|
+
== (tmp_path / ".github" / "workflows" / "quality-nested-tool.yml").resolve()
|
|
132
133
|
)
|
{syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/tests/roles/test_matches_glob.py
RENAMED
|
@@ -33,6 +33,6 @@ def test_not_matching(path: str, pattern: str) -> None:
|
|
|
33
33
|
|
|
34
34
|
|
|
35
35
|
def test_a_root_only_pattern_does_not_claim_the_whole_tree() -> None:
|
|
36
|
-
"""The
|
|
36
|
+
"""The consumer-a case: entrypoint = ["*.py"] meant the 40 root scripts."""
|
|
37
37
|
assert matches_glob("autoclean.py", "*.py")
|
|
38
38
|
assert not matches_glob("facturas/invoice.py", "*.py")
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/assets/mypy.ini
RENAMED
|
File without changes
|
{syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/assets/ruff.toml
RENAMED
|
File without changes
|
{syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/baseline/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/commands/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/config/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/config/limits.py
RENAMED
|
File without changes
|
{syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/config/module_role.py
RENAMED
|
File without changes
|
{syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/config/override.py
RENAMED
|
File without changes
|
|
File without changes
|
{syntopica_codeality_py-0.2.1 → syntopica_codeality_py-0.2.3}/src/codeality_py/config/parse_roles.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|