-
Notifications
You must be signed in to change notification settings - Fork 0
Some merge #6
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: ai-test/testing-rules
Are you sure you want to change the base?
Some merge #6
Changes from all commits
4fa0543
e877c48
26688b4
b296a10
b622d40
024462d
ea620a7
c232747
3e89b7f
06f9387
c0d6f13
a20d746
5aba193
7b3744e
5377afa
6ff18c9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,6 +4,11 @@ class TestView extends StatefulWidget { | |
| // Violation 1: Missing 'const' on constructor for a stateless-style widget | ||
| TestView({Key? key}) : super(key: key); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Violation of 1. Widget Performance & Lifecycle - Const Constructors: The |
||
|
|
||
| // stupid comment. okease delete | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This comment ('// stupid comment. okease delete') is unprofessional and adds no value to the codebase. Please remove it entirely. |
||
| // todo | ||
|
|
||
| // some other commit | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This comment ('// some other commit') appears to be a leftover from development or version control and should be removed to maintain code clarity and professionalism. |
||
|
|
||
|
Comment on lines
+7
to
+11
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| @override | ||
| // ignore: library_private_types_in_public_api | ||
| _TestViewState createState() => _TestViewState(); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,10 @@ | ||
| import os | ||
| import json | ||
| import sys | ||
| from github import Github | ||
| import google.generativeai as genai | ||
| from github import Auth, Github | ||
|
|
||
| from google.genai import Client | ||
|
|
||
|
|
||
| # --- 1. Initialization & Environment Check --- | ||
| print("🚀 Starting AI Review Agent...") | ||
|
|
@@ -20,10 +22,19 @@ | |
|
|
||
| # --- 2. GitHub & AI Setup --- | ||
| try: | ||
| genai.configure(api_key=GEMINI_API_KEY) | ||
| gh = Github(GITHUB_TOKEN) | ||
| # Update this string to your actual repo path (e.g., "flutter/flutter-intellij") | ||
| repo = gh.get_repo("flutter/flutter-intellij") | ||
|
|
||
| # The client automatically picks up the API key from the environment variable. | ||
| # Ensure you have set GEMINI_API_KEY or GOOGLE_API_KEY | ||
| # If using Vertex AI, you can initialize with client = Client(vertexai=True) | ||
| client = Client() | ||
|
|
||
|
|
||
| for model in client.models.list(): | ||
| print(f"Name: {model.name}") | ||
| print(f"Description: {model.description}\n") | ||
|
Comment on lines
+32
to
+34
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
|
||
| gh = Github(auth=Auth.Token(GITHUB_TOKEN)) | ||
| repo = gh.get_repo("cj-radcliff/SimpleFlutterFlashcards") | ||
| pr = repo.get_pull(PR_NUMBER) | ||
| print(f"✅ Connected to Repo: {repo.full_name}") | ||
| except Exception as e: | ||
|
|
@@ -36,7 +47,7 @@ def get_line_specific_review(): | |
| comparison = repo.compare(pr.base.sha, pr.head.sha) | ||
|
|
||
| is_flutter = any(f.filename.endswith('.dart') for f in comparison.files) | ||
| standards_path = "docs/ai-flutter-standards.md" if is_flutter else "docs/ai-standards.md" | ||
| standards_path = "docs/ai-standards.md" | ||
|
|
||
| print(f"📖 Loading standards from: {standards_path}") | ||
| with open(standards_path, "r") as f: | ||
|
|
@@ -68,8 +79,10 @@ def get_line_specific_review(): | |
| """ | ||
|
|
||
| print("🤖 Sending request to Gemini...") | ||
| model = genai.GenerativeModel('gemini-1.5-pro') | ||
| response = model.generate_content(prompt) | ||
| response = client.models.generate_content( | ||
| model='gemini-2.5-flash', | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| contents=prompt, | ||
| ) | ||
| print("✨ Received response from Gemini.") | ||
| return response.text, latest_commit | ||
|
|
||
|
|
@@ -102,7 +115,7 @@ def apply_feedback(raw_response, commit): | |
| if "READY_FOR_HUMAN_REVIEW" in raw_response: | ||
| print("👤 Triggering handoff: Reassigning to human...") | ||
| # REPLACE WITH YOUR ACTUAL GITHUB USERNAME | ||
| MY_USERNAME = "your-github-username" | ||
| MY_USERNAME = "cj-radcliff" | ||
| pr.add_to_assignees(MY_USERNAME) | ||
| pr.create_issue_comment(f"✅ AI Review complete. Reassigning to @{MY_USERNAME} for final review.") | ||
|
|
||
|
|
||
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.
The bullet point on line 38 is incomplete, and the 'Nit Picking' section (lines 40-41) is unprofessional and unnecessary for a technical standards document. It is recommended to remove these lines.