diff --git a/entrypoint.py b/entrypoint.py index f8197ce..7af1383 100644 --- a/entrypoint.py +++ b/entrypoint.py @@ -101,7 +101,7 @@ class TypeSuggestion(NamedTuple): "side": "RIGHT", "commit_id": commit_id, "body": "The following type annotation might be useful:\n ```suggestion\n" - f"{annotate_parameter(suggestion.filepath[1:],suggestion.file_location,suggestion.name,suggestion.suggestion)}\n```\n", + f"{annotate_parameter(suggestion.filepath[1:],suggestion.file_location,suggestion.name,suggestion.suggestion)}```\n", } headers = { "authorization": f"Bearer {github_token}", diff --git a/src/annotationutils.py b/src/annotationutils.py index 6ada87d..66fee52 100644 --- a/src/annotationutils.py +++ b/src/annotationutils.py @@ -13,7 +13,8 @@ def annotate_parameter( target_line = lines[location[0] - 1] assert target_line[location[1] :].startswith(param_name) return ( - target_line[: location[1] + len(param_name)] + " " + + target_line[: location[1] + len(param_name)] # It's unclear why a single char is lost... + f": {annotation}" + target_line[location[1] + len(param_name) :] )