Skip to content

pre-commit → prek#710

Open
DimitriPapadopoulos wants to merge 1 commit intoReproNim:masterfrom
DimitriPapadopoulos:prek
Open

pre-commit → prek#710
DimitriPapadopoulos wants to merge 1 commit intoReproNim:masterfrom
DimitriPapadopoulos:prek

Conversation

@DimitriPapadopoulos
Copy link

Attempt to use prek instead of pre-commit.

This PR switches from pre-commit to prek mostly in CI.

Since prek is a drop-in replacement for pre-commit, either of them can be used on developers' computers, based on the same .pre-commit-config.yaml file, so that developer can change at their pace without disruption.

@gemini-code-assist
Copy link

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request updates the project's development tooling by replacing pre-commit with prek. The change aims to modernize the pre-commit hook management system, particularly within continuous integration workflows, while maintaining backward compatibility for local developer setups.

Highlights

  • Tooling Migration: The project has transitioned from using pre-commit to prek for managing pre-commit hooks, primarily impacting the CI environment.
  • Developer Flexibility: Developers can continue to use either prek or pre-commit locally, as prek is designed as a drop-in replacement, ensuring a smooth transition.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • README.md
    • Updated instructions to include prek install alongside pre-commit install for initializing pre-commit hooks.
  • pyproject.toml
    • Replaced pre-commit with prek in the dev dependency list.
Ignored Files
  • Ignored by pattern: .github/workflows/** (2)
    • .github/workflows/run_precommit.yml
    • .github/workflows/update_precommit_hooks.yml
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

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

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 transitions the project from using pre-commit to prek for pre-commit hooks. The changes update the developer documentation in README.md and the project dependencies in pyproject.toml. My review focuses on ensuring a smooth transition for developers. I've suggested an improvement to the README.md to clarify the change for developers setting up their environment. I've also suggested keeping both pre-commit and prek as development dependencies temporarily to align with the goal of a non-disruptive transition, as mentioned in the pull request description.

Note: Security Review has been skipped due to the limited scope of the PR.

```

Before committing changes, initialize `pre-commit` with `pre-commit install`. This will format code with each commit to keep the style consistent. _Neurodocker_ uses `black` for formatting.
Before committing changes, initialize `prek` with `prek install`, or `pre-commit` with `pre-commit install`. This will format code with each commit to keep the style consistent. _Neurodocker_ uses `black` for formatting.

Choose a reason for hiding this comment

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

medium

This phrasing could be confusing for developers, as pre-commit is no longer installed as a development dependency. It would be clearer to explicitly state that prek is the new default and that pre-commit must be installed separately if a developer wishes to use it.

Suggested change
Before committing changes, initialize `prek` with `prek install`, or `pre-commit` with `pre-commit install`. This will format code with each commit to keep the style consistent. _Neurodocker_ uses `black` for formatting.
Before committing changes, initialize `prek` with `prek install` (now a dev dependency), or `pre-commit` (if installed separately) with `pre-commit install`. This will format code with each commit to keep the style consistent. _Neurodocker_ uses `black` for formatting.

"coverage[toml]",
"mypy",
"pre-commit",
"prek",

Choose a reason for hiding this comment

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

medium

The PR description mentions that developers can switch at their own pace without disruption. By replacing pre-commit with prek, developers who reinstall their dependencies will lose pre-commit, which could be disruptive to their workflow. To allow for a smoother transition, consider including both pre-commit and prek in the development dependencies for a period of time.

Suggested change
"prek",
"pre-commit",
"prek",

@DimitriPapadopoulos DimitriPapadopoulos marked this pull request as ready for review March 4, 2026 01:03
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