Skip to content

Commit 2544190

Browse files
Organize codebase
1 parent 7da75b7 commit 2544190

8 files changed

Lines changed: 9 additions & 9 deletions

File tree

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,4 +222,4 @@ hack-review.pem
222222
GEMINI.md
223223

224224
# Github repository preferences file.
225-
preferences.md
225+
data/preferences.md

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ Hack Review is a GitHub App that automatically reviews your pull requests. It us
4444
4545
## System Prompt
4646
47-
The AI's behavior is guided by a system prompt. You can find the system prompt in the `System_Prompt.md` file. You can modify this file to change the AI's behavior.
47+
The AI's behavior is guided by a system prompt. You can find the system prompt in the `data/System_Prompt.md` file. You can modify this file to change the AI's behavior.
4848
4949
## How to contribute
5050
File renamed without changes.

docs/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ <h3>4. Run the app</h3>
156156

157157
<section id="system-prompt">
158158
<h2>System Prompt Customization</h2>
159-
<p>The core behavior of the AI reviewer is governed by a configurable system prompt. You can locate and modify this prompt within the <code>System_Prompt.md</code> file to fine-tune the AI's review style and focus.</p>
159+
<p>The core behavior of the AI reviewer is governed by a configurable system prompt. You can locate and modify this prompt within the <code>data/System_Prompt.md</code> file to fine-tune the AI's review style and focus.</p>
160160
</section>
161161

162162
<section id="contribute">

app.py renamed to src/github/app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ def send_review(owner, repo, pr_number, pr_body, pr_title, token, commit_id):
159159
files = requests.get(files_url, headers=headers).json()
160160

161161
try:
162-
with open("preferences.md", "r") as f:
162+
with open("../../data/preferences.md", "r") as f:
163163
preferences = f.read()
164164
except FileNotFoundError:
165165
preferences = ""

github_app.py renamed to src/github/github_app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
load_dotenv()
88

99
APP_ID = os.getenv("APP_ID")
10-
PRIVATE_KEY = open("hack-review.pem").read()
10+
PRIVATE_KEY = open("../../hack-review.pem").read()
1111

1212
def generate_jwt():
1313
payload = {

preferences.py renamed to src/github/preferences.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
def extract_and_save_preference(comment_body):
1313
"""
1414
Analyzes a comment to see if it contains a project preference, and if so,
15-
saves it to the preferences.md file.
15+
saves it to the data/preferences.md file.
1616
"""
1717
try:
1818
system_prompt = """You are an AI assistant tasked with identifying project-specific preferences from user comments.
@@ -34,7 +34,7 @@ def extract_and_save_preference(comment_body):
3434
preference = response.choices[0].message.content.strip()
3535

3636
if "NO_PREFERENCE" not in preference:
37-
with open("preferences.md", "a") as f:
37+
with open("../../data/preferences.md", "a") as f:
3838
f.write(f"- {preference}\n")
3939
return f"Preference noted: {preference}"
4040
else:

review.py renamed to src/github/review.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212

1313
def review_pr(review_prompt, pr_body, pr_title, preferences=""):
1414
try:
15-
with open("System_Prompt.md", "r") as system_prompt_file:
15+
with open("../../data/System_Prompt.md", "r") as system_prompt_file:
1616
system_prompt = system_prompt_file.read()
1717
except FileNotFoundError:
18-
print("Error: The file 'System_Prompt.md' was not found.")
18+
print("Error: The file 'data/System_Prompt.md' was not found.")
1919
system_prompt = "You are an expert code reviewer AI."
2020
except Exception as e:
2121
print(f"An error occurred: {e}")

0 commit comments

Comments
 (0)