Skip to content

Improve Makefile and add pre-commit hooks#24

Merged
rezkam merged 5 commits intomainfrom
chore/makefile-and-hooks
Dec 14, 2025
Merged

Improve Makefile and add pre-commit hooks#24
rezkam merged 5 commits intomainfrom
chore/makefile-and-hooks

Conversation

@rezkam
Copy link
Copy Markdown
Owner

@rezkam rezkam commented Dec 14, 2025

Summary

  • Consolidate all Makefile documentation commands into main Makefile
  • Remove docs/sphinx/Makefile (all functionality moved to main Makefile)
  • Add automated pre-commit hooks for code quality enforcement

Changes

Makefile Improvements

  • Move Sphinx build commands from docs/sphinx/Makefile to main Makefile
  • Add Sphinx variables (SPHINXBUILD, SOURCEDIR, BUILDDIR) to main Makefile
  • Update docs target to call sphinx-build directly
  • Remove docs-clean target (clean command now handles everything)
  • Enhance clean target to remove all build and documentation artifacts
  • Delete docs/sphinx/Makefile completely

Pre-commit Hook

  • Add pre-commit hook in .githooks/ directory that automatically runs:
    • Auto-formatting with black and isort
    • Linting with flake8
    • Type checking with mypy
    • Full test suite with pytest
  • Add make setup-hooks command to configure git hooks path
  • Use core.hooksPath approach for version-controlled hooks

Setup

Developers need to run make setup-hooks once after cloning to enable the pre-commit hook.

Test plan

  • Makefile commands work correctly
  • Pre-commit hook runs successfully on commit
  • All quality checks pass (formatting, linting, type checking, tests)

- Move Sphinx build commands from docs/sphinx/Makefile to main Makefile
- Add Sphinx variables (SPHINXBUILD, SOURCEDIR, BUILDDIR) to main Makefile
- Update docs and docs-clean targets to call sphinx-build directly
- Enhance clean target to include Sphinx documentation cleanup
- Add pre-commit hook in .githooks/ directory that runs:
  - Auto-formatting with black and isort
  - Linting with flake8
  - Type checking with mypy
  - Full test suite with pytest
- Add 'make setup-hooks' command to configure git hooks path
- Use core.hooksPath approach for version-controlled hooks
- Remove docs-clean target from main Makefile (clean command handles everything)
- Delete docs/sphinx/Makefile (all functionality moved to main Makefile)
- Update clean command description to reflect it cleans all artifacts
- Add docs-linkcheck target to Makefile
- Update GitHub workflow to use make docs instead of cd docs/sphinx && make html
- Update linkcheck to use make docs-linkcheck
- Fixes CI build failure after removing docs/sphinx/Makefile
@rezkam rezkam merged commit 2b185b5 into main Dec 14, 2025
22 checks passed
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.

1 participant