Skip to content

Commit d93ced5

Browse files
committed
lint and update
1 parent 4e32c8c commit d93ced5

File tree

5 files changed

+46
-65
lines changed

5 files changed

+46
-65
lines changed

.github/workflows/test.yml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
name: Tests
22

33
on:
4-
pull_request:
5-
types:
6-
- ready_for_review
7-
- review_requested
84
push:
95
branches-ignore:
106
- main
@@ -15,15 +11,12 @@ on:
1511
- generateunittests-*
1612
- generatecodeusageexample-*
1713
- resolveissue-*
18-
1914
- demo*
2015

2116
# Credits to https://blog.maximeheckel.com/posts/building-perfect-github-action-frontend-teams/#you-are-terminated
2217
concurrency:
2318
# Here the group is defined by the head_ref of the PR
2419
group: ${{ github.head_ref || github.ref_name }}
25-
# Here we specify that we'll cancel any "in progress" workflow of the same group. Thus if we push, ammend a commit and push
26-
# again the previous workflow will be cancelled, thus saving us github action build minutes and avoid any conflicts
2720
cancel-in-progress: true
2821

2922
jobs:

patchwork/patchflows/PRReview/PRReview.py

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,11 @@
1-
import json
21
from pathlib import Path
32

43
import yaml
54

65
from patchwork.common.utils.progress_bar import PatchflowProgressBar
76
from patchwork.common.utils.step_typing import validate_steps_with_inputs
87
from patchwork.step import Step
9-
from patchwork.steps import (
10-
LLM,
11-
CallLLM,
12-
CreatePRComment,
13-
ExtractModelResponse,
14-
PreparePR,
15-
PreparePrompt,
16-
ReadPRDiffs, SimplifiedLLMOnce, JoinList,
17-
)
8+
from patchwork.steps import CreatePRComment, ReadPRDiffs, SimplifiedLLMOnce
189

1910
_DEFAULT_PROMPT_JSON = Path(__file__).parent / "pr_review_prompt.json"
2011
_DEFAULT_INPUT_FILE = Path(__file__).parent / "defaults.yml"
@@ -54,7 +45,7 @@ def run(self) -> dict:
5445
llm1_outputs = SimplifiedLLMOnce(
5546
dict(
5647
prompt_value=diffs,
57-
user_prompt='''\
48+
user_prompt="""\
5849
Analyze the following code diff against the provided rules:
5950
6051
<CODE_DIFF>
@@ -118,26 +109,26 @@ def run(self) -> dict:
118109
</REVIEW_FORMAT>
119110
120111
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.
121-
''',
112+
""",
122113
json_schema={"review": "The markdown text of the reviews"},
123-
**self.inputs
114+
**self.inputs,
124115
)
125116
).run()
126117

127118
llm2_outputs = SimplifiedLLMOnce(
128119
dict(
129120
prompt_value=llm1_outputs,
130-
user_prompt='''\
121+
user_prompt="""\
131122
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.
132123
133124
<code_reviews>
134125
{{review}}
135126
<code_reviews>
136127
137128
You should return an empty response if there are no code reviews that is actionable or useful.
138-
''',
129+
""",
139130
json_schema={"review": "The reviews curated"},
140-
**self.inputs
131+
**self.inputs,
141132
)
142133
).run()
143134

patchwork/steps/SimplifiedLLMOnce/SimplifiedLLMOnce.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
from patchwork.step import Step
22
from patchwork.steps.SimplifiedLLM.SimplifiedLLM import SimplifiedLLM
3-
from patchwork.steps.SimplifiedLLMOnce.typed import SimplifiedLLMOnceInputs, SimplifiedLLMOnceOutputs
3+
from patchwork.steps.SimplifiedLLMOnce.typed import (
4+
SimplifiedLLMOnceInputs,
5+
SimplifiedLLMOnceOutputs,
6+
)
47

58

69
class SimplifiedLLMOnce(Step, input_class=SimplifiedLLMOnceInputs, output_class=SimplifiedLLMOnceOutputs):

patchwork/steps/SimplifiedLLMOnce/typed.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,4 @@ class SimplifiedLLMOnceInputs(__SimplifiedLLMOncePBInputsRequired, total=False):
4242

4343
class SimplifiedLLMOnceOutputs(TypedDict):
4444
request_tokens: int
45-
response_tokens: int
45+
response_tokens: int

poetry.lock

Lines changed: 34 additions & 40 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)