mirror of
https://github.com/qodo-ai/pr-agent.git
synced 2025-07-04 21:00:40 +08:00
Format files by pre-commit run -a
Signed-off-by: Yu Ishikawa <yu-iskw@users.noreply.github.com>
This commit is contained in:
@ -6,8 +6,8 @@ from pr_agent.tools.pr_description import insert_br_after_x_chars
|
||||
Code Analysis
|
||||
|
||||
Objective:
|
||||
The objective of the 'convert_to_markdown' function is to convert a dictionary of data into a markdown-formatted text.
|
||||
The function takes in a dictionary as input and recursively iterates through its keys and values to generate the
|
||||
The objective of the 'convert_to_markdown' function is to convert a dictionary of data into a markdown-formatted text.
|
||||
The function takes in a dictionary as input and recursively iterates through its keys and values to generate the
|
||||
markdown text.
|
||||
|
||||
Inputs:
|
||||
@ -18,17 +18,17 @@ Flow:
|
||||
- Create a dictionary 'emojis' containing emojis for each key in the input dictionary.
|
||||
- Iterate through the input dictionary:
|
||||
- If the value is empty, continue to the next iteration.
|
||||
- If the value is a dictionary, recursively call the 'convert_to_markdown' function with the value as input and
|
||||
- If the value is a dictionary, recursively call the 'convert_to_markdown' function with the value as input and
|
||||
append the returned markdown text to 'markdown_text'.
|
||||
- If the value is a list:
|
||||
- If the key is 'code suggestions', add an additional line break to 'markdown_text'.
|
||||
- Get the corresponding emoji for the key from the 'emojis' dictionary. If no emoji is found, use a dash.
|
||||
- Append the emoji and key to 'markdown_text'.
|
||||
- Iterate through the items in the list:
|
||||
- If the item is a dictionary and the key is 'code suggestions', call the 'parse_code_suggestion' function with
|
||||
- If the item is a dictionary and the key is 'code suggestions', call the 'parse_code_suggestion' function with
|
||||
the item as input and append the returned markdown text to 'markdown_text'.
|
||||
- If the item is not empty, append it to 'markdown_text'.
|
||||
- If the value is not 'n/a', get the corresponding emoji for the key from the 'emojis' dictionary. If no emoji is
|
||||
- If the value is not 'n/a', get the corresponding emoji for the key from the 'emojis' dictionary. If no emoji is
|
||||
found, use a dash. Append the emoji, key, and value to 'markdown_text'.
|
||||
- Return 'markdown_text'.
|
||||
|
||||
|
Reference in New Issue
Block a user