Skip to content

black, flake8, isort → ruff#706

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

black, flake8, isort → ruff#706
DimitriPapadopoulos wants to merge 1 commit intoReproNim:masterfrom
DimitriPapadopoulos:ruff

Conversation

@DimitriPapadopoulos
Copy link

No description provided.

@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 modernizes the project's code quality setup by migrating from separate flake8 and isort tools to the unified ruff linter and formatter. This change simplifies the development environment, potentially speeds up pre-commit checks, and consolidates linting and import sorting under a single, high-performance tool. The update involves modifications to pre-commit configurations and project-level tool settings, along with minor adjustments to Python import statements to align with Ruff's enforcement.

Highlights

  • Linter and Formatter Migration: Replaced flake8 and isort with ruff for linting and import sorting, streamlining the code quality tooling.
  • Pre-commit Hooks Update: Updated .pre-commit-config.yaml to remove the old isort and flake8 hooks and integrate the new ruff-check hook.
  • Configuration Simplification: Removed the dedicated [tool.isort] section from pyproject.toml and configured ruff to handle isort rules, along with a specific file ignore.
  • Codebase Cleanup: Adjusted import statements in neurodocker/__init__.py and neurodocker/reproenv/__init__.py by removing unnecessary noqa: F401 comments and grouping imports for better readability, leveraging Ruff's capabilities.

🧠 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
  • .pre-commit-config.yaml
    • Removed isort pre-commit hook.
    • Removed flake8 pre-commit hook.
    • Added ruff-check pre-commit hook from astral-sh/ruff-pre-commit.
  • neurodocker/init.py
    • Removed noqa: F401 comment from neurodocker.reproenv import.
  • neurodocker/reproenv/init.py
    • Refactored multiple single-line import statements into grouped, parenthesized imports.
    • Removed noqa: F401 comments from several import statements.
  • pyproject.toml
    • Removed the [tool.isort] configuration section.
    • Added [tool.ruff.lint] configuration section.
    • Enabled isort rules (I) within Ruff's linting configuration.
    • Added a per-file ignore for neurodocker/reproenv/tests/test_state.py to ignore rule E714.
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 migrates the project from flake8 and isort to ruff for linting and import sorting. The changes are generally good, but I have a few suggestions to improve the configuration and code style. I've recommended updating the ruff version in the pre-commit configuration and enabling auto-fixing. I've also suggested adding the src path configuration for ruff to ensure correct import sorting, and pointed out an opportunity to improve code quality by fixing a linting issue instead of ignoring it. Finally, there's a minor style improvement for how noqa comments are handled in one of the __init__.py files.

@DimitriPapadopoulos DimitriPapadopoulos force-pushed the ruff branch 3 times, most recently from ee80750 to 206e988 Compare March 3, 2026 20:36
@DimitriPapadopoulos
Copy link
Author

DimitriPapadopoulos commented Mar 3, 2026

Push ed new commit to replace black as well, as changes are minimal.

I could also select a few additional ruff rule sets (better left for another PR).

@DimitriPapadopoulos DimitriPapadopoulos force-pushed the ruff branch 2 times, most recently from 42196ba to d9c4e2e Compare March 4, 2026 01:06
@DimitriPapadopoulos DimitriPapadopoulos changed the title flake8, isort → ruff black,flake8, isort → ruff Mar 4, 2026
@DimitriPapadopoulos DimitriPapadopoulos changed the title black,flake8, isort → ruff black, flake8, isort → ruff Mar 4, 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