You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Analyze the following code diff against the provided rules:
63
+
64
+
<CODE_DIFF>
65
+
{{diff}}
66
+
</CODE_DIFF>
67
+
68
+
<RULES>
69
+
- Do not ignore potential bugs in the code.
70
+
- Do not overlook possible security vulnerabilities introduced by code modifications.
71
+
- Do not deviate from the original coding standards established in the pull request.
72
+
</RULES>
73
+
74
+
For each rule, determine if there\'s a violation. Use the following chain of thought process:
75
+
76
+
1. Understand the rule
77
+
2. Examine the diff line by line
78
+
3. Identify any potential violations
79
+
4. Determine the specific line numbers of violations
80
+
5. Summarize your findings
81
+
82
+
Rule 1:
83
+
1. Rule understanding: [Briefly explain the rule]
84
+
2. Diff examination: [Describe how you\'re examining the diff]
85
+
3. Potential violations: [List any potential violations you\'ve identified]
86
+
4. Line numbers: [If violations exist, list the specific line numbers]
87
+
5. Summary: [Summarize your findings for this rule]
88
+
89
+
Rule 2:
90
+
[Repeat the above structure for each rule]
91
+
92
+
Now, carefully review your reasoning in the section above. Ensure that your conclusions are consistent with the analysis you\'ve done for each rule.
93
+
94
+
Your review should have the following markdown format:
95
+
96
+
<REVIEW_FORMAT>
97
+
## File Changed: `{{path}}`
98
+
99
+
Details: [If rule violation include brief prescriptive explanation]
100
+
101
+
Affected Code Snippet:
102
+
[Original code enclosed in a code block from the file that is affected by this violation. If no violation, write "N/A"]
103
+
104
+
Start Line: [Starting Line number of the affected code. If no violation, write "N/A"]
105
+
106
+
End Line: [Ending Line number of the affected code. If no violation, write "N/A"]
107
+
108
+
-------------
109
+
110
+
Details: [If rule violation include brief prescriptive explanation]
111
+
112
+
Affected Code Snippet:
113
+
[Original code enclosed in a code block from the file that is affected by this violation. If no violation, write "N/A"]
114
+
115
+
Start Line: [Starting Line number of the affected code. If no violation, write "N/A"]
116
+
117
+
End Line: [Ending Line number of the affected code. If no violation, write "N/A"]
118
+
119
+
-------------
120
+
121
+
... (continue for all rules)
122
+
</REVIEW_FORMAT>
123
+
124
+
Ensure that you include all rules in your response, even if there\'s no violation. The output should directly reflect the reasoning in your thinking section.
125
+
''',
126
+
json_schema={"review": "The markdown text of the reviews"},
127
+
model="claude-3-5-sonnet-latest")
128
+
).run()
129
+
130
+
llm2_outputs=SimplifiedLLMOnce(
131
+
dict(
132
+
prompt_value=llm1_outputs,
133
+
user_prompt='''\
134
+
You are a software manager compiling code reviews from all teams. You are given a list of code reviews. You have to remove code reviews that is either not actionable or useful. Do not change the accepted reviews, return the original review for the response. Do not remove the path from the review.
135
+
136
+
<code_reviews>
137
+
{{review}}
138
+
<code_reviews>
139
+
140
+
You should return an empty response if there are no code reviews that is actionable or useful.
0 commit comments