@@ -69,13 +69,15 @@ def add_coverage_comments(client, uncovered_files)
69
69
else
70
70
comment = generate_comment ( COMMENT_HEADER , xcresult_file )
71
71
if start_line == line
72
- # One line code comment will only rely on the position param, which is
73
- # 'line' here.
74
- client . create_pull_request_comment ( REPO , PULL_REQUEST , comment , TESTING_COMMIT , changed_file [ 'fileName' ] , line , { :side => "RIGHT" } )
72
+ # One line code comment will have nil in start_line and override
73
+ # the position param, which is 0 here. The position param is a
74
+ # relative number in the `git diff`, instead of a absolute line
75
+ # index.
76
+ client . create_pull_request_comment ( REPO , PULL_REQUEST , comment , TESTING_COMMIT , changed_file [ 'fileName' ] , 0 , { :side => "RIGHT" , :line => line } )
75
77
else
76
78
# multiple-line code block comment needs start_line and line options,
77
79
# which will override the position param.
78
- client . create_pull_request_comment ( REPO , PULL_REQUEST , comment , TESTING_COMMIT , changed_file [ 'fileName' ] , 0 , { :side => "RIGHT" , :start_line => start_line , :line => line } )
80
+ client . create_pull_request_comment ( REPO , PULL_REQUEST , comment , TESTING_COMMIT , changed_file [ 'fileName' ] , 0 , { :side => "RIGHT" , :start_line => start_line , :line => line } )
79
81
end
80
82
start_line = coverage_line [ idx +1 ]
81
83
end
0 commit comments