brew/docs/.mdl_ruleset.rb

25 lines
651 B
Ruby
Raw Permalink Normal View History

2024-06-13 09:41:31 +01:00
# typed: true
# frozen_string_literal: true
rule "HB034", "Bare unstyled URL used" do
tags :links, :url
2024-06-13 09:41:31 +01:00
aliases "no-bare-unstyled-urls"
check do |doc|
doc.matching_text_element_lines(%r{(?<=\s)https?://})
end
end
2025-05-22 10:40:58 -04:00
rule "HB100", "Full URL for internal link used" do
tags :links, :url
aliases "no-full-urls-for-internal-links"
check do |doc|
doc.matching_lines(%r{\]\(https://docs.brew.sh/.+?\)})
end
end
rule "HB101", "File extension missing from internal link" do
tags :links, :url
aliases "file-extension-required-for-internal-links"
check do |doc|
doc.matching_lines(/\]\((?!#|\w+:)(?>[^#.)]+)(?!\.\w+)/)
end
end