File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -29,15 +29,20 @@ def start_element(name, attrs = [])
2929 case name
3030 when 'file'
3131 @current_violations = [ ]
32- @current_filename = attrs [ 'name' ] . sub ( /^ #{ @working_dir } / , '' )
32+ @current_filename = remove_work_dir! ( attrs [ 'name' ] )
3333 when 'violation'
3434 @current_violation = PmdViolation . new ( attrs , @branch_name )
3535 when 'error'
36- @current_filename = attrs [ 'filename' ] . sub ( /^#{ @working_dir } / , '' )
36+ @current_filename = remove_work_dir! ( attrs [ 'filename' ] )
37+ remove_work_dir! ( attrs [ 'msg' ] )
3738 @current_error = PmdError . new ( attrs , @branch_name )
3839 end
3940 end
4041
42+ def remove_work_dir! ( str )
43+ str . sub! ( /^#{ @working_dir } / , '' )
44+ end
45+
4146 def characters ( string )
4247 @current_violation . text = string unless @current_violation . nil?
4348 end
You can’t perform that action at this time.
0 commit comments