Skip to content

Fix CI mypy errors and add pre-commit hooks#2

Merged
HanssonMagnus merged 3 commits intomainfrom
fix/ci-mypy-errors-and-pre-commit-hooks
Nov 9, 2025
Merged

Fix CI mypy errors and add pre-commit hooks#2
HanssonMagnus merged 3 commits intomainfrom
fix/ci-mypy-errors-and-pre-commit-hooks

Conversation

@HanssonMagnus
Copy link
Copy Markdown
Owner

Fixes #1

This PR fixes the CI pipeline failures and adds pre-commit hooks to run the full CI pipeline locally.

Changes

  • Fix mypy type errors: Changed Optional[click.DateTime] to Optional[datetime.datetime] in CLI functions
  • Fix import sorting: Reorganized imports in converter modules (datetime before typing)
  • Remove unused import: Removed unused convert_pdfs import from test_workflow.py
  • Add pre-commit hooks: Created .pre-commit-config.yaml with hooks matching CI pipeline:
    • pytest
    • mypy
    • black
    • isort
    • ruff
  • Add pre-commit to dev dependencies: Added pre-commit>=3.0.0 to pyproject.toml
  • Documentation: Added comprehensive pre-commit hooks section to README

Verification

All pre-commit hooks pass:

  • ✅ pytest
  • ✅ mypy
  • ✅ black
  • ✅ isort
  • ✅ ruff

This ensures the CI pipeline will pass and developers can catch issues locally before pushing.

- Fix type annotations: change Optional[click.DateTime] to Optional[datetime.datetime]
- Fix import sorting in converters (datetime before typing)
- Remove unused import in test_workflow.py
- Add .pre-commit-config.yaml with hooks matching CI pipeline
- Add pre-commit to dev dependencies
- Add pre-commit hooks documentation to README
- Format code with black
These scripts are now redundant since pre-commit hooks run all the same checks.
Pre-commit hooks provide a better developer experience and ensure consistency.
@HanssonMagnus HanssonMagnus merged commit 2a45528 into main Nov 9, 2025
3 checks passed
@HanssonMagnus HanssonMagnus deleted the fix/ci-mypy-errors-and-pre-commit-hooks branch November 9, 2025 10:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CI failing after recent commit

1 participant