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
Copy file name to clipboardExpand all lines: codegpt/prompts.py
+61Lines changed: 61 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,5 @@
1
+
fromtextwrapimportdedent
2
+
1
3
prompts= {
2
4
"comment": "Add or update comments according to the given language's standards. Add or update function, module, or class level comments if they're appropriate.",
3
5
"varnames": "Change variable names, but nothing else, to make the code more readable. For example, instead of using 'x' and 'y', use 'width' and 'height'.",
@@ -26,3 +28,62 @@ def set_username(username):
26
28
this.username = username
27
29
""",
28
30
}
31
+
32
+
defgenerate_review_instructions(filename, code):
33
+
instructions=dedent(
34
+
f"""
35
+
Please review the code in the file "{filename}" and document your findings in a markdown file. The code is shown below for reference:
36
+
37
+
```
38
+
{code}
39
+
```
40
+
41
+
In your markdown file, please include the following information:
42
+
43
+
1. A summary of the purpose of the file and its contents.
44
+
2. A list of all classes and functions defined in the file, along with a brief description of their purpose.
45
+
3. A list of any external dependencies used in the file, including any libraries or modules imported from outside the project.
46
+
4. Any bugs or issues you identified while reviewing the code.
47
+
5. Any areas of the code that you consider to be particularly well-written or poorly-written, and why.
48
+
49
+
Please also include any questions or comments you have about the code in your markdown file.
50
+
51
+
When you have finished reviewing the code and documenting your findings, please submit your markdown file for review.
52
+
53
+
Here is a sample markdown file format you can follow:
54
+
55
+
```md
56
+
# Code Review: {filename}
57
+
58
+
## Summary
59
+
60
+
[Insert summary of the purpose of the file and its contents here.]
61
+
62
+
## Classes and Functions
63
+
64
+
[Insert a list of all classes and functions defined in the file, along with a brief description of their purpose.]
65
+
66
+
## External Dependencies
67
+
68
+
[Insert a list of any external dependencies used in the file, including any libraries or modules imported from outside the project.]
69
+
70
+
## Bugs and Issues
71
+
72
+
[Insert any bugs or issues you identified while reviewing the code.]
73
+
74
+
## Code Quality
75
+
76
+
[Insert any comments you have on the quality of the code, including any areas that you consider to be particularly well-written or poorly-written, and why.]
77
+
78
+
## Questions and Comments
79
+
80
+
[Insert any questions or comments you have about the code.]
81
+
```
82
+
83
+
You are an expert, senior developer, give helpful feedback if you find problems. Return your whole response, markdown formatted for github, below.
0 commit comments