Skip to content

Commit b53b846

Browse files
committed
add link to license msg
1 parent 49b0445 commit b53b846

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

Dangerfile

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,15 @@ else
104104
errors_count += 1
105105
line.sub!('[WARNING] ', '')
106106
line.sub!(pwd, '')
107-
# TODO: extract file name
108-
fail("license error: #{line}")
107+
if line =~ /Missing header in: .*/
108+
parsed = line.match(/(?<msg>[^:]+) in: (?<file>.*)/)
109+
msg = parsed['msg']
110+
file = parsed['file']
111+
file = github.html_link("#{file}#L1")
112+
fail("license error in #{file}: #{msg}")
113+
else
114+
fail("license error: #{line}")
115+
end
109116
end
110117
print_errors_summary 'license plugin', errors_count, 'https://github.com/php-coder/mystamps/wiki/check-license-header'
111118
end

0 commit comments

Comments
 (0)