Skip to content

chore: configure pre-commit hooks and format repository - #467

Open
mbohlool wants to merge 2 commits into
mainfrom
precommit-setup
Open

chore: configure pre-commit hooks and format repository#467
mbohlool wants to merge 2 commits into
mainfrom
precommit-setup

Conversation

@mbohlool

Copy link
Copy Markdown
Collaborator

Description

This PR introduces pre-commit to the repository to automate code formatting, linting, and git hygiene across commits.

Key Changes

  1. Pre-commit Configuration (.pre-commit-config.yaml):

    • General Hygiene Hooks: Added trailing-whitespace, end-of-file-fixer, check-yaml, check-added-large-files, and check-merge-conflict.
    • Ruff: Integrated ruff check --fix for fast Python linting and automatic fixes.
    • Pyink: Configured Pyink with repository standards (--pyink-indentation=2 --line-length=125) for Google Python formatting.
    • Pylint: Configured pylint --fail-under=7 on Python files in src/maxdiffusion and end_to_end matching CI criteria.
  2. Repository Fixes & Cleanup:

    • Fixed duplicate YAML keys in base_xl.yml, base21.yml, and ltx2_video.yml that were causing YAML parser validation errors.
    • Updated .gitignore to track .pre-commit-config.yaml while ignoring .pre-commit-cache/.
    • Standardized whitespace, formatting, and EOF newlines across repository files.
  3. Documentation (README.md):

    • Added a Pre-commit Hooks setup guide under the Development section with instructions to activate the virtual environment before running pre-commit install.

Verification

  • Ran pre-commit run --all-files across all repository files — all hooks (trailing-whitespace, end-of-file-fixer, check-yaml, check-added-large-files, check-merge-conflict, ruff, pyink) pass cleanly.
  • Verified commit workflow with active .git/hooks/pre-commit.

@mbohlool
mbohlool requested a review from entrpn as a code owner August 25, 2026 23:33
@github-actions

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request introduces pre-commit hooks to automate code formatting and quality checks using pyink, ruff, pylint, and standard git hygiene checks, alongside minor whitespace and formatting cleanups across several configuration files and scripts. The feedback recommends using the official remote repository hook for pyink instead of a local system hook to ensure consistent, hermetic execution across different environments without requiring manual installation.

Comment thread .pre-commit-config.yaml Outdated
@mbohlool
mbohlool force-pushed the precommit-setup branch 2 times, most recently from 5bea9ad to 887a606 Compare August 25, 2026 23:38
- Add .pre-commit-config.yaml with trailing-whitespace, end-of-file-fixer, check-yaml, ruff, pyink, and pylint
- Update .gitignore to track .pre-commit-config.yaml
- Add pre-commit setup and venv instructions to README.md
- Fix duplicate YAML keys in base_xl.yml, base21.yml, and ltx2_video.yml
- Auto-format utils/update_dependency_table.py with pyink
- Fix trailing whitespace and missing EOF newlines across repository files
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.

2 participants