Skip to content

Commit d68b752

Browse files
committed
Dangerfile: don't generate links with line 0 in checkstyle report.
No functional changes. [ci skip]
1 parent 22b3e5b commit d68b752

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Dangerfile

+6-1
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,14 @@ if File.file?(cs_report)
4040
doc.xpath('//error').each do |node|
4141
errors_count += 1
4242
line = node['line']
43+
if line.to_i > 0
44+
line = '#L' + line
45+
else
46+
line = ''
47+
end
4348
msg = node['message'].sub(/\.$/, '')
4449
file = node.parent['name'].sub(pwd, '')
45-
file = github.html_link("#{file}#L#{line}")
50+
file = github.html_link("#{file}#{line}")
4651
fail("maven-checkstyle-plugin error in #{file}:\n#{msg}")
4752
end
4853
print_errors_summary 'maven-checkstyle-plugin', errors_count, 'https://github.com/php-coder/mystamps/wiki/checkstyle'

0 commit comments

Comments
 (0)