Skip to content

docs: add guide for using pixi with lefthook, pre-commit, and prek (#…#5891

Open
Yacine-DH wants to merge 10 commits intoprefix-dev:mainfrom
Yacine-DH:docs/git-hooks
Open

docs: add guide for using pixi with lefthook, pre-commit, and prek (#…#5891
Yacine-DH wants to merge 10 commits intoprefix-dev:mainfrom
Yacine-DH:docs/git-hooks

Conversation

@Yacine-DH
Copy link
Copy Markdown

Description

This PR adds a new documentation guide explaining how to integrate pixi with popular git hook managers, specifically lefthook, pre-commit, and prek.

Motivation and Context:
Currently, many developers use tools like pre-commit which, by default, download duplicate toolchains and create isolated virtual environments for every hook. This guide shows users how to configure these tools to use language: system and repo: local (or their equivalents) to route commands directly through pixi run. This ensures the development team uses the exact same tool versions defined in pixi.toml without the overhead of downloading duplicate virtual environments.

Fixes #5883

How Has This Been Tested?

  • Verified the Markdown formatting and syntax for all code blocks (yaml, toml, shell).
  • Built the documentation locally using mkdocs serve to ensure the new page renders correctly in the navigation sidebar.

AI Disclosure

  • This PR contains AI-generated content.
    • I have tested any AI-generated content in my PR.
    • I take responsibility for any AI-generated content in my PR.

Tools: Google Gemini

I used Gemini to help me understand the technical difference between standard git hooks and `pixi run`, and to help draft the Markdown documentation for configuring lefthook, pre-commit, and prek.

@ruben-arts
Copy link
Copy Markdown
Contributor

I like the addition, did you test the configurations you promote with the tools?

@Yacine-DH
Copy link
Copy Markdown
Author

Yacine-DH commented Apr 13, 2026

Yes, I just verified again the configurations locally to be absolutely sure.
The lefthook example is based on this repository's own setup. I created a dummy project, set up pre-commit and prek with pixi, and verified that the YAML configurations successfully trigger pixi run ruff locally and It ran instantly without trying to build its own isolated environments .

Comment thread docs/integration/third_party/git_hooks.md Outdated
Comment thread docs/integration/third_party/git_hooks.md Outdated
Comment thread docs/integration/third_party/git_hooks.md
Comment thread docs/integration/third_party/git_hooks.md Outdated
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.

Add section about lefthook/pre-commit/prek with pixi

4 participants