Skip to content

Commit

Permalink
Merge pull request #252 from Earlopain/documentation-url
Browse files Browse the repository at this point in the history
Set `DocumentationBaseURL` and `DocumentationExtension`
  • Loading branch information
amomchilov authored Sep 4, 2024
2 parents f108619 + 07adee0 commit 115d959
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/rubocop/sorbet/inject.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@ class << self
def defaults!
path = CONFIG_DEFAULT.to_s
hash = ConfigLoader.send(:load_yaml_configuration, path)
if Gem::Version.new(RuboCop::Version::STRING) >= Gem::Version.new("1.66")
# We use markdown for cop documentation. Unconditionally setting
# the base url will produce incorrect urls on older RuboCop versions,
# so we do that for fully supported version only here.
hash["Sorbet"] ||= {}
hash["Sorbet"]["DocumentationBaseURL"] = "https://github.com/Shopify/rubocop-sorbet/blob/main/manual"
hash["Sorbet"]["DocumentationExtension"] = ".md"
end
config = Config.new(hash, path).tap(&:make_excludes_absolute)
puts "configuration from #{path}" if ConfigLoader.debug?
config = ConfigLoader.merge_with_default(config, path)
Expand Down

0 comments on commit 115d959

Please sign in to comment.