diff --git a/docs/.mdl_ruleset.rb b/docs/.mdl_ruleset.rb index a32f752d2e65..7cf80606d77e 100644 --- a/docs/.mdl_ruleset.rb +++ b/docs/.mdl_ruleset.rb @@ -1,6 +1,9 @@ -rule 'HB034', 'Bare unstyled URL used' do +# typed: true +# frozen_string_literal: true + +rule "HB034", "Bare unstyled URL used" do tags :links, :url - aliases 'no-bare-unstyled-urls' + aliases "no-bare-unstyled-urls" check do |doc| doc.matching_text_element_lines(%r{(?<=\s)https?://}) end diff --git a/docs/.mdl_style.rb b/docs/.mdl_style.rb index d7a297fede20..dda5902a4e8d 100644 --- a/docs/.mdl_style.rb +++ b/docs/.mdl_style.rb @@ -1,8 +1,11 @@ +# typed: true +# frozen_string_literal: true + all -rule 'MD007', indent: 2 # Unordered list indentation -rule 'MD026', punctuation: ',;:' # Trailing punctuation in header -exclude_rule 'MD013' # Line length -exclude_rule 'MD029' # Ordered list item prefix -exclude_rule 'MD033' # Inline HTML -exclude_rule 'MD034' # Bare URL used (replaced by HB034) -exclude_rule 'MD046' # Code block style +rule "MD007", indent: 2 # Unordered list indentation +rule "MD026", punctuation: ",;:" # Trailing punctuation in header +exclude_rule "MD013" # Line length +exclude_rule "MD029" # Ordered list item prefix +exclude_rule "MD033" # Inline HTML +exclude_rule "MD034" # Bare URL used (replaced by HB034) +exclude_rule "MD046" # Code block style diff --git a/docs/.rubocop.yml b/docs/.rubocop.yml index e5a8df064eca..1c984c707e2d 100644 --- a/docs/.rubocop.yml +++ b/docs/.rubocop.yml @@ -2,12 +2,9 @@ inherit_from: ../Library/.rubocop.yml AllCops: Exclude: - - Gemfile - - ".mdl*.rb" - - Rakefile - - "_site/**/*" - - Manpage.md - - "vendor/**/*" + - "**/_site/**/*" + - "**/Manpage.md" + - "**/vendor/**/*" # These are included in docs deliberately to show what # `brew create` does and what the user should replace. @@ -22,7 +19,7 @@ FormulaAudit/Homepage: Layout/LineLength: Exclude: - - Bottles.md # The bottle block line length is long in its full form. + - "**/Bottles.md" # The bottle block line length is long in its full form. # Apparently Casks are allowed to have constant definitions in blocks and we document this. Lint/ConstantDefinitionInBlock: diff --git a/docs/Gemfile b/docs/Gemfile index f45f45b95f0d..12ef85fa9750 100644 --- a/docs/Gemfile +++ b/docs/Gemfile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + source "https://rubygems.org" ruby file: ".ruby-version" diff --git a/docs/Rakefile b/docs/Rakefile index e3a39f805d1b..4d76f69297f9 100644 --- a/docs/Rakefile +++ b/docs/Rakefile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "rake" task default: :build diff --git a/docs/docs_rubocop_style.yml b/docs/docs_rubocop_style.yml new file mode 100644 index 000000000000..1c984c707e2d --- /dev/null +++ b/docs/docs_rubocop_style.yml @@ -0,0 +1,34 @@ +inherit_from: ../Library/.rubocop.yml + +AllCops: + Exclude: + - "**/_site/**/*" + - "**/Manpage.md" + - "**/vendor/**/*" + +# These are included in docs deliberately to show what +# `brew create` does and what the user should replace. +FormulaAudit/Comments: + Enabled: false + +# This forces us to use dummy descriptions/homepages in example formulae which we don't need to clutter the docs with. +FormulaAudit/Desc: + Enabled: false +FormulaAudit/Homepage: + Enabled: false + +Layout/LineLength: + Exclude: + - "**/Bottles.md" # The bottle block line length is long in its full form. + +# Apparently Casks are allowed to have constant definitions in blocks and we document this. +Lint/ConstantDefinitionInBlock: + Enabled: false + +# A fake regexp is deliberately documented for `inreplace` in the Formula Cookbook. +Style/RedundantRegexpArgument: + Enabled: false + +# Want to be able to display partial formulae in the docs. +Style/TopLevelMethodDefinition: + Enabled: false