Merge pull request #46 from Codium-ai/tr/description_tool

Add PR Description Tool
This commit is contained in:
mrT23
2023-07-13 21:00:50 +03:00
committed by GitHub
14 changed files with 162 additions and 27 deletions

View File

@ -24,10 +24,10 @@ def get_pr_diff(git_provider: Union[GithubProvider, Any], token_handler: TokenHa
Returns a string with the diff of the PR.
If needed, apply diff minimization techniques to reduce the number of tokens
"""
git_provider.pr.files = list(git_provider.get_diff_files())
git_provider.pr.diff_files = list(git_provider.get_diff_files())
# get pr languages
pr_languages = sort_files_by_main_languages(git_provider.get_languages(), git_provider.pr.files)
pr_languages = sort_files_by_main_languages(git_provider.get_languages(), git_provider.pr.diff_files)
# generate a standard diff string, with patch extension
patches_extended, total_tokens = pr_generate_extended_diff(pr_languages, token_handler)

View File

@ -11,7 +11,6 @@ def convert_to_markdown(output_data: dict) -> str:
emojis = {
"Main theme": "🎯",
"Description and title": "🔍",
"Type of PR": "📌",
"Relevant tests added": "🧪",
"Unrelated changes": "⚠️",