@@ -23,11 +23,13 @@ require 'nokogiri'
23
23
24
24
pwd = Dir . pwd + '/'
25
25
26
- def print_errors_summary ( program , errors , link )
26
+ def print_errors_summary ( program , errors , link , suggested_fix = '' )
27
27
if errors == 1
28
- message ( "#{ program } reports about #{ errors } error. Please, fix it. See also: <a href=\" #{ link } \" >#{ link } </a>" )
28
+ fix_msg = "Please, fix it#{ suggested_fix } "
29
+ message ( "#{ program } reports about #{ errors } error. #{ fix_msg } . See also: <a href=\" #{ link } \" >#{ link } </a>" )
29
30
elsif errors > 0
30
- message ( "#{ program } reports about #{ errors } errors. Please, fix them. See also: <a href=\" #{ link } \" >#{ link } </a>" )
31
+ fix_msg = "Please, fix them#{ suggested_fix } "
32
+ message ( "#{ program } reports about #{ errors } errors. #{ fix_msg } . See also: <a href=\" #{ link } \" >#{ link } </a>" )
31
33
end
32
34
end
33
35
@@ -114,7 +116,12 @@ else
114
116
fail ( "license error: #{ line } " )
115
117
end
116
118
end
117
- print_errors_summary 'license plugin' , errors_count , 'https://github.com/php-coder/mystamps/wiki/check-license-header'
119
+ print_errors_summary (
120
+ program :'license plugin' ,
121
+ errors :errors_count ,
122
+ link :'https://github.com/php-coder/mystamps/wiki/check-license-header' ,
123
+ suggested_fix :' by executing `mvn license:format`'
124
+ )
118
125
end
119
126
120
127
# Handle `mvn sortpom:verify` output
@@ -143,7 +150,12 @@ else
143
150
line . sub! ( '[ERROR] ' , '' )
144
151
fail ( "pom.xml error: #{ line } " )
145
152
end
146
- print_errors_summary 'sortpom plugin' , errors_count , 'https://github.com/php-coder/mystamps/wiki/sortpom'
153
+ print_errors_summary (
154
+ program :'sortpom plugin' ,
155
+ errors :errors_count ,
156
+ link :'https://github.com/php-coder/mystamps/wiki/sortpom' ,
157
+ suggested_fix :' by executing `mvn sortpom:sort`'
158
+ )
147
159
end
148
160
149
161
# Handle `rflint` output
0 commit comments