Skip to content

chore: add pre-commit configuration with Black formatter#496

Open
vidonnus wants to merge 1 commit intojellyfin:masterfrom
vidonnus:ci/pre-commit-lint
Open

chore: add pre-commit configuration with Black formatter#496
vidonnus wants to merge 1 commit intojellyfin:masterfrom
vidonnus:ci/pre-commit-lint

Conversation

@vidonnus
Copy link
Copy Markdown

@vidonnus vidonnus commented Jan 2, 2026

Add Pre-commit Configuration with Black Formatter

Summary

This PR adds pre-commit hooks to enforce code quality and consistent formatting across the codebase using Black and other automated checks.

Changes

New Files

  • .pre-commit-config.yaml - Pre-commit configuration with:
    • Black formatter (88 character line length)
    • Trailing whitespace removal
    • End-of-file newline fixer
    • YAML syntax validation
    • Large file detection
    • Merge conflict detection
    • Line ending normalization (LF)

Documentation Updates

  • CONTRIBUTING.md - Added "Code Style and Quality" section with:
    • Pre-commit installation instructions
    • List of automated checks
    • Workflow explanation

Code Formatting

  • Applied Black formatting across Python files
  • Removed trailing whitespace (22 files)
  • Fixed end-of-file newlines
  • Normalized spacing and formatting

Benefits

Consistent code style - Black ensures uniform formatting across all Python code
Automated quality checks - Catches common issues before commit
Reduced review friction - No more style debates or manual formatting fixes
Better git diffs - Clean file endings and consistent formatting
Easy onboarding - New contributors get instant feedback on code style

Testing

  • All pre-commit hooks pass successfully
  • No functional changes to code logic
  • Formatting changes are purely cosmetic

Installation for Contributors

pip install pre-commit
pre-commit install

Hooks will run automatically on git commit. To run manually:

pre-commit run --all-files

- Add .pre-commit-config.yaml with Black, trailing whitespace, and file
checks
- Update CONTRIBUTING.md with pre-commit setup instructions
- Apply Black formatting and end-of-file fixes across codebase
@vidonnus vidonnus changed the title 🔧 chore: add pre-commit configuration with Black formatter chore: add pre-commit configuration with Black formatter Jan 2, 2026
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