Skip to content

Infra: Fixed files for pre-commit and added GH workflow for pre-commit - #802

Open
MonkeyCanCode wants to merge 4 commits into
apache:mainfrom
MonkeyCanCode:fix_for_pre_commit
Open

MonkeyCanCode wants to merge 4 commits into
apache:mainfrom
MonkeyCanCode:fix_for_pre_commit

Conversation

@MonkeyCanCode

@MonkeyCanCode MonkeyCanCode commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Follow up PR for #682 where now we re-format files for ruff rules and added a pre-commit hook in workflow.

Related Issues

Checklist

Specification

  • Spec changes are included in core-spec/ and follow the existing structure
  • Spec changes have a [DISCUSS] thread on dev@ with a stated end date, and reach lazy consensus (or pass a [VOTE]) before merge
  • Breaking changes to the spec are clearly called out in the summary
  • For a material spec change, docs/spec_changes.md records rationale, compatibility and migration impact, or the PR explains why no entry is needed

Ontology

  • Ontology changes in ontology/ are consistent with spec changes
  • New or modified terms are defined and documented

Converters

Validation

  • Validation rules in validation/ are updated if the spec changed
  • New validation cases are covered by tests

Documentation

  • docs/ is updated to reflect any user-facing changes
  • New features or behaviors are documented with examples where appropriate
  • CONTRIBUTING.md is updated if the contribution process changed

Examples

  • examples/ are added or updated for any new spec constructs

Tests

  • All existing tests pass (pytest / CI green)
  • New functionality is covered by tests

Compliance

  • ASF license headers are present on all new source files
  • New third-party dependencies follow Third-Party Dependencies
  • If third-party source code is vendored/copied (not just declared as a dependency), NOTICE and/or LICENSE have been updated per ASF policy

@MonkeyCanCode
MonkeyCanCode requested review from christianeu-db and jbonofre and a balanced review from Copilot and removed request for Copilot November 22, 2026 21:19
Copilot AI balanced review requested due to automatic review settings November 22, 2026 21:25

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The return documentation in validation/validate.py incorrectly implies that FILTER returns None, rather than an error message, and must distinguish it from a valid call without FILTER.

1 open issue
What changed in this PR

This follow-up to #682 brings the codebase into alignment with the existing pre-commit rules and adds automated enforcement through GitHub Actions.

Changes:

  • Adds a workflow that runs make pre-commit on pushes and pull requests to main.
  • Applies Ruff formatting, import cleanup, and Python syntax modernization; includes ost/src in Ruff’s source paths.
  • Preserves existing enum stringification with explicit lint exemptions and a regression test, alongside whitespace cleanup.
File Description
validation/​validate.py Formats validator code, revises docstrings, and simplifies caching.
validation/​tests/​test_vendor_validators.py Formats vendor-validator tests.
validation/​tests/​test_validate.py Formats tests and modernizes UTC and zip usage.
validation/​tests/​test_ontology.py Formats ontology and mapping tests.
validation/​tests/​test_generate_spec_types.py Formats generator tests and revises docstrings.
validation/​test_validate.py Formats loader and command-line tests.
scripts/​tests/​test_audit_spec_changes.py Organizes imports and formats audit tests.
scripts/​generate-spec-types.py Organizes imports and modernizes string formatting.
scripts/​audit-spec-changes.py Organizes imports and formats argument handling.
ruff.toml Adds ost/src to source paths.
python/​tests/​test_validation.py Organizes imports and formats validation tests.
python/​tests/​test_serialization.py Formats serialization tests and revises helper docstrings.
python/​tests/​test_models.py Adds enum stringification coverage and formats model tests.
python/​tests/​test_loading.py Formats YAML and JSON loading tests.
python/​tests/​test_ai_context_serialization.py Formats test signatures.
python/​src/​ossie/​models.py Modernizes type annotations while retaining existing enum behavior.
python/​src/​ossie/​__init__.py Sorts imports without changing exports.
ost/​tests/​test_runner.py Separates third-party and project imports.
ost/​tests/​test_parser.py Adjusts import spacing and assertion formatting.
ost/​tests/​test_cli.py Adjusts import spacing and call formatting.
DISCLAIMER Removes a trailing blank line.
core-spec/​expression_language.md Cleans trailing whitespace without changing specification text.
compliance/​portability/​grader/​test_grade.py Formats portability-grader tests.
compliance/​portability/​grader/​grade.py Formats grader code, revises docstrings, and simplifies caching.
.github/​workflows/​pre-commit-ci.yml Adds automated pre-commit checks using Python and uv.
.editorconfig Adds the final newline.

Review effort: Balanced

Comment thread validation/validate.py Resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants