File tree Expand file tree Collapse file tree 2 files changed +9
-6
lines changed
Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -208,15 +208,18 @@ def parse_test_location(failure)
208208 end
209209
210210 def format_path ( path )
211- clean_path , line = parse_filename ( path )
212- path = clean_path + '#L' + line if clean_path && line
213-
214211 # Pick a Dangerfile plugin for a chosen request_source
215212 # based on https://github.com/danger/danger/blob/master/lib/danger/plugin_support/plugin.rb#L31
216213 plugins = Plugin . all_plugins . select { |plugin | Dangerfile . essential_plugin_classes . include? plugin }
217214 plugin = plugins . select { |p | p . method_defined? :html_link } . map { |p | p . new ( @dangerfile ) } . compact . first
218215
219- plugin . html_link ( path )
216+ if plugin
217+ clean_path , line = parse_filename ( path )
218+ path = clean_path + '#L' + line if clean_path && line
219+ plugin . html_link ( path )
220+ else
221+ path
222+ end
220223 end
221224
222225 def parse_filename ( path )
Original file line number Diff line number Diff line change @@ -204,9 +204,9 @@ module Danger
204204
205205 describe 'where request source' do
206206 it 'should be bitbucket' do
207- path = @xcode_summary . send ( :format_path , 'lib/xcode_summary/plugin.rb#L3 ' )
207+ path = @xcode_summary . send ( :format_path , 'lib/xcode_summary/plugin.rb:3 ' )
208208 # rubocop:disable LineLength
209- expect ( path ) . to eq "<a href='https://github.com/diogot/danger-xcode_summary/ lib/xcode_summary/plugin.rb?at=4d4c0f31857e3185b51b6865a0700525bc0cb2bb#L3'>lib/xcode_summary/plugin.rb</a> "
209+ expect ( path ) . to eq "lib/xcode_summary/plugin.rb:3 "
210210 # rubocop:enable LineLength
211211 end
212212 end
You can’t perform that action at this time.
0 commit comments