Skip to content

Commit

Permalink
Refactor code in pr_code_suggestions.py and remove 'use_repo_settings…
Browse files Browse the repository at this point in the history
…_file' from azure.md and automations_and_usage.md
  • Loading branch information
mrT23 committed Mar 15, 2024
1 parent 4425607 commit 1593d89
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 8 deletions.
1 change: 0 additions & 1 deletion docs/docs/installation/azure.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ To use Azure DevOps provider use the following settings in configuration.toml:
```
[config]
git_provider="azure"
use_repo_settings_file=false
```

Azure DevOps provider supports [PAT token](https://learn.microsoft.com/en-us/azure/devops/organizations/accounts/use-personal-access-tokens-to-authenticate?view=azure-devops&tabs=Windows) or [DefaultAzureCredential](https://learn.microsoft.com/en-us/azure/developer/python/sdk/authentication-overview#authentication-in-server-environments) authentication.
Expand Down
1 change: 0 additions & 1 deletion docs/docs/usage-guide/automations_and_usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,6 @@ To use Azure DevOps provider use the following settings in configuration.toml:
```
[config]
git_provider="azure"
use_repo_settings_file=false
```
Azure DevOps provider supports [PAT token](https://learn.microsoft.com/en-us/azure/devops/organizations/accounts/use-personal-access-tokens-to-authenticate?view=azure-devops&tabs=Windows) or [DefaultAzureCredential](https://learn.microsoft.com/en-us/azure/developer/python/sdk/authentication-overview#authentication-in-server-environments) authentication.
Expand Down
8 changes: 2 additions & 6 deletions pr_agent/tools/pr_code_suggestions.py
Original file line number Diff line number Diff line change
Expand Up @@ -393,11 +393,7 @@ def generate_summarized_suggestions(self, data: Dict) -> str:

for label, suggestions in suggestions_labels.items():
num_suggestions=len(suggestions)
# pr_body += f"""<tr><td><strong>{label}</strong></td>"""
pr_body += f"""<tr><td rowspan={num_suggestions}><strong>{label.capitalize()}</strong></td>\n"""
# pr_body += f"""<td>"""
# pr_body += f"""<details><summary>{len(suggestions)} suggestions</summary>"""
# pr_body += f"""<table>"""
for i, suggestion in enumerate(suggestions):

relevant_file = suggestion['relevant_file'].strip()
Expand Down Expand Up @@ -444,11 +440,11 @@ def generate_summarized_suggestions(self, data: Dict) -> str:
{example_code}
"""
pr_body += f"</details>"

pr_body += f"</td></tr>"


# pr_body += "</details>"
pr_body += """</td></tr>"""
# pr_body += """</td></tr>"""
pr_body += """</tr></tbody></table>"""
return pr_body
except Exception as e:
Expand Down

0 comments on commit 1593d89

Please sign in to comment.