Skip to content

Conversation

@piotrmaciejbednarski
Copy link
Contributor

@piotrmaciejbednarski piotrmaciejbednarski commented Aug 2, 2025

This change migrates from simple-git-hooks to pre-commit for code quality checks, consolidates separate Rust and Bun CI workflows into a single pre-commit workflow, and applies consistent formatting across the codebase.

Changes

  • CI/CD Migration: Removed separate rust.yml and bun.yml workflows, replaced with unified pre-commit.yml workflow
  • Dependency management: Removed simple-git-hooks package dependency and related npm scripts
  • Pre-commit configuration: Added .pre-commit-config.yaml with hooks for Rust (fmt, check), TypeScript (biome, typecheck), and commit message validation
  • Development environment: Added Python 3.8 to .tool-versions and .venv/ to .gitignore
  • Code formatting: Applied consistent whitespace formatting across multiple files (removed trailing spaces, added missing newlines)

Impact

  • Development workflow: Developers must now install pre-commit hooks locally for code quality enforcement
  • CI/CD simplification: Single workflow replaces multiple language-specific CI jobs, reducing maintenance overhead
  • Tool dependencies: Adds Python as a required development dependency for pre-commit functionality
  • Code quality: Enforces consistent formatting and linting standards across Rust and TypeScript codebases
  • Documentation updates: Modified CONTRIBUTING.md to reflect new pre-commit setup requirements
$ pre-commit run --all-files

trim trailing whitespace.................................................Passed
fix end of files.........................................................Passed
check yaml...............................................................Passed
check toml...............................................................Passed
check json...............................................................Passed
check for merge conflicts................................................Passed
Rust format (workspace)..................................................Passed
Rust check (workspace)...................................................Passed
TypeScript check.........................................................Passed
Biome check..............................................................Passed

Related Issues

Closes #216

- Configure pre-commit with rustfmt, TypeScript checking, and Biome linting
- Replace separate Rust CI and Bun CI workflows with unified pre-commit workflow
- Add automatic pre-commit installation via postinstall script
- Include commit message validation via commitlint
- Optimize for fast CI execution (format-only checks)
@piotrmaciejbednarski
Copy link
Contributor Author

Looks like we can go ahead and merge this

@mehmetozguldev mehmetozguldev self-requested a review August 2, 2025 11:18
@SnaetWarre
Copy link
Contributor

@mehmetozguldev

Copy link
Contributor

@SnaetWarre SnaetWarre left a comment

Choose a reason for hiding this comment

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

Do we want to bring python in here tho? Can you clarify more why this is a needed change?

I'm not really home in this, can you tell me why we should bring these changes?

@piotrmaciejbednarski
Copy link
Contributor Author

Do we want to bring python in here tho? Can you clarify more why this is a needed change?

I'm not really home in this, can you tell me why we should bring these changes?

Python is only used for pre-commit integration, and it actually comes preinstalled on most systems. Also, it’s just a development dependency. This setup is common in hybrid projects that use multiple languages.

The change lets us use more advanced git hooks, which simple-git-hooks doesn’t support. Plus, it comes with ready-to-use hooks from the creator, and they’re kept up to date - including support for the latest Conventional Commits spec.

@piotrmaciejbednarski
Copy link
Contributor Author

Also, this pull request fixes the CI workflow, which is super important. pre-commit is built for multi-language projects and is super popular - even the description says: "A framework for managing and maintaining multi-language pre-commit hooks."

Plus, a lot of devs recommend it for Rust projects:

So it's nothing weird or unusual.

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.

Replace simple-git-hooks with better pre-commit

3 participants