mirror of
https://github.com/qodo-ai/pr-agent.git
synced 2025-07-07 22:30:38 +08:00
## Example usage
This commit is contained in:
@ -9,6 +9,7 @@ It can be invoked manually by commenting on any PR:
|
|||||||
```
|
```
|
||||||
|
|
||||||
## Example usage
|
## Example usage
|
||||||
|
|
||||||
An example result:
|
An example result:
|
||||||
|
|
||||||
{width=750}
|
{width=750}
|
||||||
|
@ -8,6 +8,8 @@ The tool analyzes the failed checks and provides several feedbacks:
|
|||||||
- Failure summary
|
- Failure summary
|
||||||
- Relevant error logs
|
- Relevant error logs
|
||||||
|
|
||||||
|
## Example usage
|
||||||
|
|
||||||
{width=768}
|
{width=768}
|
||||||
|
|
||||||
→
|
→
|
||||||
|
@ -5,7 +5,8 @@ It can be invoked manually by commenting on any PR:
|
|||||||
```
|
```
|
||||||
/generate_labels
|
/generate_labels
|
||||||
```
|
```
|
||||||
For example:
|
|
||||||
|
## Example usage
|
||||||
|
|
||||||
If we wish to add detect changes to SQL queries in a given PR, we can add the following custom label along with its description:
|
If we wish to add detect changes to SQL queries in a given PR, we can add the following custom label along with its description:
|
||||||
|
|
||||||
|
@ -1,13 +1,18 @@
|
|||||||
## Overview
|
## Overview
|
||||||
The `custom_suggestions` tool scans the PR code changes, and automatically generates custom suggestions for improving the PR code.
|
The `custom_suggestions` tool scans the PR code changes, and automatically generates suggestions for improving the PR code.
|
||||||
It shares similarities with the `improve` tool, but with one main difference: the `custom_suggestions` tool will only propose suggestions that follow specific guidelines defined by the prompt in: `pr_custom_suggestions.prompt` configuration.
|
It shares similarities with the `improve` tool, but with one main difference: the `custom_suggestions` tool will **only propose suggestions that follow specific guidelines defined by the prompt** in: `pr_custom_suggestions.prompt` configuration.
|
||||||
|
|
||||||
The tool can be triggered [automatically](../usage-guide/automations_and_usage.md#github-app-automatic-tools-when-a-new-pr-is-opened) every time a new PR is opened, or can be invoked manually by commenting on a PR.
|
The tool can be triggered [automatically](../usage-guide/automations_and_usage.md#github-app-automatic-tools-when-a-new-pr-is-opened) every time a new PR is opened, or can be invoked manually by commenting on a PR.
|
||||||
|
|
||||||
When commenting, use the following template:
|
When commenting, use the following template:
|
||||||
|
|
||||||
```
|
```
|
||||||
/custom_suggestions --pr_custom_suggestions.prompt="The suggestions should focus only on the following:\n-...\n-...\n-..."
|
/custom_suggestions --pr_custom_suggestions.prompt="
|
||||||
|
The suggestions should focus only on the following:
|
||||||
|
- ...
|
||||||
|
- ...
|
||||||
|
|
||||||
|
"
|
||||||
```
|
```
|
||||||
|
|
||||||
With a [configuration file](../usage-guide/automations_and_usage.md#github-app), use the following template:
|
With a [configuration file](../usage-guide/automations_and_usage.md#github-app), use the following template:
|
||||||
@ -18,17 +23,16 @@ prompt="""\
|
|||||||
The suggestions should focus only on the following:
|
The suggestions should focus only on the following:
|
||||||
-...
|
-...
|
||||||
-...
|
-...
|
||||||
-...
|
|
||||||
"""
|
"""
|
||||||
```
|
```
|
||||||
Using a configuration file is recommended, since it allows to use multi-line instructions.
|
|
||||||
|
|
||||||
Don't forget - with this tool, you are the prompter. Be specific, clear, and concise in the instructions. Specify relevant aspects that you want the model to focus on. \
|
Remmeber - with this tool, you are the prompter. Be specific, clear, and concise in the instructions. Specify relevant aspects that you want the model to focus on. \
|
||||||
You might benefit from several trial-and-error iterations, until you get the correct prompt for your use case.
|
You might benefit from several trial-and-error iterations, until you get the correct prompt for your use case.
|
||||||
|
|
||||||
## Example usage
|
## Example usage
|
||||||
|
|
||||||
Here is an example of a possible prompt:
|
Here is an example of a possible prompt, defined in the configuration file:
|
||||||
```
|
```
|
||||||
[pr_custom_suggestions]
|
[pr_custom_suggestions]
|
||||||
prompt="""\
|
prompt="""\
|
||||||
@ -39,12 +43,13 @@ The suggestions should focus only on the following:
|
|||||||
"""
|
"""
|
||||||
```
|
```
|
||||||
|
|
||||||
The instructions above are just an example. We want to emphasize that the prompt should be specific and clear, and be tailored to the needs of your project.
|
(The instructions above are just an example. We want to emphasize that the prompt should be specific and clear, and be tailored to the needs of your project)
|
||||||
|
|
||||||
Results obtained with the prompt above:
|
Results obtained with the prompt above:
|
||||||
|
|
||||||
{width=512}
|
[//]: # ({width=512})
|
||||||
→
|
|
||||||
|
[//]: # (→)
|
||||||
{width=768}
|
{width=768}
|
||||||
|
|
||||||
## Configuration options
|
## Configuration options
|
||||||
|
@ -5,14 +5,24 @@ It can be invoked manually by commenting on any PR:
|
|||||||
```
|
```
|
||||||
/add_docs
|
/add_docs
|
||||||
```
|
```
|
||||||
For example:
|
|
||||||
|
## Example usage
|
||||||
|
|
||||||
|
Invoke the tool manually by commenting `/add_docs` on any PR:
|
||||||
|
|
||||||
{width=768}
|
{width=768}
|
||||||
|
|
||||||
|
The tool will generate documentation for all the components that changed in the PR:
|
||||||
|
|
||||||
{width=768}
|
{width=768}
|
||||||
|
|
||||||
{width=768}
|
{width=768}
|
||||||
|
|
||||||
|
You can state a name of a specific component in the PR to get documentation only for that component:
|
||||||
|
```
|
||||||
|
/add_docs component_name
|
||||||
|
```
|
||||||
|
|
||||||
## Configuration options
|
## Configuration options
|
||||||
- `docs_style`: The exact style of the documentation (for python docstring). you can choose between: `google`, `numpy`, `sphinx`, `restructuredtext`, `plain`. Default is `sphinx`.
|
- `docs_style`: The exact style of the documentation (for python docstring). you can choose between: `google`, `numpy`, `sphinx`, `restructuredtext`, `plain`. Default is `sphinx`.
|
||||||
- `extra_instructions`: Optional extra instructions to the tool. For example: "focus on the changes in the file X. Ignore change in ...".
|
- `extra_instructions`: Optional extra instructions to the tool. For example: "focus on the changes in the file X. Ignore change in ...".
|
||||||
@ -20,5 +30,4 @@ For example:
|
|||||||
**Notes**
|
**Notes**
|
||||||
|
|
||||||
- Language that are currently fully supported: Python, Java, C++, JavaScript, TypeScript, C#.
|
- Language that are currently fully supported: Python, Java, C++, JavaScript, TypeScript, C#.
|
||||||
- For languages that are not fully supported, the tool will suggest documentation only for new components in the PR.
|
- This tool can also be triggered interactively by using the [`analyze`](./analyze.md) tool.
|
||||||
- A previous version of the tool, that offered support only for new components, was deprecated.
|
|
@ -56,7 +56,7 @@ num_code_suggestions = ...
|
|||||||
- `num_code_suggestions`: number of code suggestions provided by the 'improve' tool. Default is 4 for CLI, 0 for auto tools.
|
- `num_code_suggestions`: number of code suggestions provided by the 'improve' tool. Default is 4 for CLI, 0 for auto tools.
|
||||||
- `extra_instructions`: Optional extra instructions to the tool. For example: "focus on the changes in the file X. Ignore change in ...".
|
- `extra_instructions`: Optional extra instructions to the tool. For example: "focus on the changes in the file X. Ignore change in ...".
|
||||||
- `rank_suggestions`: if set to true, the tool will rank the suggestions, based on importance. Default is false.
|
- `rank_suggestions`: if set to true, the tool will rank the suggestions, based on importance. Default is false.
|
||||||
- `summarize`: if set to true, the tool will display the suggestions in a single comment. Default is true.
|
- `commitable_code_suggestions`: if set to true, the tool will display the suggestions as commitable code comments. Default is false.
|
||||||
- `persistent_comment`: if set to true, the improve comment will be persistent, meaning that every new improve request will edit the previous one. Default is false.
|
- `persistent_comment`: if set to true, the improve comment will be persistent, meaning that every new improve request will edit the previous one. Default is false.
|
||||||
- `enable_help_text`: if set to true, the tool will display a help text in the comment. Default is true.
|
- `enable_help_text`: if set to true, the tool will display a help text in the comment. Default is true.
|
||||||
|
|
||||||
|
@ -8,14 +8,19 @@ it can be invoked manually by commenting on any PR:
|
|||||||
To get a list of the components that changed in the PR and choose the relevant component interactively, use the [`analyze`](./analyze.md) tool.
|
To get a list of the components that changed in the PR and choose the relevant component interactively, use the [`analyze`](./analyze.md) tool.
|
||||||
|
|
||||||
|
|
||||||
Example result:
|
## Example usage
|
||||||
|
|
||||||
|
Invoke the tool manually by commenting `/improve_component` on any PR:
|
||||||
|
|
||||||
{width=768}
|
{width=768}
|
||||||
|
|
||||||
|
The tool will generate code suggestions for the selected component (if no component is stated, it will generate code suggestions for the largest component):
|
||||||
|
|
||||||
{width=768}
|
{width=768}
|
||||||
|
|
||||||
**Notes**
|
**Notes**
|
||||||
- Language that are currently supported by the tool: Python, Java, C++, JavaScript, TypeScript, C#.
|
- Language that are currently supported by the tool: Python, Java, C++, JavaScript, TypeScript, C#.
|
||||||
|
- This tool can also be triggered interactively by using the [`analyze`](./analyze.md) tool.
|
||||||
|
|
||||||
## Configuration options
|
## Configuration options
|
||||||
- `num_code_suggestions`: number of code suggestions to provide. Default is 4
|
- `num_code_suggestions`: number of code suggestions to provide. Default is 4
|
||||||
|
@ -4,7 +4,9 @@ It can be invoked manually by commenting on any PR:
|
|||||||
```
|
```
|
||||||
/similar_issue
|
/similar_issue
|
||||||
```
|
```
|
||||||
For example:
|
|
||||||
|
|
||||||
|
## Example usage
|
||||||
|
|
||||||
{width=768}
|
{width=768}
|
||||||
|
|
||||||
|
@ -7,17 +7,23 @@ It can be invoked manually by commenting on any PR:
|
|||||||
where 'component_name' is the name of a specific component in the PR.
|
where 'component_name' is the name of a specific component in the PR.
|
||||||
To get a list of the components that changed in the PR and choose the relevant component interactively, use the [`analyze`](./analyze.md) tool.
|
To get a list of the components that changed in the PR and choose the relevant component interactively, use the [`analyze`](./analyze.md) tool.
|
||||||
|
|
||||||
|
## Example usage
|
||||||
|
|
||||||
An example [result](https://github.com/Codium-ai/pr-agent/pull/598#issuecomment-1913679429):
|
Invoke the tool manually by commenting `/test` on any PR:
|
||||||
|
|
||||||
{width=704}
|
{width=704}
|
||||||
|
|
||||||
|
The tool will generate tests for the selected component (if no component is stated, it will generate tests for largest component):
|
||||||
|
|
||||||
{width=768}
|
{width=768}
|
||||||
|
|
||||||
{width=768}
|
{width=768}
|
||||||
|
|
||||||
|
(Example taken from [here](https://github.com/Codium-ai/pr-agent/pull/598#issuecomment-1913679429)):
|
||||||
|
|
||||||
**Notes**
|
**Notes**
|
||||||
- Language that are currently supported by the tool: Python, Java, C++, JavaScript, TypeScript, C#.
|
- Language that are currently supported by the tool: Python, Java, C++, JavaScript, TypeScript, C#.
|
||||||
|
- This tool can also be triggered interactively by using the [`analyze`](./analyze.md) tool.
|
||||||
|
|
||||||
|
|
||||||
## Configuration options
|
## Configuration options
|
||||||
|
@ -4,7 +4,8 @@ It can be invoked manually by commenting on any PR:
|
|||||||
```
|
```
|
||||||
/update_changelog
|
/update_changelog
|
||||||
```
|
```
|
||||||
For example:
|
|
||||||
|
## Example usage
|
||||||
|
|
||||||
{width=768}
|
{width=768}
|
||||||
|
|
||||||
@ -12,7 +13,7 @@ For example:
|
|||||||
|
|
||||||
## Configuration options
|
## Configuration options
|
||||||
|
|
||||||
Under the section 'pr_update_changelog', the [configuration file](https://github.com/Codium-ai/pr-agent/blob/main/pr_agent/settings/configuration.toml#L50) contains options to customize the 'update changelog' tool:
|
Under the section `pr_update_changelog`, the [configuration file](https://github.com/Codium-ai/pr-agent/blob/main/pr_agent/settings/configuration.toml#L50) contains options to customize the 'update changelog' tool:
|
||||||
|
|
||||||
- `push_changelog_changes`: whether to push the changes to CHANGELOG.md, or just print them. Default is false (print only).
|
- `push_changelog_changes`: whether to push the changes to CHANGELOG.md, or just print them. Default is false (print only).
|
||||||
- `extra_instructions`: Optional extra instructions to the tool. For example: "focus on the changes in the file X. Ignore change in ...
|
- `extra_instructions`: Optional extra instructions to the tool. For example: "focus on the changes in the file X. Ignore change in ...
|
Reference in New Issue
Block a user