Spaces:
Build error
Contributing to PageParse
Thank you for your interest in contributing to PageParse! Since we are building an offline-first, CPU-only engine for parsing handwriting, we hold our code quality to high standards.
Code Quality Standards
Before submitting any code changes, ensure your environment is fully compliant with our local quality gates:
Linting and Formatting: We enforce formatting using
ruffandruff-format. Code style rules are defined in pyproject.toml.Type Safety: We use strict type checking via
mypy. All new functions and files must be fully typed.Security Analysis: All changes undergo static security analysis using
banditto prevent issues like command injections or insecure library usage. We also run credential scans to ensure no secrets are checked into the repo.Dependency Auditing: We run
pip-auditto guarantee that no dependencies with known CVEs are imported.
Development Workflow
Clone and Setup:
git clone https://code.swecha.org/centurions/pageparse.git cd pageparse python -m venv .venv source .venv/bin/activate pip install -e ".[dev]" pre-commit installBranching Strategy:
- Always branch off
main. - Name your branch descriptively, e.g.,
feat/printed-fallbackorfix/telemetry-memory.
- Always branch off
Conventional Commits: We enforce the Conventional Commits specification for all commit messages. Commits must follow this pattern:
<type>(<scope>): <description>Common types include:
feat: A new feature.fix: A bug fix.docs: Documentation updates.style: Code style changes (formatting, white-space, etc.).refactor: Code reorganization without behavior change.test: Adding or modifying tests.ci: CI/CD or build process updates.chore: Generic maintenance tasks.
Running Quality Checks Locally: Before committing, run:
# Run all formatters, linters, and type-checks pre-commit run --all-files # Run all unit and integration tests pytestSubmitting a Merge Request (MR): Once your local checks pass, push your branch and open an MR. Ensure that the self-hosted GitLab runner completes the CI pipeline successfully.