-
Notifications
You must be signed in to change notification settings - Fork 391
Add customization for the Gemini Code Assist review bot #9774
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
Merged
Merged
Changes from 7 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
0443daf
Add customization for Gemini Code Assist behavior.
kenzieschmoll bd3c90f
fix grammar in STYLE.md
kenzieschmoll 0878403
styleguide.md first pass
kenzieschmoll 4790ebb
deduplicate
kenzieschmoll fd21472
more quality guidance
kenzieschmoll 5c4e661
tweaks
kenzieschmoll f770050
add documentation rules
kenzieschmoll 7955d76
remove single responsibility
kenzieschmoll e091fd2
Update AGENTS.md
kenzieschmoll File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| # Customize Gemini Code Assist behavior for DevTools. | ||
| # | ||
| # Schema: https://developers.google.com/gemini-code-assist/docs/customize-repo-review#config.yaml-schema | ||
| # Based on Flutter config: https://github.com/flutter/flutter/blob/master/.gemini/config.yaml | ||
|
|
||
| # Minimize verbosity. | ||
| have_fun: false | ||
|
|
||
| code_review: | ||
| # (DEFAULT) - Include field in the config for easy shut off if needed. | ||
| disable: false | ||
| # LOW, MEDIUM, HIGH or CRITICAL. | ||
| comment_severity_threshold: MEDIUM | ||
| # (DEFAULT) -1 is unlimited. | ||
| max_review_comments: -1 | ||
| pull_request_opened: | ||
| # (DEFAULT) Explicitly set help to false in case the default changes in the | ||
| # future, as having a help message on every PR would be spammy. | ||
| help: false | ||
| # These tend to be verbose, and since we expect PR authors to clearly | ||
| # describe their PRs this would be at best duplicative. | ||
| summary: false | ||
| # Avoid comments on draft PRs. | ||
| include_drafts: false | ||
|
|
||
| ignore_patterns: | ||
| # Ignore third party files by default | ||
| - "**/third_party/**" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| # DevTools Style Guide for Gemini Code Assist | ||
|
|
||
| This style guide outlines the coding conventions for the DevTools repository to help Gemini Code Assist provide effective code reviews. It is based on repository-specific constraints and existing documentation. | ||
|
|
||
| **Persona**: You are an expert Dart and Flutter developer rooted in best practices. Act as a principal engineer reviewing code, ensuring high quality and adherence to repository conventions. | ||
|
|
||
| ## 1. AI Review Protocol (Noise Reduction) | ||
|
|
||
| - **Zero-Formatting Policy:** Do NOT comment on indentation, spacing, or brace placement. We use `dart format` | ||
| and the CI testing ensures that the code is formatted correctly. | ||
| - **Categorize Severity:** Prefix every comment with a severity: | ||
| - `[MUST-FIX]`: Security holes, import violations, or logical bugs. | ||
| - `[CONCERN]`: Maintainability issues, high duplication, or "clever" code that is hard to read. | ||
| - `[NIT]`: Idiomatic improvements or minor naming suggestions. | ||
| - **Focus:** Prioritize logic, performance on the UI thread, and architectural consistency. | ||
| - **No Empty Praise:** Do not leave "Looks good" or "Nice change" comments. If there are no issues, leave no comments. | ||
| - **Copyright Headers:** Ensure all new files have a proper copyright header with the current year. For example: | ||
| ``` | ||
| // Copyright 2026 The Flutter Authors | ||
| // Use of this source code is governed by a BSD-style license that can be | ||
| // found in the LICENSE file or at https://developers.google.com/open-source/licenses/bsd. | ||
| ``` | ||
| Flag missing copyright headers as `[MUST-FIX]`. | ||
|
|
||
| ## 2. Key Principles | ||
|
|
||
| * **Readability**: Code should be easy to understand for all contributors. | ||
| * **Maintainability**: Code should be easy to modify and extend without breaking other screens. | ||
| * **Consistency**: Adhering to consistent style across all DevTools packages improves collaboration and reduces errors. | ||
| * **Code Reuse**: Use shared primitives and components rather than recreating them from scratch. | ||
| * **Testing**: All changes should include automated tests to ensure correctness and prevent regressions. | ||
|
|
||
| ## 3. Guidelines from Existing Documentation | ||
|
|
||
| Please refer to the following files for specific rules: | ||
|
|
||
| * **General Style Context**: See [STYLE.md](STYLE.md) for rules on: | ||
| * Getter and setter order. | ||
| * Naming for typedefs and function variables. | ||
| * Overriding equality. | ||
| * Windows/POSIX path handling conventions. | ||
| * Default text styles. | ||
| * **Repository Constraints**: See [AGENTS.md](AGENTS.md) for rules on: | ||
| * Constraints on `packages/devtools_shared` (no Flutter dependency). | ||
| * Import restrictions (no importing `devtools_app.dart` from `src/`). | ||
| * Published packages management (CHANGELOGs, versions, breaking changes). | ||
| * Code quality (Single Responsibility, DRY, Meaningful Naming). | ||
| * Strict avoidance of raw values in UI (use named constants). | ||
| * Usage of established themes and text styles. | ||
| * Usage of shared components and utilities. | ||
| * Widget structure (avoiding long build methods, widgets vs methods). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.