-
Notifications
You must be signed in to change notification settings - Fork 78
Asset library changes with ruff format #2542
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: asset-library-changes-with-black-isort-format
Are you sure you want to change the base?
Asset library changes with ruff format #2542
Conversation
Summary of ChangesHello @ohmayr, 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 focuses on modernizing the code formatting and linting process by integrating Ruff, a high-performance tool, into the project. This change simplifies the development workflow and ensures consistent code style across the codebase. Highlights
Using Gemini Code AssistThe 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
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 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
|
There was a problem hiding this 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's formatting and linting from black and isort to ruff. The changes primarily involve updating noxfile.py and its template to use ruff commands. The rest of the modifications are formatting adjustments across the codebase applied by ruff. The migration appears to be well-executed. I've pointed out a couple of minor inconsistencies in the new noxfile.py format session where exclude flags were missing, which could lead to unintended formatting of golden files. Otherwise, the changes look good.
| session.run( | ||
| "ruff", | ||
| "check", | ||
| "--select", | ||
| "I", | ||
| "--fix", | ||
| "--line-length=88", # Standard Black line length | ||
| *LINT_PATHS, | ||
| ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To maintain consistency with other ruff commands in this file and to avoid formatting generated or golden files, it's best to add the exclude flag here as well.
session.run(
"ruff",
"check",
"--select",
"I",
"--fix",
"--line-length=88", # Standard Black line length
*LINT_PATHS,
"--exclude",
RUFF_EXCLUDES,
)| session.run( | ||
| "black", | ||
| *BLACK_PATHS, | ||
| "--extend-exclude", | ||
| BLACK_EXCLUDES, | ||
| "ruff", | ||
| "format", | ||
| "--line-length=88", # Standard Black line length | ||
| *LINT_PATHS, | ||
| ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To avoid formatting generated or golden files, the exclude flag should be used here, consistent with other ruff format calls in this file.
| session.run( | |
| "black", | |
| *BLACK_PATHS, | |
| "--extend-exclude", | |
| BLACK_EXCLUDES, | |
| "ruff", | |
| "format", | |
| "--line-length=88", # Standard Black line length | |
| *LINT_PATHS, | |
| ) | |
| session.run( | |
| "ruff", | |
| "format", | |
| "--line-length=88", # Standard Black line length | |
| *LINT_PATHS, | |
| "--exclude", | |
| RUFF_EXCLUDES, | |
| ) | |
5b73572 to
efb7a7d
Compare
No description provided.