Skip to content

Conversation

@jeipollack
Copy link
Contributor

@jeipollack jeipollack commented Dec 17, 2025

Summary

This PR introduces pre-commit hooks to enforce code quality and documentation formatting across the WaveDiff repository.

Closes #194

The configuration includes:

  • Ruff for linting and automatic fixes
  • blacken-docs for formatting Markdown and reStructuredText files
  • scriv reminder to create a fragment
  • Trailing-whitespace, YAML, and TOML checks
  • Changelog Management (custom hook):
    • check-scriv-fragment: Ensures a Scriv changelog fragment is added when modifiable files (.py, .md, .rst, .yaml) are changed
    • Only applies to non-documentation changes
    • Enforces changelog discipline for all PRs going forward
  • Global exclusions have been added to prevent formatting or linting of:
    • Jupyter notebooks (*.ipynb)
    • Historical directories under papers/

What’s Changed

  • .pre-commit-config.yaml updated with hooks and global exclude
  • Reformatted configuration and documentation files according to hooks
  • Corrected small syntax bugs discovered in API docs (v3.0.0) during rebase
  • Updated several files where minor formatting fixes were applied
  • No code logic was modified; all changes are formatting or configuration.

How to Test / Verify

  1. Install pre-commit if not already installed:
  • pip install pre-commit
  1. Install hooks:
  • pre-commit install
  1. Run hooks on all files:
  • pre-commit run --all-files
  1. Verify that:
  • No files under papers/ or Jupyter notebooks are modified
  • All .py, .md, .rst, .yaml, .toml files conform to the defined hooks

Scope

  • Repository-wide pre-commit hooks and formatting enforcement
  • Global exclusions prevent historical data and notebooks from being reformatted

Reviewer Notes

  • Ensure .pre-commit-config.yaml matches the project conventions and desired hooks
  • Confirm that global exclusions work as intended
  • CI will automatically enforce these hooks for future commits

Next Steps

  • After merge, all developers should run:
  • pre-commit install
  • Add/update instructions in CONTRIBUTING.md about pre-commit usage
  • Consider adding hooks to CI for push validation

@jeipollack jeipollack added the documentation Improvements or additions to documentation label Dec 17, 2025
@jeipollack jeipollack linked an issue Dec 17, 2025 that may be closed by this pull request
@jeipollack jeipollack changed the base branch from main to develop December 17, 2025 18:02
@jeipollack jeipollack self-assigned this Dec 17, 2025
Jennifer Pollack added 10 commits January 23, 2026 15:00
…ean up submodule docs, update conf.py, and update pyproject.toml version
- Removed old auto-generated wf_psf.rst from _autosummary
- Updated toc.rst (fixed tab issues, reference api.rst)
- Added api.rst with :recursive: directive and wf_psf.run entrypoint
- Refined __init__.py docstrings for all subpackages for clarity and consistency
- Updated module-level docstrings (purpose, authors, TensorFlow notes, etc.)
- Shorten sections to make developer-friendly
- Added new structure for each section: Purppose, Key Fields, Notes, General Notes, etc, where applicable
- Partial completion - new PR is required to verify optional versus required settings
- Added cross-references between config sections
- Clarified required fields for ground_truth_model.model_params
- Updated General Notes and reorganized section numbering
- Improved examples and directory structures
- Fixed build warnings due to missing anchors and code block lexing
…accidental modified code in utils.py; Fix ruff errors
@jeipollack jeipollack force-pushed the feature/194/add-pre-commit-hooks branch from 839516d to 04da26d Compare January 23, 2026 14:36
@jeipollack jeipollack changed the title Draft: Add pre-commit hooks for Ruff and blacken-docs with global exclusions Add pre-commit hooks for Ruff and blacken-docs with global exclusions Jan 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

Development

Successfully merging this pull request may close these issues.

Add pre-commit hooks for linting and documentation formatting

2 participants