mirror of
https://github.com/qodo-ai/pr-agent.git
synced 2025-07-02 11:50:37 +08:00
Add intro and chat text options for PR code suggestions in configuration
This commit is contained in:
@ -69,7 +69,9 @@ enable_review_labels_effort=true
|
|||||||
require_all_thresholds_for_incremental_review=false
|
require_all_thresholds_for_incremental_review=false
|
||||||
minimal_commits_for_incremental_review=0
|
minimal_commits_for_incremental_review=0
|
||||||
minimal_minutes_for_incremental_review=0
|
minimal_minutes_for_incremental_review=0
|
||||||
|
enable_intro_text=true
|
||||||
enable_help_text=false # Determines whether to include help text in the PR review. Enabled by default.
|
enable_help_text=false # Determines whether to include help text in the PR review. Enabled by default.
|
||||||
|
enable_chat_text=false
|
||||||
# auto approval
|
# auto approval
|
||||||
enable_auto_approval=false
|
enable_auto_approval=false
|
||||||
maximal_review_effort=5
|
maximal_review_effort=5
|
||||||
|
@ -143,11 +143,15 @@ class PRCodeSuggestions:
|
|||||||
pr_body += ' <!-- approve pr self-review -->'
|
pr_body += ' <!-- approve pr self-review -->'
|
||||||
|
|
||||||
# add usage guide
|
# add usage guide
|
||||||
|
if (get_settings().pr_code_suggestions.enable_chat_text and get_settings().config.is_auto_command
|
||||||
|
and isinstance(self.git_provider, GithubProvider)):
|
||||||
|
pr_body += "\n\n>💡 Need additional feedback ? start a [PR chat](https://chromewebstore.google.com/detail/ephlnjeghhogofkifjloamocljapahnl) \n\n"
|
||||||
if get_settings().pr_code_suggestions.enable_help_text:
|
if get_settings().pr_code_suggestions.enable_help_text:
|
||||||
pr_body += "<hr>\n\n<details> <summary><strong>💡 Tool usage guide:</strong></summary><hr> \n\n"
|
pr_body += "<hr>\n\n<details> <summary><strong>💡 Tool usage guide:</strong></summary><hr> \n\n"
|
||||||
pr_body += HelpMessage.get_improve_usage_guide()
|
pr_body += HelpMessage.get_improve_usage_guide()
|
||||||
pr_body += "\n</details>\n"
|
pr_body += "\n</details>\n"
|
||||||
|
|
||||||
|
|
||||||
# Output the relevant configurations if enabled
|
# Output the relevant configurations if enabled
|
||||||
if get_settings().get('config', {}).get('output_relevant_configurations', False):
|
if get_settings().get('config', {}).get('output_relevant_configurations', False):
|
||||||
pr_body += show_relevant_configurations(relevant_section='pr_code_suggestions')
|
pr_body += show_relevant_configurations(relevant_section='pr_code_suggestions')
|
||||||
@ -611,6 +615,9 @@ class PRCodeSuggestions:
|
|||||||
try:
|
try:
|
||||||
pr_body = "## PR Code Suggestions ✨\n\n"
|
pr_body = "## PR Code Suggestions ✨\n\n"
|
||||||
|
|
||||||
|
if get_settings().pr_code_suggestions.enable_intro_text and get_settings().config.is_auto_command:
|
||||||
|
pr_body += "Explore these optional code suggestions:\n\n"
|
||||||
|
|
||||||
if len(data.get('code_suggestions', [])) == 0:
|
if len(data.get('code_suggestions', [])) == 0:
|
||||||
pr_body += "No suggestions found to improve this PR."
|
pr_body += "No suggestions found to improve this PR."
|
||||||
return pr_body
|
return pr_body
|
||||||
|
Reference in New Issue
Block a user