diff --git a/Library/.rubocop.yml b/Library/.rubocop.yml index f77b6a7560..312c43ad51 100644 --- a/Library/.rubocop.yml +++ b/Library/.rubocop.yml @@ -13,7 +13,6 @@ inherit_mode: AllCops: TargetRubyVersion: 2.6 - DisplayCopNames: false ActiveSupportExtensionsEnabled: true NewCops: enable Include: diff --git a/Library/Homebrew/test/rubocops/bottle/bottle_digest_indentation_spec.rb b/Library/Homebrew/test/rubocops/bottle/bottle_digest_indentation_spec.rb index 01e5c3e5b3..2567d8c4f8 100644 --- a/Library/Homebrew/test/rubocops/bottle/bottle_digest_indentation_spec.rb +++ b/Library/Homebrew/test/rubocops/bottle/bottle_digest_indentation_spec.rb @@ -75,9 +75,9 @@ describe RuboCop::Cop::FormulaAudit::BottleDigestIndentation do rebuild 4 sha256 arm64_big_sur: "aaaaaaaa" sha256 big_sur: "faceb00c" - ^^^^^^^^^^ Align bottle digests + ^^^^^^^^^^ FormulaAudit/BottleDigestIndentation: Align bottle digests sha256 catalina: "deadbeef" - ^^^^^^^^^^ Align bottle digests + ^^^^^^^^^^ FormulaAudit/BottleDigestIndentation: Align bottle digests end end RUBY @@ -105,9 +105,9 @@ describe RuboCop::Cop::FormulaAudit::BottleDigestIndentation do rebuild 4 sha256 cellar: :any, arm64_big_sur: "aaaaaaaa" sha256 cellar: "/usr/local/Cellar", big_sur: "faceb00c" - ^^^^^^^^^^ Align bottle digests + ^^^^^^^^^^ FormulaAudit/BottleDigestIndentation: Align bottle digests sha256 catalina: "deadbeef" - ^^^^^^^^^^ Align bottle digests + ^^^^^^^^^^ FormulaAudit/BottleDigestIndentation: Align bottle digests end end RUBY diff --git a/Library/Homebrew/test/rubocops/bottle/bottle_format_spec.rb b/Library/Homebrew/test/rubocops/bottle/bottle_format_spec.rb index 408d08747d..27cf4f7b20 100644 --- a/Library/Homebrew/test/rubocops/bottle/bottle_format_spec.rb +++ b/Library/Homebrew/test/rubocops/bottle/bottle_format_spec.rb @@ -23,7 +23,7 @@ describe RuboCop::Cop::FormulaAudit::BottleFormat do bottle do sha256 "faceb00c" => :big_sur - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `sha256` should use new syntax + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/BottleFormat: `sha256` should use new syntax end end RUBY @@ -45,9 +45,9 @@ describe RuboCop::Cop::FormulaAudit::BottleFormat do bottle do rebuild 4 sha256 "faceb00c" => :big_sur - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `sha256` should use new syntax + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/BottleFormat: `sha256` should use new syntax sha256 "deadbeef" => :catalina - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `sha256` should use new syntax + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/BottleFormat: `sha256` should use new syntax end end RUBY @@ -72,12 +72,12 @@ describe RuboCop::Cop::FormulaAudit::BottleFormat do bottle do cellar :any - ^^^^^^^^^^^ `cellar` should be a parameter to `sha256` + ^^^^^^^^^^^ FormulaAudit/BottleFormat: `cellar` should be a parameter to `sha256` rebuild 4 sha256 "faceb00c" => :big_sur - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `sha256` should use new syntax + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/BottleFormat: `sha256` should use new syntax sha256 "deadbeef" => :catalina - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `sha256` should use new syntax + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/BottleFormat: `sha256` should use new syntax end end RUBY @@ -100,9 +100,9 @@ describe RuboCop::Cop::FormulaAudit::BottleFormat do bottle do cellar :any - ^^^^^^^^^^^ `cellar` should be a parameter to `sha256` + ^^^^^^^^^^^ FormulaAudit/BottleFormat: `cellar` should be a parameter to `sha256` sha256 "faceb00c" => :big_sur - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `sha256` should use new syntax + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/BottleFormat: `sha256` should use new syntax end end RUBY @@ -123,12 +123,12 @@ describe RuboCop::Cop::FormulaAudit::BottleFormat do bottle do cellar "/usr/local/Cellar" - ^^^^^^^^^^^^^^^^^^^^^^^^^^ `cellar` should be a parameter to `sha256` + ^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/BottleFormat: `cellar` should be a parameter to `sha256` rebuild 4 sha256 "faceb00c" => :big_sur - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `sha256` should use new syntax + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/BottleFormat: `sha256` should use new syntax sha256 "deadbeef" => :catalina - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `sha256` should use new syntax + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/BottleFormat: `sha256` should use new syntax end end RUBY diff --git a/Library/Homebrew/test/rubocops/bottle/bottle_order_spec.rb b/Library/Homebrew/test/rubocops/bottle/bottle_order_spec.rb index 356a6ac48e..56669eb009 100644 --- a/Library/Homebrew/test/rubocops/bottle/bottle_order_spec.rb +++ b/Library/Homebrew/test/rubocops/bottle/bottle_order_spec.rb @@ -122,7 +122,7 @@ describe RuboCop::Cop::FormulaAudit::BottleOrder do url "https://brew.sh/foo-1.0.tgz" bottle do - ^^^^^^^^^ ARM bottles should be listed before Intel bottles + ^^^^^^^^^ FormulaAudit/BottleOrder: ARM bottles should be listed before Intel bottles rebuild 4 sha256 big_sur: "faceb00c" sha256 catalina: "deadbeef" @@ -151,7 +151,7 @@ describe RuboCop::Cop::FormulaAudit::BottleOrder do url "https://brew.sh/foo-1.0.tgz" bottle do - ^^^^^^^^^ ARM bottles should be listed before Intel bottles + ^^^^^^^^^ FormulaAudit/BottleOrder: ARM bottles should be listed before Intel bottles rebuild 4 sha256 big_sur: "faceb00c" sha256 arm64_catalina: "aaaaaaaa" @@ -182,7 +182,7 @@ describe RuboCop::Cop::FormulaAudit::BottleOrder do url "https://brew.sh/foo-1.0.tgz" bottle do - ^^^^^^^^^ ARM bottles should be listed before Intel bottles + ^^^^^^^^^ FormulaAudit/BottleOrder: ARM bottles should be listed before Intel bottles rebuild 4 sha256 cellar: "/usr/local/Cellar", big_sur: "faceb00c" sha256 catalina: "deadbeef" @@ -213,7 +213,7 @@ describe RuboCop::Cop::FormulaAudit::BottleOrder do url "https://brew.sh/foo-1.0.tgz" bottle do - ^^^^^^^^^ ARM bottles should be listed before Intel bottles + ^^^^^^^^^ FormulaAudit/BottleOrder: ARM bottles should be listed before Intel bottles cellar :any sha256 "faceb00c" => :big_sur sha256 "aaaaaaaa" => :arm64_big_sur diff --git a/Library/Homebrew/test/rubocops/bottle/bottle_tag_indentation_spec.rb b/Library/Homebrew/test/rubocops/bottle/bottle_tag_indentation_spec.rb index c094c8d48e..f40b2e5ad8 100644 --- a/Library/Homebrew/test/rubocops/bottle/bottle_tag_indentation_spec.rb +++ b/Library/Homebrew/test/rubocops/bottle/bottle_tag_indentation_spec.rb @@ -74,10 +74,10 @@ describe RuboCop::Cop::FormulaAudit::BottleTagIndentation do bottle do rebuild 4 sha256 cellar: :any, arm64_big_sur: "aaaaaaaa" - ^^^^^^^^^^^^^^^^^^^^^^^^^ Align bottle tags + ^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/BottleTagIndentation: Align bottle tags sha256 cellar: "/usr/local/Cellar", big_sur: "faceb00c" sha256 catalina: "deadbeef" - ^^^^^^^^^^^^^^^^^^^^ Align bottle tags + ^^^^^^^^^^^^^^^^^^^^ FormulaAudit/BottleTagIndentation: Align bottle tags end end RUBY diff --git a/Library/Homebrew/test/rubocops/cask/desc_spec.rb b/Library/Homebrew/test/rubocops/cask/desc_spec.rb index 23013c3c29..c6fa850edf 100644 --- a/Library/Homebrew/test/rubocops/cask/desc_spec.rb +++ b/Library/Homebrew/test/rubocops/cask/desc_spec.rb @@ -17,14 +17,14 @@ describe RuboCop::Cop::Cask::Desc do expect_offense <<~RUBY, "/homebrew-cask/Casks/foo.rb" cask 'foo' do desc 'A bar program' - ^ Description shouldn't start with an article. + ^ Cask/Desc: Description shouldn't start with an article. end RUBY expect_offense <<~RUBY, "/homebrew-cask/Casks/foo.rb" cask 'foo' do desc 'The bar program' - ^^^ Description shouldn't start with an article. + ^^^ Cask/Desc: Description shouldn't start with an article. end RUBY @@ -39,35 +39,35 @@ describe RuboCop::Cop::Cask::Desc do expect_offense <<~RUBY, "/homebrew-cask/Casks/foo.rb" cask 'foobar' do desc 'Foo bar program' - ^^^^^^^ Description shouldn't start with the cask name. + ^^^^^^^ Cask/Desc: Description shouldn't start with the cask name. end RUBY expect_offense <<~RUBY, "/homebrew-cask/Casks/foo.rb" cask 'foobar' do desc 'Foo-Bar program' - ^^^^^^^ Description shouldn't start with the cask name. + ^^^^^^^ Cask/Desc: Description shouldn't start with the cask name. end RUBY expect_offense <<~RUBY, "/homebrew-cask/Casks/foo.rb" cask 'foo-bar' do desc 'Foo bar program' - ^^^^^^^ Description shouldn't start with the cask name. + ^^^^^^^ Cask/Desc: Description shouldn't start with the cask name. end RUBY expect_offense <<~RUBY, "/homebrew-cask/Casks/foo.rb" cask 'foo-bar' do desc 'Foo-Bar program' - ^^^^^^^ Description shouldn't start with the cask name. + ^^^^^^^ Cask/Desc: Description shouldn't start with the cask name. end RUBY expect_offense <<~RUBY, "/homebrew-cask/Casks/foo.rb" cask 'foo-bar' do desc 'Foo Bar' - ^^^^^^^ Description shouldn't start with the cask name. + ^^^^^^^ Cask/Desc: Description shouldn't start with the cask name. end RUBY end @@ -76,28 +76,28 @@ describe RuboCop::Cop::Cask::Desc do expect_offense <<~RUBY, "/homebrew-cask/Casks/foo.rb" cask 'foo-bar' do desc 'macOS status bar monitor' - ^^^^^ Description shouldn't contain the platform. + ^^^^^ Cask/Desc: Description shouldn't contain the platform. end RUBY expect_offense <<~RUBY, "/homebrew-cask/Casks/foo.rb" cask 'foo-bar' do desc 'Toggles dark mode on Mac OS Mojave' - ^^^^^^ Description shouldn't contain the platform. + ^^^^^^ Cask/Desc: Description shouldn't contain the platform. end RUBY expect_offense <<~RUBY, "/homebrew-cask/Casks/foo.rb" cask 'foo-bar' do desc 'Better input source switcher for OS X' - ^^^^ Description shouldn't contain the platform. + ^^^^ Cask/Desc: Description shouldn't contain the platform. end RUBY expect_offense <<~RUBY, "/homebrew-cask/Casks/foo.rb" cask 'foo-bar' do desc 'Media Manager for Mac OS X' - ^^^^^^^^ Description shouldn't contain the platform. + ^^^^^^^^ Cask/Desc: Description shouldn't contain the platform. end RUBY @@ -110,7 +110,7 @@ describe RuboCop::Cop::Cask::Desc do expect_offense <<~RUBY cask 'foo' do desc 'Application for managing macOS virtual machines on macOS' - ^^^^^ Description shouldn't contain the platform. + ^^^^^ Cask/Desc: Description shouldn't contain the platform. end RUBY diff --git a/Library/Homebrew/test/rubocops/cask/homepage_url_trailing_slash_spec.rb b/Library/Homebrew/test/rubocops/cask/homepage_url_trailing_slash_spec.rb index 9877b9f3e3..13962ddcf1 100644 --- a/Library/Homebrew/test/rubocops/cask/homepage_url_trailing_slash_spec.rb +++ b/Library/Homebrew/test/rubocops/cask/homepage_url_trailing_slash_spec.rb @@ -50,8 +50,7 @@ describe RuboCop::Cop::Cask::HomepageUrlTrailingSlash do end let(:expected_offenses) do [{ - message: "'https://foo.brew.sh' must have a slash " \ - "after the domain.", + message: "Cask/HomepageUrlTrailingSlash: 'https://foo.brew.sh' must have a slash after the domain.", severity: :convention, line: 2, column: 11, diff --git a/Library/Homebrew/test/rubocops/cask/no_dsl_version_spec.rb b/Library/Homebrew/test/rubocops/cask/no_dsl_version_spec.rb index a8f1c574e5..812f2e3844 100644 --- a/Library/Homebrew/test/rubocops/cask/no_dsl_version_spec.rb +++ b/Library/Homebrew/test/rubocops/cask/no_dsl_version_spec.rb @@ -20,7 +20,7 @@ describe RuboCop::Cop::Cask::NoDslVersion do let(:correct_source) { "cask 'foo' do; end" } let(:expected_offenses) do [{ - message: "Use `cask 'foo'` instead of `cask :v1 => 'foo'`", + message: "Cask/NoDslVersion: Use `cask 'foo'` instead of `cask :v1 => 'foo'`", severity: :convention, line: 1, column: 0, diff --git a/Library/Homebrew/test/rubocops/cask/no_overrides_spec.rb b/Library/Homebrew/test/rubocops/cask/no_overrides_spec.rb index 4227b90dd3..0bd4639a5d 100644 --- a/Library/Homebrew/test/rubocops/cask/no_overrides_spec.rb +++ b/Library/Homebrew/test/rubocops/cask/no_overrides_spec.rb @@ -201,7 +201,7 @@ describe RuboCop::Cop::Cask::NoOverrides do let(:expected_offenses) do [{ message: <<~EOS, - Do not use a top-level `sha256` stanza as the default. Add it to an `on_{system}` block instead. + Cask/NoOverrides: Do not use a top-level `sha256` stanza as the default. Add it to an `on_{system}` block instead. Use `:or_older` or `:or_newer` to specify a range of macOS versions. EOS severity: :convention, @@ -210,7 +210,7 @@ describe RuboCop::Cop::Cask::NoOverrides do source: "sha256 \"aaa\"", }, { message: <<~EOS, - Do not use a top-level `url` stanza as the default. Add it to an `on_{system}` block instead. + Cask/NoOverrides: Do not use a top-level `url` stanza as the default. Add it to an `on_{system}` block instead. Use `:or_older` or `:or_newer` to specify a range of macOS versions. EOS severity: :convention, @@ -240,7 +240,7 @@ describe RuboCop::Cop::Cask::NoOverrides do let(:expected_offenses) do [{ message: <<~EOS, - Do not use a top-level `version` stanza as the default. Add it to an `on_{system}` block instead. + Cask/NoOverrides: Do not use a top-level `version` stanza as the default. Add it to an `on_{system}` block instead. Use `:or_older` or `:or_newer` to specify a range of macOS versions. EOS severity: :convention, diff --git a/Library/Homebrew/test/rubocops/cask/on_system_conditionals_spec.rb b/Library/Homebrew/test/rubocops/cask/on_system_conditionals_spec.rb index 968f5b01a0..9a298d4a63 100644 --- a/Library/Homebrew/test/rubocops/cask/on_system_conditionals_spec.rb +++ b/Library/Homebrew/test/rubocops/cask/on_system_conditionals_spec.rb @@ -49,7 +49,9 @@ describe RuboCop::Cop::Cask::OnSystemConditionals do end let(:expected_offenses) do [{ - message: "Don't use `on_intel` in `postflight do`, use `if Hardware::CPU.intel?` instead.", + message: <<~EOS.chomp, + Cask/OnSystemConditionals: Don't use `on_intel` in `postflight do`, use `if Hardware::CPU.intel?` instead. + EOS severity: :convention, line: 3, column: 4, @@ -87,7 +89,8 @@ describe RuboCop::Cop::Cask::OnSystemConditionals do end let(:expected_offenses) do [{ - message: "Don't use `on_monterey` in `postflight do`, use `if MacOS.version == :monterey` instead.", + message: "Cask/OnSystemConditionals: Don't use `on_monterey` in `postflight do`, use " \ + "`if MacOS.version == :monterey` instead.", severity: :convention, line: 3, column: 4, @@ -125,7 +128,7 @@ describe RuboCop::Cop::Cask::OnSystemConditionals do end let(:expected_offenses) do [{ - message: "Don't use `on_monterey :or_older` in `postflight do`, " \ + message: "Cask/OnSystemConditionals: Don't use `on_monterey :or_older` in `postflight do`, " \ "use `if MacOS.version <= :monterey` instead.", severity: :convention, line: 3, @@ -196,9 +199,9 @@ describe RuboCop::Cop::Cask::OnSystemConditionals do end let(:expected_offenses) do [{ - message: 'Use `sha256 arm: "8c62a2b791cf5f0da6066a0a4b6e85f62949cd60975da062df44adf887f4370b", ' \ - 'intel: "67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94"` instead of ' \ - "nesting the `sha256` stanzas in `on_intel` and `on_arm` blocks", + message: <<~EOS.chomp, + Cask/OnSystemConditionals: Use `sha256 arm: "8c62a2b791cf5f0da6066a0a4b6e85f62949cd60975da062df44adf887f4370b", intel: "67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94"` instead of nesting the `sha256` stanzas in `on_intel` and `on_arm` blocks + EOS severity: :convention, line: 5, column: 2, @@ -278,7 +281,9 @@ describe RuboCop::Cop::Cask::OnSystemConditionals do end let(:expected_offenses) do [{ - message: "Don't use `Hardware::CPU.arm?`, use `on_arm` and `on_intel` blocks instead.", + message: <<~EOS.chomp, + Cask/OnSystemConditionals: Don't use `Hardware::CPU.arm?`, use `on_arm` and `on_intel` blocks instead. + EOS severity: :convention, line: 2, column: 5, @@ -303,7 +308,9 @@ describe RuboCop::Cop::Cask::OnSystemConditionals do end let(:expected_offenses) do [{ - message: "Don't use `Hardware::CPU.intel?`, use `on_arm` and `on_intel` blocks instead.", + message: <<~EOS.chomp, + Cask/OnSystemConditionals: Don't use `Hardware::CPU.intel?`, use `on_arm` and `on_intel` blocks instead. + EOS severity: :convention, line: 2, column: 5, @@ -327,7 +334,9 @@ describe RuboCop::Cop::Cask::OnSystemConditionals do end let(:expected_offenses) do [{ - message: "Don't use `Hardware::CPU.arch`, use `on_arm` and `on_intel` blocks instead.", + message: <<~EOS.chomp, + Cask/OnSystemConditionals: Don't use `Hardware::CPU.arch`, use `on_arm` and `on_intel` blocks instead. + EOS severity: :convention, line: 5, column: 44, @@ -354,7 +363,9 @@ describe RuboCop::Cop::Cask::OnSystemConditionals do end let(:expected_offenses) do [{ - message: "Don't use `if MacOS.version == :catalina`, use `on_catalina do` instead.", + message: <<~EOS.chomp, + Cask/OnSystemConditionals: Don't use `if MacOS.version == :catalina`, use `on_catalina do` instead. + EOS severity: :convention, line: 2, column: 2, @@ -379,7 +390,9 @@ describe RuboCop::Cop::Cask::OnSystemConditionals do end let(:expected_offenses) do [{ - message: "Don't use `if MacOS.version <= :catalina`, use `on_catalina :or_older do` instead.", + message: <<~EOS.chomp, + Cask/OnSystemConditionals: Don't use `if MacOS.version <= :catalina`, use `on_catalina :or_older do` instead. + EOS severity: :convention, line: 2, column: 2, @@ -404,7 +417,9 @@ describe RuboCop::Cop::Cask::OnSystemConditionals do end let(:expected_offenses) do [{ - message: "Don't use `if MacOS.version >= :catalina`, use `on_catalina :or_newer do` instead.", + message: <<~EOS.chomp, + Cask/OnSystemConditionals: Don't use `if MacOS.version >= :catalina`, use `on_catalina :or_newer do` instead. + EOS severity: :convention, line: 2, column: 2, @@ -428,7 +443,9 @@ describe RuboCop::Cop::Cask::OnSystemConditionals do end let(:expected_offenses) do [{ - message: "Don't use `MacOS.version == :monterey`, use `on_{macos_version}` blocks instead.", + message: <<~EOS.chomp, + Cask/OnSystemConditionals: Don't use `MacOS.version == :monterey`, use `on_{macos_version}` blocks instead. + EOS severity: :convention, line: 5, column: 44, diff --git a/Library/Homebrew/test/rubocops/cask/stanza_grouping_spec.rb b/Library/Homebrew/test/rubocops/cask/stanza_grouping_spec.rb index 605c99b1e5..dad7fa2ceb 100644 --- a/Library/Homebrew/test/rubocops/cask/stanza_grouping_spec.rb +++ b/Library/Homebrew/test/rubocops/cask/stanza_grouping_spec.rb @@ -10,10 +10,10 @@ describe RuboCop::Cop::Cask::StanzaGrouping do subject(:cop) { described_class.new } let(:missing_line_msg) do - "stanza groups should be separated by a single empty line" + "Cask/StanzaGrouping: stanza groups should be separated by a single empty line" end let(:extra_line_msg) do - "stanzas within the same group should have no lines between them" + "Cask/StanzaGrouping: stanzas within the same group should have no lines between them" end context "when there is only one stanza" do diff --git a/Library/Homebrew/test/rubocops/cask/stanza_order_spec.rb b/Library/Homebrew/test/rubocops/cask/stanza_order_spec.rb index b53f937e6e..1d1eebdd22 100644 --- a/Library/Homebrew/test/rubocops/cask/stanza_order_spec.rb +++ b/Library/Homebrew/test/rubocops/cask/stanza_order_spec.rb @@ -56,13 +56,13 @@ describe RuboCop::Cop::Cask::StanzaOrder do end let(:expected_offenses) do [{ - message: "`sha256` stanza out of order", + message: "Cask/StanzaOrder: `sha256` stanza out of order", severity: :convention, line: 2, column: 2, source: "sha256 :no_check", }, { - message: "`version` stanza out of order", + message: "Cask/StanzaOrder: `version` stanza out of order", severity: :convention, line: 3, column: 2, @@ -96,19 +96,19 @@ describe RuboCop::Cop::Cask::StanzaOrder do end let(:expected_offenses) do [{ - message: "`version` stanza out of order", + message: "Cask/StanzaOrder: `version` stanza out of order", severity: :convention, line: 2, column: 2, source: "version :latest", }, { - message: "`sha256` stanza out of order", + message: "Cask/StanzaOrder: `sha256` stanza out of order", severity: :convention, line: 3, column: 2, source: "sha256 :no_check", }, { - message: "`arch` stanza out of order", + message: "Cask/StanzaOrder: `arch` stanza out of order", severity: :convention, line: 4, column: 2, @@ -144,13 +144,13 @@ describe RuboCop::Cop::Cask::StanzaOrder do end let(:expected_offenses) do [{ - message: "`sha256` stanza out of order", + message: "Cask/StanzaOrder: `sha256` stanza out of order", severity: :convention, line: 3, column: 2, source: "sha256 :no_check", }, { - message: "`on_arch_conditional` stanza out of order", + message: "Cask/StanzaOrder: `on_arch_conditional` stanza out of order", severity: :convention, line: 5, column: 2, @@ -186,13 +186,13 @@ describe RuboCop::Cop::Cask::StanzaOrder do end let(:expected_offenses) do [{ - message: "`on_arch_conditional` stanza out of order", + message: "Cask/StanzaOrder: `on_arch_conditional` stanza out of order", severity: :convention, line: 2, column: 2, source: 'folder = on_arch_conditional arm: "darwin-arm64", intel: "darwin"', }, { - message: "`arch` stanza out of order", + message: "Cask/StanzaOrder: `arch` stanza out of order", severity: :convention, line: 3, column: 2, @@ -232,26 +232,26 @@ describe RuboCop::Cop::Cask::StanzaOrder do end let(:expected_offenses) do [{ - message: "`url` stanza out of order", + message: "Cask/StanzaOrder: `url` stanza out of order", severity: :convention, line: 2, column: 2, source: "url 'https://foo.brew.sh/foo.zip'", }, { - message: "`uninstall` stanza out of order", + message: "Cask/StanzaOrder: `uninstall` stanza out of order", severity: :convention, line: 3, column: 2, source: "uninstall :quit => 'com.example.foo'," \ "\n :kext => 'com.example.foo.kext'", }, { - message: "`version` stanza out of order", + message: "Cask/StanzaOrder: `version` stanza out of order", severity: :convention, line: 5, column: 2, source: "version :latest", }, { - message: "`sha256` stanza out of order", + message: "Cask/StanzaOrder: `sha256` stanza out of order", severity: :convention, line: 7, column: 2, @@ -498,13 +498,13 @@ describe RuboCop::Cop::Cask::StanzaOrder do let(:expected_offenses) do [{ - message: "`on_intel` stanza out of order", + message: "Cask/StanzaOrder: `on_intel` stanza out of order", severity: :convention, line: 2, column: 2, source: "on_intel do\n url \"https://foo.brew.sh/foo-intel.zip\"\n sha256 :no_check\n version :latest\n end", # rubocop:disable Layout/LineLength }, { - message: "`on_arm` stanza out of order", + message: "Cask/StanzaOrder: `on_arm` stanza out of order", severity: :convention, line: 8, column: 2, @@ -604,19 +604,19 @@ describe RuboCop::Cop::Cask::StanzaOrder do let(:expected_offenses) do [{ - message: "`on_ventura` stanza out of order", + message: "Cask/StanzaOrder: `on_ventura` stanza out of order", severity: :convention, line: 2, column: 2, source: "on_ventura do\n url \"https://foo.brew.sh/foo-ventura.zip\"\n sha256 :no_check\n end", }, { - message: "`on_mojave` stanza out of order", + message: "Cask/StanzaOrder: `on_mojave` stanza out of order", severity: :convention, line: 10, column: 2, source: "on_mojave do\n url \"https://foo.brew.sh/foo-mojave.zip\"\n sha256 :no_check\n end", }, { - message: "`on_big_sur` stanza out of order", + message: "Cask/StanzaOrder: `on_big_sur` stanza out of order", severity: :convention, line: 14, column: 2, diff --git a/Library/Homebrew/test/rubocops/cask/url_legacy_comma_separators_spec.rb b/Library/Homebrew/test/rubocops/cask/url_legacy_comma_separators_spec.rb index 92e2054f3c..e6206a5b53 100644 --- a/Library/Homebrew/test/rubocops/cask/url_legacy_comma_separators_spec.rb +++ b/Library/Homebrew/test/rubocops/cask/url_legacy_comma_separators_spec.rb @@ -54,7 +54,7 @@ describe RuboCop::Cop::Cask::UrlLegacyCommaSeparators do end let(:expected_offenses) do [{ - message: "Use 'version.csv.first' instead of 'version.before_comma' " \ + message: "Cask/UrlLegacyCommaSeparators: Use 'version.csv.first' instead of 'version.before_comma' " \ "and 'version.csv.second' instead of 'version.after_comma'", severity: :convention, line: 3, @@ -87,7 +87,7 @@ describe RuboCop::Cop::Cask::UrlLegacyCommaSeparators do end let(:expected_offenses) do [{ - message: "Use 'version.csv.first' instead of 'version.before_comma' " \ + message: "Cask/UrlLegacyCommaSeparators: Use 'version.csv.first' instead of 'version.before_comma' " \ "and 'version.csv.second' instead of 'version.after_comma'", severity: :convention, line: 3, diff --git a/Library/Homebrew/test/rubocops/cask/url_spec.rb b/Library/Homebrew/test/rubocops/cask/url_spec.rb index 4698bd94a4..9518d7127d 100644 --- a/Library/Homebrew/test/rubocops/cask/url_spec.rb +++ b/Library/Homebrew/test/rubocops/cask/url_spec.rb @@ -34,7 +34,7 @@ describe RuboCop::Cop::Cask::Url do let(:expected_offenses) do [{ - message: "Verified URL parameter value should not contain a URL scheme.", + message: "Cask/Url: Verified URL parameter value should not contain a URL scheme.", severity: :convention, line: 3, column: 16, @@ -81,7 +81,7 @@ describe RuboCop::Cop::Cask::Url do let(:expected_offenses) do [{ - message: "Verified URL parameter value should end with a /.", + message: "Cask/Url: Verified URL parameter value should end with a /.", severity: :convention, line: 3, column: 16, @@ -156,7 +156,7 @@ describe RuboCop::Cop::Cask::Url do let(:expected_offenses) do [{ - message: "Verified URL parameter value should end with a /.", + message: "Cask/Url: Verified URL parameter value should end with a /.", severity: :convention, line: 3, column: 16, @@ -195,7 +195,7 @@ describe RuboCop::Cop::Cask::Url do <<~CASK cask "foo" do version "1.2.3" - url "https://example.com/download/foo-v\#{version}.dmg", + url "Cask/Url: https://example.com/download/foo-v\#{version}.dmg", verified: "example.com/download/" end CASK @@ -216,7 +216,7 @@ describe RuboCop::Cop::Cask::Url do let(:expected_offenses) do [{ - message: "Verified URL parameter value should end with a /.", + message: "Cask/Url: Verified URL parameter value should end with a /.", severity: :convention, line: 3, column: 16, diff --git a/Library/Homebrew/test/rubocops/cask/variables_spec.rb b/Library/Homebrew/test/rubocops/cask/variables_spec.rb index 9959ee36e7..816f9793d2 100644 --- a/Library/Homebrew/test/rubocops/cask/variables_spec.rb +++ b/Library/Homebrew/test/rubocops/cask/variables_spec.rb @@ -62,7 +62,7 @@ describe RuboCop::Cop::Cask::Variables do end let(:expected_offenses) do [{ - message: 'Use `arch arm: "darwin-arm64", intel: "darwin"` instead of ' \ + message: 'Cask/Variables: Use `arch arm: "darwin-arm64", intel: "darwin"` instead of ' \ '`arch = Hardware::CPU.intel? ? "darwin" : "darwin-arm64"`', severity: :convention, line: 2, @@ -93,7 +93,7 @@ describe RuboCop::Cop::Cask::Variables do end let(:expected_offenses) do [{ - message: "Use `arch arm: :darwin_arm64, intel: :darwin` instead of " \ + message: "Cask/Variables: Use `arch arm: :darwin_arm64, intel: :darwin` instead of " \ "`arch = Hardware::CPU.intel? ? :darwin : :darwin_arm64`", severity: :convention, line: 2, @@ -124,7 +124,7 @@ describe RuboCop::Cop::Cask::Variables do end let(:expected_offenses) do [{ - message: 'Use `arch arm: "arm64"` instead of ' \ + message: 'Cask/Variables: Use `arch arm: "arm64"` instead of ' \ '`arch = Hardware::CPU.intel? ? "" : "arm64"`', severity: :convention, line: 2, @@ -155,8 +155,8 @@ describe RuboCop::Cop::Cask::Variables do end let(:expected_offenses) do [{ - message: 'Use `folder = on_arch_conditional arm: "darwin-arm64", intel: "darwin"` instead of ' \ - '`folder = Hardware::CPU.intel? ? "darwin" : "darwin-arm64"`', + message: 'Cask/Variables: Use `folder = on_arch_conditional arm: "darwin-arm64", intel: "darwin"` ' \ + 'instead of `folder = Hardware::CPU.intel? ? "darwin" : "darwin-arm64"`', severity: :convention, line: 2, column: 2, @@ -186,7 +186,7 @@ describe RuboCop::Cop::Cask::Variables do end let(:expected_offenses) do [{ - message: 'Use `folder = on_arch_conditional intel: "amd64"` instead of ' \ + message: 'Cask/Variables: Use `folder = on_arch_conditional intel: "amd64"` instead of ' \ '`folder = Hardware::CPU.intel? ? "amd64" : ""`', severity: :convention, line: 2, @@ -219,15 +219,15 @@ describe RuboCop::Cop::Cask::Variables do end let(:expected_offenses) do [{ - message: 'Use `arch arm: "darwin-arm64", intel: "darwin"` instead of ' \ + message: 'Cask/Variables: Use `arch arm: "darwin-arm64", intel: "darwin"` instead of ' \ '`arch = Hardware::CPU.arm? ? "darwin-arm64" : "darwin"`', severity: :convention, line: 2, column: 2, source: 'arch = Hardware::CPU.arm? ? "darwin-arm64" : "darwin"', }, { - message: 'Use `folder = on_arch_conditional arm: "darwin-arm64", intel: "darwin"` instead of ' \ - '`folder = Hardware::CPU.arm? ? "darwin-arm64" : "darwin"`', + message: 'Cask/Variables: Use `folder = on_arch_conditional arm: "darwin-arm64", intel: "darwin"` ' \ + 'instead of `folder = Hardware::CPU.arm? ? "darwin-arm64" : "darwin"`', severity: :convention, line: 3, column: 2, @@ -259,15 +259,15 @@ describe RuboCop::Cop::Cask::Variables do end let(:expected_offenses) do [{ - message: 'Use `folder = on_arch_conditional arm: "darwin-arm64", intel: "darwin"` instead of ' \ - '`folder = Hardware::CPU.arm? ? "darwin-arm64" : "darwin"`', + message: 'Cask/Variables: Use `folder = on_arch_conditional arm: "darwin-arm64", intel: "darwin"` instead ' \ + 'of `folder = Hardware::CPU.arm? ? "darwin-arm64" : "darwin"`', severity: :convention, line: 2, column: 2, source: 'folder = Hardware::CPU.arm? ? "darwin-arm64" : "darwin"', }, { - message: 'Use `platform = on_arch_conditional arm: "darwin-arm64", intel: "darwin"` instead of ' \ - '`platform = Hardware::CPU.intel? ? "darwin": "darwin-arm64"`', + message: 'Cask/Variables: Use `platform = on_arch_conditional arm: "darwin-arm64", intel: "darwin"` ' \ + 'instead of `platform = Hardware::CPU.intel? ? "darwin": "darwin-arm64"`', severity: :convention, line: 3, column: 2, diff --git a/Library/Homebrew/test/rubocops/caveats_spec.rb b/Library/Homebrew/test/rubocops/caveats_spec.rb index b53e87dafd..e37536e4a0 100644 --- a/Library/Homebrew/test/rubocops/caveats_spec.rb +++ b/Library/Homebrew/test/rubocops/caveats_spec.rb @@ -14,7 +14,7 @@ describe RuboCop::Cop::FormulaAudit::Caveats do url "https://brew.sh/foo-1.0.tgz" def caveats "setuid" - ^^^^^^^^ Don't recommend setuid in the caveats, suggest sudo instead. + ^^^^^^^^ FormulaAudit/Caveats: Don't recommend setuid in the caveats, suggest sudo instead. end end RUBY @@ -27,7 +27,7 @@ describe RuboCop::Cop::FormulaAudit::Caveats do url "https://brew.sh/foo-1.0.tgz" def caveats "\\x1B" - ^^^^^^ Don't use ANSI escape codes in the caveats. + ^^^^^^ FormulaAudit/Caveats: Don't use ANSI escape codes in the caveats. end end RUBY @@ -38,7 +38,7 @@ describe RuboCop::Cop::FormulaAudit::Caveats do url "https://brew.sh/foo-1.0.tgz" def caveats "\\u001b" - ^^^^^^^^ Don't use ANSI escape codes in the caveats. + ^^^^^^^^ FormulaAudit/Caveats: Don't use ANSI escape codes in the caveats. end end RUBY diff --git a/Library/Homebrew/test/rubocops/checksum/checksum_case_spec.rb b/Library/Homebrew/test/rubocops/checksum/checksum_case_spec.rb index b66c2a163d..bbad493d6b 100644 --- a/Library/Homebrew/test/rubocops/checksum/checksum_case_spec.rb +++ b/Library/Homebrew/test/rubocops/checksum/checksum_case_spec.rb @@ -14,12 +14,12 @@ describe RuboCop::Cop::FormulaAudit::ChecksumCase do stable do url "https://github.com/foo-lang/foo-compiler/archive/0.18.0.tar.gz" sha256 "5cf6e1ae0A645b426c0a7cc7cd3f7d1605ffa1ac5756a39a8b2268ddc7ea0e9a" - ^ sha256 should be lowercase + ^ FormulaAudit/ChecksumCase: sha256 should be lowercase resource "foo-package" do url "https://github.com/foo-lang/foo-package/archive/0.18.0.tar.gz" sha256 "5cf6e1Ae0a645b426b047aa4cc7cd3f7d1605ffa1ac5756a39a8b2268ddc7ea9" - ^ sha256 should be lowercase + ^ FormulaAudit/ChecksumCase: sha256 should be lowercase end end end @@ -33,7 +33,7 @@ describe RuboCop::Cop::FormulaAudit::ChecksumCase do resource "foo-outside" do url "https://github.com/foo-lang/foo-outside/archive/0.18.0.tar.gz" sha256 "A4cc7cd3f7d1605ffa1ac5755cf6e1ae0a645b426b047a6a39a8b2268ddc7ea9" - ^ sha256 should be lowercase + ^ FormulaAudit/ChecksumCase: sha256 should be lowercase end stable do url "https://github.com/foo-lang/foo-compiler/archive/0.18.0.tar.gz" diff --git a/Library/Homebrew/test/rubocops/checksum/checksum_spec.rb b/Library/Homebrew/test/rubocops/checksum/checksum_spec.rb index ac8f05bc28..b8b791cb06 100644 --- a/Library/Homebrew/test/rubocops/checksum/checksum_spec.rb +++ b/Library/Homebrew/test/rubocops/checksum/checksum_spec.rb @@ -14,12 +14,12 @@ describe RuboCop::Cop::FormulaAudit::Checksum do stable do url "https://github.com/foo-lang/foo-compiler/archive/0.18.0.tar.gz" sha256 "" - ^^ sha256 is empty + ^^ FormulaAudit/Checksum: sha256 is empty resource "foo-package" do url "https://github.com/foo-lang/foo-package/archive/0.18.0.tar.gz" sha256 "" - ^^ sha256 is empty + ^^ FormulaAudit/Checksum: sha256 is empty end end end @@ -33,12 +33,12 @@ describe RuboCop::Cop::FormulaAudit::Checksum do stable do url "https://github.com/foo-lang/foo-compiler/archive/0.18.0.tar.gz" sha256 "5cf6e1ae0a645b426c0474cc7cd3f7d1605ffa1ac5756a39a8b2268ddc7ea0e9ad" - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ sha256 should be 64 characters + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/Checksum: sha256 should be 64 characters resource "foo-package" do url "https://github.com/foo-lang/foo-package/archive/0.18.0.tar.gz" sha256 "5cf6e1ae0a645b426c047aaa4cc7cd3f7d1605ffa1ac5756a39a8b2268ddc7ea0e9" - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ sha256 should be 64 characters + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/Checksum: sha256 should be 64 characters end end end @@ -52,12 +52,12 @@ describe RuboCop::Cop::FormulaAudit::Checksum do stable do url "https://github.com/foo-lang/foo-compiler/archive/0.18.0.tar.gz" sha256 "5cf6e1ae0a645b426c0k7cc7cd3f7d1605ffa1ac5756a39a8b2268ddc7ea0e9a" - ^ sha256 contains invalid characters + ^ FormulaAudit/Checksum: sha256 contains invalid characters resource "foo-package" do url "https://github.com/foo-lang/foo-package/archive/0.18.0.tar.gz" sha256 "5cf6e1ae0a645b426x047aa4cc7cd3f7d1605ffa1ac5756a39a8b2268ddc7ea9" - ^ sha256 contains invalid characters + ^ FormulaAudit/Checksum: sha256 contains invalid characters end end end @@ -71,7 +71,7 @@ describe RuboCop::Cop::FormulaAudit::Checksum do bottle do sha256 catalina: "5cf6e1ae0a645b426c0474cc7cd3f7d1605ffa1ac5756a39a8b2268ddc7ea0e9ad" - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ sha256 should be 64 characters + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/Checksum: sha256 should be 64 characters end end RUBY @@ -84,7 +84,7 @@ describe RuboCop::Cop::FormulaAudit::Checksum do bottle do sha256 cellar: :any, catalina: "5cf6e1ae0a645b426c0474cc7cd3f7d1605ffa1ac5756a39a8b2268ddc7ea0e9ad" - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ sha256 should be 64 characters + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/Checksum: sha256 should be 64 characters end end RUBY diff --git a/Library/Homebrew/test/rubocops/class/class_name_spec.rb b/Library/Homebrew/test/rubocops/class/class_name_spec.rb index edee9ce238..05eda81a29 100644 --- a/Library/Homebrew/test/rubocops/class/class_name_spec.rb +++ b/Library/Homebrew/test/rubocops/class/class_name_spec.rb @@ -15,7 +15,7 @@ describe RuboCop::Cop::FormulaAudit::ClassName do it "reports and corrects an offense when using ScriptFileFormula" do expect_offense(<<~RUBY) class Foo < ScriptFileFormula - ^^^^^^^^^^^^^^^^^ ScriptFileFormula is deprecated, use Formula instead + ^^^^^^^^^^^^^^^^^ FormulaAudit/ClassName: ScriptFileFormula is deprecated, use Formula instead url 'https://brew.sh/foo-1.0.tgz' end RUBY @@ -25,7 +25,7 @@ describe RuboCop::Cop::FormulaAudit::ClassName do it "reports and corrects an offense when using GithubGistFormula" do expect_offense(<<~RUBY) class Foo < GithubGistFormula - ^^^^^^^^^^^^^^^^^ GithubGistFormula is deprecated, use Formula instead + ^^^^^^^^^^^^^^^^^ FormulaAudit/ClassName: GithubGistFormula is deprecated, use Formula instead url 'https://brew.sh/foo-1.0.tgz' end RUBY @@ -35,7 +35,7 @@ describe RuboCop::Cop::FormulaAudit::ClassName do it "reports and corrects an offense when using AmazonWebServicesFormula" do expect_offense(<<~RUBY) class Foo < AmazonWebServicesFormula - ^^^^^^^^^^^^^^^^^^^^^^^^ AmazonWebServicesFormula is deprecated, use Formula instead + ^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/ClassName: AmazonWebServicesFormula is deprecated, use Formula instead url 'https://brew.sh/foo-1.0.tgz' end RUBY diff --git a/Library/Homebrew/test/rubocops/class/test_spec.rb b/Library/Homebrew/test/rubocops/class/test_spec.rb index b9b03161b8..b9a8388c8e 100644 --- a/Library/Homebrew/test/rubocops/class/test_spec.rb +++ b/Library/Homebrew/test/rubocops/class/test_spec.rb @@ -13,7 +13,7 @@ describe RuboCop::Cop::FormulaAudit::Test do test do system "/usr/local/bin/test" - ^^^^^^^^^^^^^^^^^^^^^ use \#{bin} instead of /usr/local/bin in system + ^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/Test: use \#{bin} instead of /usr/local/bin in system end end RUBY @@ -36,7 +36,7 @@ describe RuboCop::Cop::FormulaAudit::Test do test do shell_output("\#{bin}/test", 0) - ^ Passing 0 to shell_output() is redundant + ^ FormulaAudit/Test: Passing 0 to shell_output() is redundant end end RUBY @@ -58,7 +58,7 @@ describe RuboCop::Cop::FormulaAudit::Test do url 'https://brew.sh/foo-1.0.tgz' test do - ^^^^^^^ `test do` should not be empty + ^^^^^^^ FormulaAudit/Test: `test do` should not be empty end end RUBY @@ -70,7 +70,7 @@ describe RuboCop::Cop::FormulaAudit::Test do url 'https://brew.sh/foo-1.0.tgz' test do - ^^^^^^^ `test do` should contain a real test + ^^^^^^^ FormulaAudit/Test: `test do` should contain a real test true end end diff --git a/Library/Homebrew/test/rubocops/components_order_spec.rb b/Library/Homebrew/test/rubocops/components_order_spec.rb index 9761112c49..f031ddc69e 100644 --- a/Library/Homebrew/test/rubocops/components_order_spec.rb +++ b/Library/Homebrew/test/rubocops/components_order_spec.rb @@ -15,7 +15,7 @@ describe RuboCop::Cop::FormulaAudit::ComponentsOrder do uses_from_macos "apple" depends_on "foo" - ^^^^^^^^^^^^^^^^ `depends_on` (line 6) should be put before `uses_from_macos` (line 5) + ^^^^^^^^^^^^^^^^ FormulaAudit/ComponentsOrder: `depends_on` (line 6) should be put before `uses_from_macos` (line 5) end RUBY @@ -38,7 +38,7 @@ describe RuboCop::Cop::FormulaAudit::ComponentsOrder do url "https://brew.sh/foo-1.0.tgz" license "0BSD" sha256 "samplesha256" - ^^^^^^^^^^^^^^^^^^^^^ `sha256` (line 5) should be put before `license` (line 4) + ^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/ComponentsOrder: `sha256` (line 5) should be put before `license` (line 4) end RUBY @@ -61,7 +61,7 @@ describe RuboCop::Cop::FormulaAudit::ComponentsOrder do bottle :unneeded livecheck do - ^^^^^^^^^^^^ `livecheck` (line 7) should be put before `bottle` (line 5) + ^^^^^^^^^^^^ FormulaAudit/ComponentsOrder: `livecheck` (line 7) should be put before `bottle` (line 5) url "https://brew.sh/foo/versions/" regex(/href=.+?foo-(\d+(?:.\d+)+).t/) end @@ -88,7 +88,7 @@ describe RuboCop::Cop::FormulaAudit::ComponentsOrder do class Foo < Formula url "https://brew.sh/foo-1.0.tgz" homepage "https://brew.sh" - ^^^^^^^^^^^^^^^^^^^^^^^^^^ `homepage` (line 3) should be put before `url` (line 2) + ^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/ComponentsOrder: `homepage` (line 3) should be put before `url` (line 2) end RUBY @@ -110,7 +110,7 @@ describe RuboCop::Cop::FormulaAudit::ComponentsOrder do end depends_on "openssl" - ^^^^^^^^^^^^^^^^^^^^ `depends_on` (line 8) should be put before `resource` (line 4) + ^^^^^^^^^^^^^^^^^^^^ FormulaAudit/ComponentsOrder: `depends_on` (line 8) should be put before `resource` (line 4) end RUBY @@ -137,7 +137,7 @@ describe RuboCop::Cop::FormulaAudit::ComponentsOrder do end def plist - ^^^^^^^^^ `plist` (line 8) should be put before `test` (line 4) + ^^^^^^^^^ FormulaAudit/ComponentsOrder: `plist` (line 8) should be put before `test` (line 4) end end RUBY @@ -165,7 +165,7 @@ describe RuboCop::Cop::FormulaAudit::ComponentsOrder do end depends_on "openssl" - ^^^^^^^^^^^^^^^^^^^^ `depends_on` (line 7) should be put before `install` (line 4) + ^^^^^^^^^^^^^^^^^^^^ FormulaAudit/ComponentsOrder: `depends_on` (line 7) should be put before `install` (line 4) end RUBY @@ -193,7 +193,7 @@ describe RuboCop::Cop::FormulaAudit::ComponentsOrder do end depends_on "openssl" - ^^^^^^^^^^^^^^^^^^^^ `depends_on` (line 10) should be put before `install` (line 4) + ^^^^^^^^^^^^^^^^^^^^ FormulaAudit/ComponentsOrder: `depends_on` (line 10) should be put before `install` (line 4) end RUBY @@ -218,7 +218,7 @@ describe RuboCop::Cop::FormulaAudit::ComponentsOrder do depends_on "autoconf" => :build conflicts_with "visionmedia-watch" depends_on "automake" => :build - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `depends_on` (line 4) should be put before `conflicts_with` (line 3) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/ComponentsOrder: `depends_on` (line 4) should be put before `conflicts_with` (line 3) depends_on "libtool" => :build depends_on "pkg-config" => :build depends_on "gettext" @@ -245,7 +245,7 @@ describe RuboCop::Cop::FormulaAudit::ComponentsOrder do depends_on "readline" end uses_from_macos "bar" - ^^^^^^^^^^^^^^^^^^^^^ `uses_from_macos` (line 6) should be put before `on_macos` (line 3) + ^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/ComponentsOrder: `uses_from_macos` (line 6) should be put before `on_macos` (line 3) end RUBY @@ -269,7 +269,7 @@ describe RuboCop::Cop::FormulaAudit::ComponentsOrder do depends_on "readline" end uses_from_macos "bar" - ^^^^^^^^^^^^^^^^^^^^^ `uses_from_macos` (line 6) should be put before `on_linux` (line 3) + ^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/ComponentsOrder: `uses_from_macos` (line 6) should be put before `on_linux` (line 3) end RUBY @@ -293,7 +293,7 @@ describe RuboCop::Cop::FormulaAudit::ComponentsOrder do depends_on "vim" end on_macos do - ^^^^^^^^^^^ `on_macos` (line 6) should be put before `on_linux` (line 3) + ^^^^^^^^^^^ FormulaAudit/ComponentsOrder: `on_macos` (line 6) should be put before `on_linux` (line 3) depends_on "readline" end end @@ -322,7 +322,7 @@ describe RuboCop::Cop::FormulaAudit::ComponentsOrder do depends_on "openssl" deprecate! because: "has been replaced by bar" - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `deprecate!` (line 6) should be put before `depends_on` (line 4) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/ComponentsOrder: `deprecate!` (line 6) should be put before `depends_on` (line 4) end RUBY @@ -512,7 +512,7 @@ describe RuboCop::Cop::FormulaAudit::ComponentsOrder do end on_macos do - ^^^^^^^^^^^ there can only be one `on_macos` block in a formula. + ^^^^^^^^^^^ FormulaAudit/ComponentsOrder: there can only be one `on_macos` block in a formula. depends_on "foo" end end @@ -528,7 +528,7 @@ describe RuboCop::Cop::FormulaAudit::ComponentsOrder do end on_linux do - ^^^^^^^^^^^ there can only be one `on_linux` block in a formula. + ^^^^^^^^^^^ FormulaAudit/ComponentsOrder: there can only be one `on_linux` block in a formula. depends_on "foo" end end @@ -544,7 +544,7 @@ describe RuboCop::Cop::FormulaAudit::ComponentsOrder do end on_intel do - ^^^^^^^^^^^ there can only be one `on_intel` block in a formula. + ^^^^^^^^^^^ FormulaAudit/ComponentsOrder: there can only be one `on_intel` block in a formula. depends_on "foo" end end @@ -560,7 +560,7 @@ describe RuboCop::Cop::FormulaAudit::ComponentsOrder do end on_arm do - ^^^^^^^^^ there can only be one `on_arm` block in a formula. + ^^^^^^^^^ FormulaAudit/ComponentsOrder: there can only be one `on_arm` block in a formula. depends_on "foo" end end @@ -576,7 +576,7 @@ describe RuboCop::Cop::FormulaAudit::ComponentsOrder do end on_monterey do - ^^^^^^^^^^^^^^ there can only be one `on_monterey` block in a formula. + ^^^^^^^^^^^^^^ FormulaAudit/ComponentsOrder: there can only be one `on_monterey` block in a formula. depends_on "foo" end end @@ -592,7 +592,7 @@ describe RuboCop::Cop::FormulaAudit::ComponentsOrder do end on_monterey :or_older do - ^^^^^^^^^^^^^^^^^^^^^^^^ there can only be one `on_monterey` block in a formula. + ^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/ComponentsOrder: there can only be one `on_monterey` block in a formula. depends_on "foo" end end @@ -606,7 +606,7 @@ describe RuboCop::Cop::FormulaAudit::ComponentsOrder do on_macos do depends_on "readline" uses_from_macos "ncurses" - ^^^^^^^^^^^^^^^^^^^^^^^^^ `on_macos` cannot include `uses_from_macos`. [...] + ^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/ComponentsOrder: `on_macos` cannot include `uses_from_macos`. [...] end end RUBY @@ -619,7 +619,7 @@ describe RuboCop::Cop::FormulaAudit::ComponentsOrder do on_linux do depends_on "readline" uses_from_macos "ncurses" - ^^^^^^^^^^^^^^^^^^^^^^^^^ `on_linux` cannot include `uses_from_macos`. [...] + ^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/ComponentsOrder: `on_linux` cannot include `uses_from_macos`. [...] end end RUBY @@ -632,7 +632,7 @@ describe RuboCop::Cop::FormulaAudit::ComponentsOrder do on_intel do depends_on "readline" uses_from_macos "ncurses" - ^^^^^^^^^^^^^^^^^^^^^^^^^ `on_intel` cannot include `uses_from_macos`. [...] + ^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/ComponentsOrder: `on_intel` cannot include `uses_from_macos`. [...] end end RUBY @@ -645,7 +645,7 @@ describe RuboCop::Cop::FormulaAudit::ComponentsOrder do on_arm do depends_on "readline" uses_from_macos "ncurses" - ^^^^^^^^^^^^^^^^^^^^^^^^^ `on_arm` cannot include `uses_from_macos`. [...] + ^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/ComponentsOrder: `on_arm` cannot include `uses_from_macos`. [...] end end RUBY @@ -659,7 +659,7 @@ describe RuboCop::Cop::FormulaAudit::ComponentsOrder do on_monterey do depends_on "readline" uses_from_macos "ncurses" - ^^^^^^^^^^^^^^^^^^^^^^^^^ `on_monterey` cannot include `uses_from_macos`. [...] + ^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/ComponentsOrder: `on_monterey` cannot include `uses_from_macos`. [...] end end RUBY @@ -673,7 +673,7 @@ describe RuboCop::Cop::FormulaAudit::ComponentsOrder do on_monterey :or_older do depends_on "readline" uses_from_macos "ncurses" - ^^^^^^^^^^^^^^^^^^^^^^^^^ `on_monterey` cannot include `uses_from_macos`. [...] + ^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/ComponentsOrder: `on_monterey` cannot include `uses_from_macos`. [...] end end RUBY @@ -684,7 +684,7 @@ describe RuboCop::Cop::FormulaAudit::ComponentsOrder do class Foo < Formula url "https://brew.sh/foo-1.0.tgz" on_arm do - ^^^^^^^^^ Nest `on_arm` blocks inside `patch` blocks when there is only one inner block. + ^^^^^^^^^ FormulaAudit/ComponentsOrder: Nest `on_arm` blocks inside `patch` blocks when there is only one inner block. patch do url "https://brew.sh/patch1.tar.gz" sha256 "2c39089f64d9d4c3e632f120894b36b68dcc8ae8c6f5130c0c2e6f5bb7aebf2f" @@ -711,7 +711,7 @@ describe RuboCop::Cop::FormulaAudit::ComponentsOrder do class Foo < Formula url "https://brew.sh/foo-1.0.tgz" on_linux do - ^^^^^^^^^^^ Nest `on_linux` blocks inside `resource` blocks when there is only one inner block. + ^^^^^^^^^^^ FormulaAudit/ComponentsOrder: Nest `on_linux` blocks inside `resource` blocks when there is only one inner block. resource do url "https://brew.sh/resource1.tar.gz" sha256 "586372eb92059873e29eba4f9dec8381541b4d3834660707faf8ba59146dfc35" @@ -738,7 +738,7 @@ describe RuboCop::Cop::FormulaAudit::ComponentsOrder do class Foo < Formula url "https://brew.sh/foo-1.0.tgz" on_monterey :or_newer do - ^^^^^^^^^^^^^^^^^^^^^^^^ Nest `on_monterey` blocks inside `patch` blocks when there is only one inner block. + ^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/ComponentsOrder: Nest `on_monterey` blocks inside `patch` blocks when there is only one inner block. patch do url "https://brew.sh/patch1.tar.gz" sha256 "2c39089f64d9d4c3e632f120894b36b68dcc8ae8c6f5130c0c2e6f5bb7aebf2f" @@ -765,7 +765,7 @@ describe RuboCop::Cop::FormulaAudit::ComponentsOrder do class Foo < Formula url "https://brew.sh/foo-1.0.tgz" on_system :linux, macos: :monterey_or_older do - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Nest `on_system` blocks inside `resource` blocks when there is only one inner block. + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/ComponentsOrder: Nest `on_system` blocks inside `resource` blocks when there is only one inner block. resource do url "https://brew.sh/resource1.tar.gz" sha256 "586372eb92059873e29eba4f9dec8381541b4d3834660707faf8ba59146dfc35" @@ -812,7 +812,7 @@ describe RuboCop::Cop::FormulaAudit::ComponentsOrder do head do depends_on "bar" url "https://github.com/foo/foo.git", branch: "main" - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `url` (line 6) should be put before `depends_on` (line 5) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/ComponentsOrder: `url` (line 6) should be put before `depends_on` (line 5) end end RUBY @@ -828,7 +828,7 @@ describe RuboCop::Cop::FormulaAudit::ComponentsOrder do resource do sha256 "586372eb92059873e29eba4f9dec8381541b4d3834660707faf8ba59146dfc35" url "https://brew.sh/resource1.tar.gz" - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `url` (line 6) should be put before `sha256` (line 5) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/ComponentsOrder: `url` (line 6) should be put before `sha256` (line 5) end end RUBY @@ -882,7 +882,7 @@ describe RuboCop::Cop::FormulaAudit::ComponentsOrder do url "https://brew.sh/foo-1.0.tgz" resource do - ^^^^^^^^^^^ there can only be one `on_macos` block in a resource block. + ^^^^^^^^^^^ FormulaAudit/ComponentsOrder: there can only be one `on_macos` block in a resource block. on_macos do url "https://brew.sh/resource1.tar.gz" sha256 "586372eb92059873e29eba4f9dec8381541b4d3834660707faf8ba59146dfc35" @@ -903,7 +903,7 @@ describe RuboCop::Cop::FormulaAudit::ComponentsOrder do url "https://brew.sh/foo-1.0.tgz" resource do - ^^^^^^^^^^^ there can only be one `on_linux` block in a resource block. + ^^^^^^^^^^^ FormulaAudit/ComponentsOrder: there can only be one `on_linux` block in a resource block. on_linux do url "https://brew.sh/resource1.tar.gz" sha256 "586372eb92059873e29eba4f9dec8381541b4d3834660707faf8ba59146dfc35" @@ -924,7 +924,7 @@ describe RuboCop::Cop::FormulaAudit::ComponentsOrder do url "https://brew.sh/foo-1.0.tgz" resource do - ^^^^^^^^^^^ there can only be one `on_intel` block in a resource block. + ^^^^^^^^^^^ FormulaAudit/ComponentsOrder: there can only be one `on_intel` block in a resource block. on_intel do url "https://brew.sh/resource1.tar.gz" sha256 "586372eb92059873e29eba4f9dec8381541b4d3834660707faf8ba59146dfc35" @@ -945,7 +945,7 @@ describe RuboCop::Cop::FormulaAudit::ComponentsOrder do url "https://brew.sh/foo-1.0.tgz" resource do - ^^^^^^^^^^^ there can only be one `on_arm` block in a resource block. + ^^^^^^^^^^^ FormulaAudit/ComponentsOrder: there can only be one `on_arm` block in a resource block. on_arm do url "https://brew.sh/resource1.tar.gz" sha256 "586372eb92059873e29eba4f9dec8381541b4d3834660707faf8ba59146dfc35" @@ -966,7 +966,7 @@ describe RuboCop::Cop::FormulaAudit::ComponentsOrder do url "https://brew.sh/foo-1.0.tgz" resource do - ^^^^^^^^^^^ there can only be one `on_monterey` block in a resource block. + ^^^^^^^^^^^ FormulaAudit/ComponentsOrder: there can only be one `on_monterey` block in a resource block. on_monterey do url "https://brew.sh/resource1.tar.gz" sha256 "586372eb92059873e29eba4f9dec8381541b4d3834660707faf8ba59146dfc35" @@ -1044,7 +1044,7 @@ describe RuboCop::Cop::FormulaAudit::ComponentsOrder do resource do on_macos do - ^^^^^^^^^^^ `on_macos` blocks within `resource` blocks must contain at least `url` and `sha256` and at most `url`, `mirror`, `version` and `sha256` (in order). + ^^^^^^^^^^^ FormulaAudit/ComponentsOrder: `on_macos` blocks within `resource` blocks must contain at least `url` and `sha256` and at most `url`, `mirror`, `version` and `sha256` (in order). sha256 "586372eb92059873e29eba4f9dec8381541b4d3834660707faf8ba59146dfc35" url "https://brew.sh/resource2.tar.gz" end @@ -1111,7 +1111,7 @@ describe RuboCop::Cop::FormulaAudit::ComponentsOrder do resource do on_macos do - ^^^^^^^^^^^ `on_macos` blocks within `resource` blocks must contain at least `url` and `sha256` and at most `url`, `mirror`, `version` and `sha256` (in order). + ^^^^^^^^^^^ FormulaAudit/ComponentsOrder: `on_macos` blocks within `resource` blocks must contain at least `url` and `sha256` and at most `url`, `mirror`, `version` and `sha256` (in order). if foo == :bar url "https://brew.sh/resource2.tar.gz" sha256 "586372eb92059873e29eba4f9dec8381541b4d3834660707faf8ba59146dfc35" @@ -1137,7 +1137,7 @@ describe RuboCop::Cop::FormulaAudit::ComponentsOrder do resource do on_arm do - ^^^^^^^^^ `on_arm` blocks within `resource` blocks must contain at least `url` and `sha256` and at most `url`, `mirror`, `version` and `sha256` (in order). + ^^^^^^^^^ FormulaAudit/ComponentsOrder: `on_arm` blocks within `resource` blocks must contain at least `url` and `sha256` and at most `url`, `mirror`, `version` and `sha256` (in order). sha256 "586372eb92059873e29eba4f9dec8381541b4d3834660707faf8ba59146dfc35" url "https://brew.sh/resource2.tar.gz" end @@ -1181,7 +1181,7 @@ describe RuboCop::Cop::FormulaAudit::ComponentsOrder do resource do on_arm do - ^^^^^^^^^ `on_arm` blocks within `resource` blocks must contain at least `url` and `sha256` and at most `url`, `mirror`, `version` and `sha256` (in order). + ^^^^^^^^^ FormulaAudit/ComponentsOrder: `on_arm` blocks within `resource` blocks must contain at least `url` and `sha256` and at most `url`, `mirror`, `version` and `sha256` (in order). if foo == :bar url "https://brew.sh/resource2.tar.gz" sha256 "586372eb92059873e29eba4f9dec8381541b4d3834660707faf8ba59146dfc35" diff --git a/Library/Homebrew/test/rubocops/components_redundancy_spec.rb b/Library/Homebrew/test/rubocops/components_redundancy_spec.rb index f308ee186c..9ed06cb4e4 100644 --- a/Library/Homebrew/test/rubocops/components_redundancy_spec.rb +++ b/Library/Homebrew/test/rubocops/components_redundancy_spec.rb @@ -11,7 +11,7 @@ describe RuboCop::Cop::FormulaAudit::ComponentsRedundancy do expect_offense(<<~RUBY) class Foo < Formula url "https://brew.sh/foo-1.0.tgz" - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `url` should be put inside `stable` block + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/ComponentsRedundancy: `url` should be put inside `stable` block stable do # stuff end @@ -28,7 +28,7 @@ describe RuboCop::Cop::FormulaAudit::ComponentsRedundancy do class Foo < Formula head "https://brew.sh/foo.git" head do - ^^^^^^^ `head` and `head do` should not be simultaneously present + ^^^^^^^ FormulaAudit/ComponentsRedundancy: `head` and `head do` should not be simultaneously present # stuff end end @@ -40,7 +40,7 @@ describe RuboCop::Cop::FormulaAudit::ComponentsRedundancy do class Foo < Formula url "https://brew.sh/foo-1.0.tgz" bottle do - ^^^^^^^^^ `bottle :modifier` and `bottle do` should not be simultaneously present + ^^^^^^^^^ FormulaAudit/ComponentsRedundancy: `bottle :modifier` and `bottle do` should not be simultaneously present # bottles go here end bottle :unneeded diff --git a/Library/Homebrew/test/rubocops/conflicts_spec.rb b/Library/Homebrew/test/rubocops/conflicts_spec.rb index c772b02642..c9cc07dfa7 100644 --- a/Library/Homebrew/test/rubocops/conflicts_spec.rb +++ b/Library/Homebrew/test/rubocops/conflicts_spec.rb @@ -12,7 +12,7 @@ describe RuboCop::Cop::FormulaAudit::Conflicts do class Foo < Formula url "https://brew.sh/foo-1.0.tgz" conflicts_with "bar", :because => "Reason" - ^^^^^^^^ 'Reason' from the `conflicts_with` reason should be 'reason'. + ^^^^^^^^ FormulaAudit/Conflicts: 'Reason' from the `conflicts_with` reason should be 'reason'. conflicts_with "baz", :because => "Foo is the formula name which does not require downcasing" end RUBY @@ -31,7 +31,7 @@ describe RuboCop::Cop::FormulaAudit::Conflicts do class Foo < Formula url "https://brew.sh/foo-1.0.tgz" conflicts_with "bar", "baz", :because => "reason." - ^^^^^^^^^ `conflicts_with` reason should not end with a period. + ^^^^^^^^^ FormulaAudit/Conflicts: `conflicts_with` reason should not end with a period. end RUBY @@ -48,7 +48,7 @@ describe RuboCop::Cop::FormulaAudit::Conflicts do class FooAT20 < Formula url 'https://brew.sh/foo-2.0.tgz' conflicts_with "mysql", "mariadb" - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Versioned formulae should not use `conflicts_with`. Use `keg_only :versioned_formula` instead. + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/Conflicts: Versioned formulae should not use `conflicts_with`. Use `keg_only :versioned_formula` instead. end RUBY end diff --git a/Library/Homebrew/test/rubocops/dependency_order_spec.rb b/Library/Homebrew/test/rubocops/dependency_order_spec.rb index 465477dac0..e6e0ddbbec 100644 --- a/Library/Homebrew/test/rubocops/dependency_order_spec.rb +++ b/Library/Homebrew/test/rubocops/dependency_order_spec.rb @@ -14,7 +14,7 @@ describe RuboCop::Cop::FormulaAudit::DependencyOrder do url "https://brew.sh/foo-1.0.tgz" uses_from_macos "apple" if build.with? "foo" uses_from_macos "foo" => :optional - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ dependency "foo" (line 5) should be put before dependency "apple" (line 4) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/DependencyOrder: dependency "foo" (line 5) should be put before dependency "apple" (line 4) end RUBY @@ -35,7 +35,7 @@ describe RuboCop::Cop::FormulaAudit::DependencyOrder do url "https://brew.sh/foo-1.0.tgz" uses_from_macos "foo" uses_from_macos "bar" - ^^^^^^^^^^^^^^^^^^^^^ dependency "bar" (line 5) should be put before dependency "foo" (line 4) + ^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/DependencyOrder: dependency "bar" (line 5) should be put before dependency "foo" (line 4) end RUBY @@ -56,7 +56,7 @@ describe RuboCop::Cop::FormulaAudit::DependencyOrder do url "https://brew.sh/foo-1.0.tgz" uses_from_macos FooRequirement uses_from_macos "bar" - ^^^^^^^^^^^^^^^^^^^^^ dependency "bar" (line 5) should be put before dependency "FooRequirement" (line 4) + ^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/DependencyOrder: dependency "bar" (line 5) should be put before dependency "FooRequirement" (line 4) end RUBY @@ -78,13 +78,13 @@ describe RuboCop::Cop::FormulaAudit::DependencyOrder do head do uses_from_macos "apple" if build.with? "foo" uses_from_macos "bar" - ^^^^^^^^^^^^^^^^^^^^^ dependency "bar" (line 6) should be put before dependency "apple" (line 5) + ^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/DependencyOrder: dependency "bar" (line 6) should be put before dependency "apple" (line 5) uses_from_macos "foo" => :optional - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ dependency "foo" (line 7) should be put before dependency "apple" (line 5) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/DependencyOrder: dependency "foo" (line 7) should be put before dependency "apple" (line 5) end uses_from_macos "apple" if build.with? "foo" uses_from_macos "foo" => :optional - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ dependency "foo" (line 10) should be put before dependency "apple" (line 9) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/DependencyOrder: dependency "foo" (line 10) should be put before dependency "apple" (line 9) end RUBY @@ -123,9 +123,9 @@ describe RuboCop::Cop::FormulaAudit::DependencyOrder do on_arm do uses_from_macos "apple" if build.with? "foo" uses_from_macos "bar" - ^^^^^^^^^^^^^^^^^^^^^ dependency "bar" (line 6) should be put before dependency "apple" (line 5) + ^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/DependencyOrder: dependency "bar" (line 6) should be put before dependency "apple" (line 5) uses_from_macos "foo" => :optional - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ dependency "foo" (line 7) should be put before dependency "apple" (line 5) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/DependencyOrder: dependency "foo" (line 7) should be put before dependency "apple" (line 5) end end RUBY @@ -152,7 +152,7 @@ describe RuboCop::Cop::FormulaAudit::DependencyOrder do url "https://brew.sh/foo-1.0.tgz" depends_on "apple" if build.with? "foo" depends_on "foo" => :optional - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ dependency "foo" (line 5) should be put before dependency "apple" (line 4) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/DependencyOrder: dependency "foo" (line 5) should be put before dependency "apple" (line 4) end RUBY @@ -173,7 +173,7 @@ describe RuboCop::Cop::FormulaAudit::DependencyOrder do url "https://brew.sh/foo-1.0.tgz" depends_on "foo" depends_on "bar" - ^^^^^^^^^^^^^^^^ dependency "bar" (line 5) should be put before dependency "foo" (line 4) + ^^^^^^^^^^^^^^^^ FormulaAudit/DependencyOrder: dependency "bar" (line 5) should be put before dependency "foo" (line 4) end RUBY @@ -194,7 +194,7 @@ describe RuboCop::Cop::FormulaAudit::DependencyOrder do url "https://brew.sh/foo-1.0.tgz" depends_on FooRequirement depends_on "bar" - ^^^^^^^^^^^^^^^^ dependency "bar" (line 5) should be put before dependency "FooRequirement" (line 4) + ^^^^^^^^^^^^^^^^ FormulaAudit/DependencyOrder: dependency "bar" (line 5) should be put before dependency "FooRequirement" (line 4) end RUBY @@ -216,13 +216,13 @@ describe RuboCop::Cop::FormulaAudit::DependencyOrder do head do depends_on "apple" if build.with? "foo" depends_on "bar" - ^^^^^^^^^^^^^^^^ dependency "bar" (line 6) should be put before dependency "apple" (line 5) + ^^^^^^^^^^^^^^^^ FormulaAudit/DependencyOrder: dependency "bar" (line 6) should be put before dependency "apple" (line 5) depends_on "foo" => :optional - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ dependency "foo" (line 7) should be put before dependency "apple" (line 5) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/DependencyOrder: dependency "foo" (line 7) should be put before dependency "apple" (line 5) end depends_on "apple" if build.with? "foo" depends_on "foo" => :optional - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ dependency "foo" (line 10) should be put before dependency "apple" (line 9) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/DependencyOrder: dependency "foo" (line 10) should be put before dependency "apple" (line 9) end RUBY @@ -261,9 +261,9 @@ describe RuboCop::Cop::FormulaAudit::DependencyOrder do on_linux do depends_on "apple" if build.with? "foo" depends_on "bar" - ^^^^^^^^^^^^^^^^ dependency "bar" (line 6) should be put before dependency "apple" (line 5) + ^^^^^^^^^^^^^^^^ FormulaAudit/DependencyOrder: dependency "bar" (line 6) should be put before dependency "apple" (line 5) depends_on "foo" => :optional - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ dependency "foo" (line 7) should be put before dependency "apple" (line 5) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/DependencyOrder: dependency "foo" (line 7) should be put before dependency "apple" (line 5) end end RUBY diff --git a/Library/Homebrew/test/rubocops/deprecate_disable/date_spec.rb b/Library/Homebrew/test/rubocops/deprecate_disable/date_spec.rb index e46e5ab8d2..25733196f2 100644 --- a/Library/Homebrew/test/rubocops/deprecate_disable/date_spec.rb +++ b/Library/Homebrew/test/rubocops/deprecate_disable/date_spec.rb @@ -12,7 +12,7 @@ describe RuboCop::Cop::FormulaAudit::DeprecateDisableDate do class Foo < Formula url 'https://brew.sh/foo-1.0.tgz' deprecate! date: "June 25, 2020" - ^^^^^^^^^^^^^^^ Use `2020-06-25` to comply with ISO 8601 + ^^^^^^^^^^^^^^^ FormulaAudit/DeprecateDisableDate: Use `2020-06-25` to comply with ISO 8601 end RUBY @@ -29,7 +29,7 @@ describe RuboCop::Cop::FormulaAudit::DeprecateDisableDate do class Foo < Formula url 'https://brew.sh/foo-1.0.tgz' deprecate! because: "is broken", date: "June 25, 2020" - ^^^^^^^^^^^^^^^ Use `2020-06-25` to comply with ISO 8601 + ^^^^^^^^^^^^^^^ FormulaAudit/DeprecateDisableDate: Use `2020-06-25` to comply with ISO 8601 end RUBY @@ -84,7 +84,7 @@ describe RuboCop::Cop::FormulaAudit::DeprecateDisableDate do class Foo < Formula url 'https://brew.sh/foo-1.0.tgz' disable! date: "June 25, 2020" - ^^^^^^^^^^^^^^^ Use `2020-06-25` to comply with ISO 8601 + ^^^^^^^^^^^^^^^ FormulaAudit/DeprecateDisableDate: Use `2020-06-25` to comply with ISO 8601 end RUBY @@ -101,7 +101,7 @@ describe RuboCop::Cop::FormulaAudit::DeprecateDisableDate do class Foo < Formula url 'https://brew.sh/foo-1.0.tgz' disable! because: "is broken", date: "June 25, 2020" - ^^^^^^^^^^^^^^^ Use `2020-06-25` to comply with ISO 8601 + ^^^^^^^^^^^^^^^ FormulaAudit/DeprecateDisableDate: Use `2020-06-25` to comply with ISO 8601 end RUBY diff --git a/Library/Homebrew/test/rubocops/deprecate_disable/reason_spec.rb b/Library/Homebrew/test/rubocops/deprecate_disable/reason_spec.rb index 0ae834561b..dd87498ae2 100644 --- a/Library/Homebrew/test/rubocops/deprecate_disable/reason_spec.rb +++ b/Library/Homebrew/test/rubocops/deprecate_disable/reason_spec.rb @@ -48,7 +48,7 @@ describe RuboCop::Cop::FormulaAudit::DeprecateDisableReason do class Foo < Formula url 'https://brew.sh/foo-1.0.tgz' deprecate! - ^^^^^^^^^^ Add a reason for deprecation: `deprecate! because: "..."` + ^^^^^^^^^^ FormulaAudit/DeprecateDisableReason: Add a reason for deprecation: `deprecate! because: "..."` end RUBY end @@ -58,7 +58,7 @@ describe RuboCop::Cop::FormulaAudit::DeprecateDisableReason do class Foo < Formula url 'https://brew.sh/foo-1.0.tgz' deprecate! date: "2020-08-28" - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Add a reason for deprecation: `deprecate! because: "..."` + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/DeprecateDisableReason: Add a reason for deprecation: `deprecate! because: "..."` end RUBY end @@ -68,7 +68,7 @@ describe RuboCop::Cop::FormulaAudit::DeprecateDisableReason do class Foo < Formula url 'https://brew.sh/foo-1.0.tgz' deprecate! because: "it is broken" - ^^^^^^^^^^^^^^ Do not start the reason with `it` + ^^^^^^^^^^^^^^ FormulaAudit/DeprecateDisableReason: Do not start the reason with `it` end RUBY @@ -85,7 +85,7 @@ describe RuboCop::Cop::FormulaAudit::DeprecateDisableReason do class Foo < Formula url 'https://brew.sh/foo-1.0.tgz' deprecate! date: "2020-08-28", because: "it is broken" - ^^^^^^^^^^^^^^ Do not start the reason with `it` + ^^^^^^^^^^^^^^ FormulaAudit/DeprecateDisableReason: Do not start the reason with `it` end RUBY @@ -102,7 +102,7 @@ describe RuboCop::Cop::FormulaAudit::DeprecateDisableReason do class Foo < Formula url 'https://brew.sh/foo-1.0.tgz' deprecate! because: "is broken." - ^^^^^^^^^^^^ Do not end the reason with a punctuation mark + ^^^^^^^^^^^^ FormulaAudit/DeprecateDisableReason: Do not end the reason with a punctuation mark end RUBY @@ -119,7 +119,7 @@ describe RuboCop::Cop::FormulaAudit::DeprecateDisableReason do class Foo < Formula url 'https://brew.sh/foo-1.0.tgz' deprecate! because: "is broken!" - ^^^^^^^^^^^^ Do not end the reason with a punctuation mark + ^^^^^^^^^^^^ FormulaAudit/DeprecateDisableReason: Do not end the reason with a punctuation mark end RUBY @@ -136,7 +136,7 @@ describe RuboCop::Cop::FormulaAudit::DeprecateDisableReason do class Foo < Formula url 'https://brew.sh/foo-1.0.tgz' deprecate! because: "is broken?" - ^^^^^^^^^^^^ Do not end the reason with a punctuation mark + ^^^^^^^^^^^^ FormulaAudit/DeprecateDisableReason: Do not end the reason with a punctuation mark end RUBY @@ -153,7 +153,7 @@ describe RuboCop::Cop::FormulaAudit::DeprecateDisableReason do class Foo < Formula url 'https://brew.sh/foo-1.0.tgz' deprecate! date: "2020-08-28", because: "is broken." - ^^^^^^^^^^^^ Do not end the reason with a punctuation mark + ^^^^^^^^^^^^ FormulaAudit/DeprecateDisableReason: Do not end the reason with a punctuation mark end RUBY @@ -208,7 +208,7 @@ describe RuboCop::Cop::FormulaAudit::DeprecateDisableReason do class Foo < Formula url 'https://brew.sh/foo-1.0.tgz' disable! - ^^^^^^^^ Add a reason for disabling: `disable! because: "..."` + ^^^^^^^^ FormulaAudit/DeprecateDisableReason: Add a reason for disabling: `disable! because: "..."` end RUBY end @@ -218,7 +218,7 @@ describe RuboCop::Cop::FormulaAudit::DeprecateDisableReason do class Foo < Formula url 'https://brew.sh/foo-1.0.tgz' disable! date: "2020-08-28" - ^^^^^^^^^^^^^^^^^^^^^^^^^^^ Add a reason for disabling: `disable! because: "..."` + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/DeprecateDisableReason: Add a reason for disabling: `disable! because: "..."` end RUBY end @@ -228,7 +228,7 @@ describe RuboCop::Cop::FormulaAudit::DeprecateDisableReason do class Foo < Formula url 'https://brew.sh/foo-1.0.tgz' disable! because: "it is broken" - ^^^^^^^^^^^^^^ Do not start the reason with `it` + ^^^^^^^^^^^^^^ FormulaAudit/DeprecateDisableReason: Do not start the reason with `it` end RUBY @@ -245,7 +245,7 @@ describe RuboCop::Cop::FormulaAudit::DeprecateDisableReason do class Foo < Formula url 'https://brew.sh/foo-1.0.tgz' disable! date: "2020-08-28", because: "it is broken" - ^^^^^^^^^^^^^^ Do not start the reason with `it` + ^^^^^^^^^^^^^^ FormulaAudit/DeprecateDisableReason: Do not start the reason with `it` end RUBY @@ -262,7 +262,7 @@ describe RuboCop::Cop::FormulaAudit::DeprecateDisableReason do class Foo < Formula url 'https://brew.sh/foo-1.0.tgz' disable! because: "is broken." - ^^^^^^^^^^^^ Do not end the reason with a punctuation mark + ^^^^^^^^^^^^ FormulaAudit/DeprecateDisableReason: Do not end the reason with a punctuation mark end RUBY @@ -279,7 +279,7 @@ describe RuboCop::Cop::FormulaAudit::DeprecateDisableReason do class Foo < Formula url 'https://brew.sh/foo-1.0.tgz' disable! because: "is broken!" - ^^^^^^^^^^^^ Do not end the reason with a punctuation mark + ^^^^^^^^^^^^ FormulaAudit/DeprecateDisableReason: Do not end the reason with a punctuation mark end RUBY @@ -296,7 +296,7 @@ describe RuboCop::Cop::FormulaAudit::DeprecateDisableReason do class Foo < Formula url 'https://brew.sh/foo-1.0.tgz' disable! because: "is broken?" - ^^^^^^^^^^^^ Do not end the reason with a punctuation mark + ^^^^^^^^^^^^ FormulaAudit/DeprecateDisableReason: Do not end the reason with a punctuation mark end RUBY @@ -313,7 +313,7 @@ describe RuboCop::Cop::FormulaAudit::DeprecateDisableReason do class Foo < Formula url 'https://brew.sh/foo-1.0.tgz' disable! date: "2020-08-28", because: "is broken." - ^^^^^^^^^^^^ Do not end the reason with a punctuation mark + ^^^^^^^^^^^^ FormulaAudit/DeprecateDisableReason: Do not end the reason with a punctuation mark end RUBY diff --git a/Library/Homebrew/test/rubocops/desc_spec.rb b/Library/Homebrew/test/rubocops/desc_spec.rb index 392508ce83..48652246ff 100644 --- a/Library/Homebrew/test/rubocops/desc_spec.rb +++ b/Library/Homebrew/test/rubocops/desc_spec.rb @@ -10,7 +10,7 @@ describe RuboCop::Cop::FormulaAudit::Desc do it "reports an offense when there is no `desc`" do expect_offense(<<~RUBY) class Foo < Formula - ^^^^^^^^^^^^^^^^^^^ Formula should have a desc (Description). + ^^^^^^^^^^^^^^^^^^^ FormulaAudit/Desc: Formula should have a desc (Description). url 'https://brew.sh/foo-1.0.tgz' end RUBY @@ -21,7 +21,7 @@ describe RuboCop::Cop::FormulaAudit::Desc do class Foo < Formula url 'https://brew.sh/foo-1.0.tgz' desc '' - ^^^^^^^ The desc (description) should not be an empty string. + ^^^^^^^ FormulaAudit/Desc: The desc (description) should not be an empty string. end RUBY end @@ -31,7 +31,7 @@ describe RuboCop::Cop::FormulaAudit::Desc do class Foo < Formula url 'https://brew.sh/foo-1.0.tgz' desc 'Bar#{"bar" * 29}' - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Description is too long. It should be less than 80 characters. The current length is 90. + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/Desc: Description is too long. It should be less than 80 characters. The current length is 90. end RUBY end @@ -42,7 +42,7 @@ describe RuboCop::Cop::FormulaAudit::Desc do url 'https://brew.sh/foo-1.0.tgz' desc 'Bar#{"bar" * 9}'\ '#{"foo" * 21}' - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Description is too long. It should be less than 80 characters. The current length is 93. + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/Desc: Description is too long. It should be less than 80 characters. The current length is 93. end RUBY end @@ -54,7 +54,7 @@ describe RuboCop::Cop::FormulaAudit::Desc do class Foo < Formula url 'https://brew.sh/foo-1.0.tgz' desc ' Description with a leading space' - ^ Description shouldn't have leading spaces. + ^ FormulaAudit/Desc: Description shouldn't have leading spaces. end RUBY end @@ -64,7 +64,7 @@ describe RuboCop::Cop::FormulaAudit::Desc do class Foo < Formula url 'https://brew.sh/foo-1.0.tgz' desc 'Description with a trailing space ' - ^ Description shouldn't have trailing spaces. + ^ FormulaAudit/Desc: Description shouldn't have trailing spaces. end RUBY end @@ -74,8 +74,8 @@ describe RuboCop::Cop::FormulaAudit::Desc do class Foo < Formula url 'https://brew.sh/foo-1.0.tgz' desc 'command line' - ^ Description should start with a capital letter. - ^^^^^^^^^^^^ Description should use "command-line" instead of "command line". + ^ FormulaAudit/Desc: Description should start with a capital letter. + ^^^^^^^^^^^^ FormulaAudit/Desc: Description should use "command-line" instead of "command line". end RUBY end @@ -85,7 +85,7 @@ describe RuboCop::Cop::FormulaAudit::Desc do class Foo < Formula url 'https://brew.sh/foo-1.0.tgz' desc 'An aardvark' - ^^ Description shouldn't start with an article. + ^^ FormulaAudit/Desc: Description shouldn't start with an article. end RUBY @@ -93,7 +93,7 @@ describe RuboCop::Cop::FormulaAudit::Desc do class Foo < Formula url 'https://brew.sh/foo-1.0.tgz' desc 'The aardvark' - ^^^ Description shouldn't start with an article. + ^^^ FormulaAudit/Desc: Description shouldn't start with an article. end RUBY end @@ -103,7 +103,7 @@ describe RuboCop::Cop::FormulaAudit::Desc do class Foo < Formula url 'https://brew.sh/foo-1.0.tgz' desc 'bar' - ^ Description should start with a capital letter. + ^ FormulaAudit/Desc: Description should start with a capital letter. end RUBY end @@ -113,7 +113,7 @@ describe RuboCop::Cop::FormulaAudit::Desc do class Foo < Formula url 'https://brew.sh/foo-1.0.tgz' desc 'Foo is a foobar' - ^^^ Description shouldn't start with the formula name. + ^^^ FormulaAudit/Desc: Description shouldn't start with the formula name. end RUBY end @@ -123,7 +123,7 @@ describe RuboCop::Cop::FormulaAudit::Desc do class Foo < Formula url 'https://brew.sh/foo-1.0.tgz' desc 'Description with a full stop at the end.' - ^ Description shouldn't end with a full stop. + ^ FormulaAudit/Desc: Description shouldn't end with a full stop. end RUBY @@ -149,9 +149,9 @@ describe RuboCop::Cop::FormulaAudit::Desc do class Foo < Formula url 'https://brew.sh/foo-1.0.tgz' desc ' an bar: commandline foo ' - ^ Description shouldn't have trailing spaces. - ^^^^^^^^^^^ Description should use "command-line" instead of "commandline". - ^ Description shouldn't have leading spaces. + ^ FormulaAudit/Desc: Description shouldn't have trailing spaces. + ^^^^^^^^^^^ FormulaAudit/Desc: Description should use "command-line" instead of "commandline". + ^ FormulaAudit/Desc: Description shouldn't have leading spaces. end RUBY diff --git a/Library/Homebrew/test/rubocops/files_spec.rb b/Library/Homebrew/test/rubocops/files_spec.rb index e59550f692..1f25c51a85 100644 --- a/Library/Homebrew/test/rubocops/files_spec.rb +++ b/Library/Homebrew/test/rubocops/files_spec.rb @@ -14,7 +14,7 @@ describe RuboCop::Cop::FormulaAudit::Files do expect_offense(<<~RUBY, file) class Foo < Formula - ^^^^^^^^^^^^^^^^^^^ Incorrect file permissions (000): chmod +r #{filename} + ^^^^^^^^^^^^^^^^^^^ FormulaAudit/Files: Incorrect file permissions (000): chmod +r #{filename} url "https://brew.sh/foo-1.0.tgz" end RUBY diff --git a/Library/Homebrew/test/rubocops/homepage_spec.rb b/Library/Homebrew/test/rubocops/homepage_spec.rb index 99df59c53e..587758cf86 100644 --- a/Library/Homebrew/test/rubocops/homepage_spec.rb +++ b/Library/Homebrew/test/rubocops/homepage_spec.rb @@ -10,7 +10,7 @@ describe RuboCop::Cop::FormulaAudit::Homepage do it "reports an offense when there is no homepage" do expect_offense(<<~RUBY) class Foo < Formula - ^^^^^^^^^^^^^^^^^^^ Formula should have a homepage. + ^^^^^^^^^^^^^^^^^^^ FormulaAudit/Homepage: Formula should have a homepage. url 'https://brew.sh/foo-1.0.tgz' end RUBY @@ -20,7 +20,7 @@ describe RuboCop::Cop::FormulaAudit::Homepage do expect_offense(<<~RUBY) class Foo < Formula homepage "ftp://brew.sh/foo" - ^^^^^^^^^^^^^^^^^^^ The homepage should start with http or https. + ^^^^^^^^^^^^^^^^^^^ FormulaAudit/Homepage: The homepage should start with http or https. url "https://brew.sh/foo-1.0.tgz" end RUBY @@ -30,7 +30,7 @@ describe RuboCop::Cop::FormulaAudit::Homepage do expect_offense(<<~RUBY) class Foo < Formula homepage "http://www.freedesktop.org/wiki/bar" - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Freedesktop homepages should be styled `https://wiki.freedesktop.org/project_name` + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/Homepage: Freedesktop homepages should be styled `https://wiki.freedesktop.org/project_name` url "https://brew.sh/foo-1.0.tgz" end RUBY @@ -40,7 +40,7 @@ describe RuboCop::Cop::FormulaAudit::Homepage do expect_offense(<<~RUBY) class Foo < Formula homepage "http://www.freedesktop.org/wiki/Software/baz" - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Freedesktop homepages should be styled `https://wiki.freedesktop.org/www/Software/project_name` + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/Homepage: Freedesktop homepages should be styled `https://wiki.freedesktop.org/www/Software/project_name` url "https://brew.sh/foo-1.0.tgz" end RUBY @@ -50,7 +50,7 @@ describe RuboCop::Cop::FormulaAudit::Homepage do expect_offense(<<~RUBY) class Foo < Formula homepage "https://code.google.com/p/qux" - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Google Code homepages should end with a slash + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/Homepage: Google Code homepages should end with a slash url "https://brew.sh/foo-1.0.tgz" end RUBY @@ -67,7 +67,7 @@ describe RuboCop::Cop::FormulaAudit::Homepage do expect_offense(<<~RUBY) class Foo < Formula homepage "https://github.com/foo/bar.git" - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ GitHub homepages should not end with .git + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/Homepage: GitHub homepages should not end with .git url "https://brew.sh/foo-1.0.tgz" end RUBY @@ -92,7 +92,7 @@ describe RuboCop::Cop::FormulaAudit::Homepage do expect_offense(<<~RUBY) class Foo < Formula homepage "http://foo.sourceforge.net/" - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Sourceforge homepages should be `https://foo.sourceforge.io/` + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/Homepage: Sourceforge homepages should be `https://foo.sourceforge.io/` url "https://brew.sh/foo-1.0.tgz" end RUBY @@ -104,7 +104,7 @@ describe RuboCop::Cop::FormulaAudit::Homepage do expect_offense(<<~RUBY) class Foo < Formula homepage "http://foo.sourceforge.net" - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Sourceforge homepages should be `https://foo.sourceforge.io/` + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/Homepage: Sourceforge homepages should be `https://foo.sourceforge.io/` url "https://brew.sh/foo-1.0.tgz" end RUBY @@ -116,7 +116,7 @@ describe RuboCop::Cop::FormulaAudit::Homepage do expect_offense(<<~RUBY) class Foo < Formula homepage "http://foo.sf.net/" - ^^^^^^^^^^^^^^^^^^^^ Sourceforge homepages should be `https://foo.sourceforge.io/` + ^^^^^^^^^^^^^^^^^^^^ FormulaAudit/Homepage: Sourceforge homepages should be `https://foo.sourceforge.io/` url "https://brew.sh/foo-1.0.tgz" end RUBY @@ -129,7 +129,7 @@ describe RuboCop::Cop::FormulaAudit::Homepage do expect_offense(<<~RUBY) class Foo < Formula homepage "https://foo.readthedocs.org" - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Readthedocs homepages should be `https://foo.readthedocs.io` + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/Homepage: Readthedocs homepages should be `https://foo.readthedocs.io` url "https://brew.sh/foo-1.0.tgz" end RUBY @@ -160,7 +160,7 @@ describe RuboCop::Cop::FormulaAudit::Homepage do end RUBY - expected_offenses = [{ message: "Please use https:// for #{homepage}", + expected_offenses = [{ message: "FormulaAudit/Homepage: Please use https:// for #{homepage}", severity: :convention, line: 2, column: 11, diff --git a/Library/Homebrew/test/rubocops/io_read_spec.rb b/Library/Homebrew/test/rubocops/io_read_spec.rb index 98a00f3709..743bc557aa 100644 --- a/Library/Homebrew/test/rubocops/io_read_spec.rb +++ b/Library/Homebrew/test/rubocops/io_read_spec.rb @@ -9,7 +9,7 @@ describe RuboCop::Cop::Homebrew::IORead do it "reports an offense when `IO.read` is used with a pipe character" do expect_offense(<<~RUBY) IO.read("|echo test") - ^^^^^^^^^^^^^^^^^^^^^ The use of `IO.read` is a security risk. + ^^^^^^^^^^^^^^^^^^^^^ Homebrew/IORead: The use of `IO.read` is a security risk. RUBY end @@ -23,7 +23,7 @@ describe RuboCop::Cop::Homebrew::IORead do expect_offense(<<~RUBY) input = "input value from an unknown source" IO.read(input) - ^^^^^^^^^^^^^^ The use of `IO.read` is a security risk. + ^^^^^^^^^^^^^^ Homebrew/IORead: The use of `IO.read` is a security risk. RUBY end @@ -31,7 +31,7 @@ describe RuboCop::Cop::Homebrew::IORead do expect_offense(<<~'RUBY') input = "test" IO.read("|echo #{input}") - ^^^^^^^^^^^^^^^^^^^^^^^^^ The use of `IO.read` is a security risk. + ^^^^^^^^^^^^^^^^^^^^^^^^^ Homebrew/IORead: The use of `IO.read` is a security risk. RUBY end @@ -39,7 +39,7 @@ describe RuboCop::Cop::Homebrew::IORead do expect_offense(<<~'RUBY') input = "|echo test" IO.read("#{input}.txt") - ^^^^^^^^^^^^^^^^^^^^^^^ The use of `IO.read` is a security risk. + ^^^^^^^^^^^^^^^^^^^^^^^ Homebrew/IORead: The use of `IO.read` is a security risk. RUBY end @@ -54,7 +54,7 @@ describe RuboCop::Cop::Homebrew::IORead do expect_offense(<<~RUBY) input = "|echo test" IO.read("|echo " + input) - ^^^^^^^^^^^^^^^^^^^^^^^^^ The use of `IO.read` is a security risk. + ^^^^^^^^^^^^^^^^^^^^^^^^^ Homebrew/IORead: The use of `IO.read` is a security risk. RUBY end @@ -62,7 +62,7 @@ describe RuboCop::Cop::Homebrew::IORead do expect_offense(<<~RUBY) input = "|echo test" IO.read(input + ".txt") - ^^^^^^^^^^^^^^^^^^^^^^^ The use of `IO.read` is a security risk. + ^^^^^^^^^^^^^^^^^^^^^^^ Homebrew/IORead: The use of `IO.read` is a security risk. RUBY end diff --git a/Library/Homebrew/test/rubocops/keg_only_spec.rb b/Library/Homebrew/test/rubocops/keg_only_spec.rb index c98d1ef599..1a1b0e674b 100644 --- a/Library/Homebrew/test/rubocops/keg_only_spec.rb +++ b/Library/Homebrew/test/rubocops/keg_only_spec.rb @@ -14,7 +14,7 @@ describe RuboCop::Cop::FormulaAudit::KegOnly do homepage "https://brew.sh" keg_only "Because why not" - ^^^^^^^^^^^^^^^^^ 'Because' from the `keg_only` reason should be 'because'. + ^^^^^^^^^^^^^^^^^ FormulaAudit/KegOnly: 'Because' from the `keg_only` reason should be 'because'. end RUBY @@ -36,7 +36,7 @@ describe RuboCop::Cop::FormulaAudit::KegOnly do homepage "https://brew.sh" keg_only "ending with a period." - ^^^^^^^^^^^^^^^^^^^^^^^ `keg_only` reason should not end with a period. + ^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/KegOnly: `keg_only` reason should not end with a period. end RUBY diff --git a/Library/Homebrew/test/rubocops/lines/class_inheritance_spec.rb b/Library/Homebrew/test/rubocops/lines/class_inheritance_spec.rb index 72e7153347..47fdc95135 100644 --- a/Library/Homebrew/test/rubocops/lines/class_inheritance_spec.rb +++ b/Library/Homebrew/test/rubocops/lines/class_inheritance_spec.rb @@ -10,7 +10,7 @@ describe RuboCop::Cop::FormulaAudit::ClassInheritance do it "reports an offense when not using spaces for class inheritance" do expect_offense(<<~RUBY, "/homebrew-core/Formula/foo.rb") class Foo "with-examples" - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Formulae in homebrew/core should not use `deprecated_option`. + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/Options: Formulae in homebrew/core should not use `deprecated_option`. end RUBY end @@ -63,7 +63,7 @@ describe RuboCop::Cop::FormulaAudit::Options do class Foo < Formula url 'https://brew.sh/foo-1.0.tgz' option "with-examples" - ^^^^^^^^^^^^^^^^^^^^^^ Formulae in homebrew/core should not use `option`. + ^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/Options: Formulae in homebrew/core should not use `option`. end RUBY end diff --git a/Library/Homebrew/test/rubocops/patches_spec.rb b/Library/Homebrew/test/rubocops/patches_spec.rb index 00163bd9ac..5d4c07f4e6 100644 --- a/Library/Homebrew/test/rubocops/patches_spec.rb +++ b/Library/Homebrew/test/rubocops/patches_spec.rb @@ -25,7 +25,7 @@ describe RuboCop::Cop::FormulaAudit::Patches do homepage "ftp://brew.sh/foo" url "https://brew.sh/foo-1.0.tgz" def patches - ^^^^^^^^^^^ Use the patch DSL instead of defining a 'patches' method + ^^^^^^^^^^^ FormulaAudit/Patches: Use the patch DSL instead of defining a 'patches' method DATA end end @@ -54,28 +54,29 @@ describe RuboCop::Cop::FormulaAudit::Patches do expected_offense = if patch_url.include?("/raw.github.com/") expect_offense_hash message: <<~EOS.chomp, severity: :convention, line: 5, column: 4, source: source - GitHub/Gist patches should specify a revision: #{patch_url} + FormulaAudit/Patches: GitHub/Gist patches should specify a revision: #{patch_url} EOS elsif patch_url.include?("macports/trunk") expect_offense_hash message: <<~EOS.chomp, severity: :convention, line: 5, column: 4, source: source - MacPorts patches should specify a revision instead of trunk: #{patch_url} + FormulaAudit/Patches: MacPorts patches should specify a revision instead of trunk: #{patch_url} EOS elsif patch_url.start_with?("http://trac.macports.org/") expect_offense_hash message: <<~EOS.chomp, severity: :convention, line: 5, column: 4, source: source - Patches from MacPorts Trac should be https://, not http: #{patch_url} + FormulaAudit/Patches: Patches from MacPorts Trac should be https://, not http: #{patch_url} EOS elsif patch_url.start_with?("http://bugs.debian.org/") expect_offense_hash message: <<~EOS.chomp, severity: :convention, line: 5, column: 4, source: source - Patches from Debian should be https://, not http: #{patch_url} + FormulaAudit/Patches: Patches from Debian should be https://, not http: #{patch_url} EOS # rubocop:disable Layout/LineLength elsif patch_url.match?(%r{https?://patch-diff\.githubusercontent\.com/raw/(.+)/(.+)/pull/(.+)\.(?:diff|patch)}) # rubocop:enable Layout/LineLength - expect_offense_hash message: "Use a commit hash URL rather than patch-diff: #{patch_url}", - severity: :convention, line: 5, column: 4, source: source + expect_offense_hash message: <<~EOS.chomp, severity: :convention, line: 5, column: 4, source: source + FormulaAudit/Patches: Use a commit hash URL rather than patch-diff: #{patch_url} + EOS elsif patch_url.match?(%r{https?://github\.com/.+/.+/(?:commit|pull)/[a-fA-F0-9]*.(?:patch|diff)}) expect_offense_hash message: <<~EOS.chomp, severity: :convention, line: 5, column: 4, source: source - GitHub patches should use the full_index parameter: #{patch_url}?full_index=1 + FormulaAudit/Patches: GitHub patches should use the full_index parameter: #{patch_url}?full_index=1 EOS end expected_offense.zip([inspect_source(source).last]).each do |expected, actual| @@ -102,17 +103,22 @@ describe RuboCop::Cop::FormulaAudit::Patches do end RUBY - expected_offenses = [{ message: "Use the patch DSL instead of defining a 'patches' method", - severity: :convention, - line: 4, - column: 2, - source: source }, - { message: "Patches from MacPorts Trac should be https://, not http: " \ - "http://trac.macports.org/export/68507/trunk/dports/net/trafshow/files/", - severity: :convention, - line: 8, - column: 25, - source: source }] + expected_offenses = [ + { + message: "FormulaAudit/Patches: Use the patch DSL instead of defining a 'patches' method", + severity: :convention, + line: 4, + column: 2, + source: source, + }, { + message: "FormulaAudit/Patches: Patches from MacPorts Trac should be https://, not http: " \ + "http://trac.macports.org/export/68507/trunk/dports/net/trafshow/files/", + severity: :convention, + line: 8, + column: 25, + source: source, + } + ] expected_offenses.zip(inspect_source(source)).each do |expected, actual| expect(actual.message).to eq(expected[:message]) @@ -153,7 +159,7 @@ describe RuboCop::Cop::FormulaAudit::Patches do class Foo < Formula url 'https://brew.sh/foo-1.0.tgz' patch :DATA - ^^^^^^^^^^^ patch is missing '__END__' + ^^^^^^^^^^^ FormulaAudit/Patches: patch is missing '__END__' end RUBY end @@ -164,7 +170,7 @@ describe RuboCop::Cop::FormulaAudit::Patches do url 'https://brew.sh/foo-1.0.tgz' end __END__ - ^^^^^^^ patch is missing 'DATA' + ^^^^^^^ FormulaAudit/Patches: patch is missing 'DATA' patch content here RUBY end @@ -197,41 +203,42 @@ describe RuboCop::Cop::FormulaAudit::Patches do expected_offense = if patch_url.include?("/raw.github.com/") expect_offense_hash message: <<~EOS.chomp, severity: :convention, line: 5, column: 8, source: source - GitHub/Gist patches should specify a revision: #{patch_url} + FormulaAudit/Patches: GitHub/Gist patches should specify a revision: #{patch_url} EOS elsif patch_url.include?("macports/trunk") expect_offense_hash message: <<~EOS.chomp, severity: :convention, line: 5, column: 8, source: source - MacPorts patches should specify a revision instead of trunk: #{patch_url} + FormulaAudit/Patches: MacPorts patches should specify a revision instead of trunk: #{patch_url} EOS elsif patch_url.start_with?("http://trac.macports.org/") expect_offense_hash message: <<~EOS.chomp, severity: :convention, line: 5, column: 8, source: source - Patches from MacPorts Trac should be https://, not http: #{patch_url} + FormulaAudit/Patches: Patches from MacPorts Trac should be https://, not http: #{patch_url} EOS elsif patch_url.start_with?("http://bugs.debian.org/") expect_offense_hash message: <<~EOS.chomp, severity: :convention, line: 5, column: 8, source: source - Patches from Debian should be https://, not http: #{patch_url} + FormulaAudit/Patches: Patches from Debian should be https://, not http: #{patch_url} EOS elsif patch_url.match?(%r{https://github.com/[^/]*/[^/]*/pull}) expect_offense_hash message: <<~EOS.chomp, severity: :convention, line: 5, column: 8, source: source - Use a commit hash URL rather than an unstable pull request URL: #{patch_url} + FormulaAudit/Patches: Use a commit hash URL rather than an unstable pull request URL: #{patch_url} EOS elsif patch_url.match?(%r{.*gitlab.*/merge_request.*}) expect_offense_hash message: <<~EOS.chomp, severity: :convention, line: 5, column: 8, source: source - Use a commit hash URL rather than an unstable merge request URL: #{patch_url} + FormulaAudit/Patches: Use a commit hash URL rather than an unstable merge request URL: #{patch_url} EOS elsif patch_url.match?(%r{https://github.com/[^/]*/[^/]*/commit/}) expect_offense_hash message: <<~EOS.chomp, severity: :convention, line: 5, column: 8, source: source - GitHub patches should end with .patch, not .diff: #{patch_url} + FormulaAudit/Patches: GitHub patches should end with .patch, not .diff: #{patch_url} EOS elsif patch_url.match?(%r{.*gitlab.*/commit/}) expect_offense_hash message: <<~EOS.chomp, severity: :convention, line: 5, column: 8, source: source - GitLab patches should end with .diff, not .patch: #{patch_url} + FormulaAudit/Patches: GitLab patches should end with .diff, not .patch: #{patch_url} EOS # rubocop:disable Layout/LineLength elsif patch_url.match?(%r{https?://patch-diff\.githubusercontent\.com/raw/(.+)/(.+)/pull/(.+)\.(?:diff|patch)}) # rubocop:enable Layout/LineLength - expect_offense_hash message: "Use a commit hash URL rather than patch-diff: #{patch_url}", - severity: :convention, line: 5, column: 8, source: source + expect_offense_hash message: <<~EOS.chomp, severity: :convention, line: 5, column: 8, source: source + FormulaAudit/Patches: Use a commit hash URL rather than patch-diff: #{patch_url} + EOS end expected_offense.zip([inspect_source(source).last]).each do |expected, actual| expect(actual.message).to eq(expected[:message]) diff --git a/Library/Homebrew/test/rubocops/provided_by_macos_spec.rb b/Library/Homebrew/test/rubocops/provided_by_macos_spec.rb index 64ad615094..b04020029f 100644 --- a/Library/Homebrew/test/rubocops/provided_by_macos_spec.rb +++ b/Library/Homebrew/test/rubocops/provided_by_macos_spec.rb @@ -13,7 +13,7 @@ describe RuboCop::Cop::FormulaAudit::ProvidedByMacos do homepage "https://brew.sh" keg_only :provided_by_macos - ^^^^^^^^^^^^^^^^^^^^^^^^^^^ Formulae that are `keg_only :provided_by_macos` should be added to the `PROVIDED_BY_MACOS_FORMULAE` list (in the Homebrew/brew repo) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/ProvidedByMacos: Formulae that are `keg_only :provided_by_macos` should be added to the `PROVIDED_BY_MACOS_FORMULAE` list (in the Homebrew/brew repo) end RUBY end diff --git a/Library/Homebrew/test/rubocops/service_spec.rb b/Library/Homebrew/test/rubocops/service_spec.rb index 86a4ed47ed..db2729fb00 100644 --- a/Library/Homebrew/test/rubocops/service_spec.rb +++ b/Library/Homebrew/test/rubocops/service_spec.rb @@ -13,7 +13,7 @@ describe RuboCop::Cop::FormulaAudit::Service do service do run [bin/"foo", "run", "-config", etc/"foo/config.json"] - ^^^ Use `opt_bin` instead of `bin` in service blocks. + ^^^ FormulaAudit/Service: Use `opt_bin` instead of `bin` in service blocks. end end RUBY diff --git a/Library/Homebrew/test/rubocops/shell_commands_spec.rb b/Library/Homebrew/test/rubocops/shell_commands_spec.rb index 0e1885f390..faf0606b57 100644 --- a/Library/Homebrew/test/rubocops/shell_commands_spec.rb +++ b/Library/Homebrew/test/rubocops/shell_commands_spec.rb @@ -15,7 +15,7 @@ module RuboCop class Foo < Formula def install system "foo bar" - ^^^^^^^^^ Separate `system` commands into `"foo", "bar"` + ^^^^^^^^^ Homebrew/ShellCommands: Separate `system` commands into `"foo", "bar"` end end RUBY @@ -34,7 +34,7 @@ module RuboCop class Foo < Formula def install system "\#{bin}/foo bar" - ^^^^^^^^^^^^^^^^ Separate `system` commands into `"\#{bin}/foo", "bar"` + ^^^^^^^^^^^^^^^^ Homebrew/ShellCommands: Separate `system` commands into `"\#{bin}/foo", "bar"` end end RUBY @@ -83,7 +83,7 @@ module RuboCop class Foo < Formula def install Utils.popen_read("foo bar") - ^^^^^^^^^ Separate `Utils.popen_read` commands into `"foo", "bar"` + ^^^^^^^^^ Homebrew/ShellCommands: Separate `Utils.popen_read` commands into `"foo", "bar"` end end RUBY @@ -102,7 +102,7 @@ module RuboCop class Foo < Formula def install Utils.safe_popen_read("foo bar") - ^^^^^^^^^ Separate `Utils.safe_popen_read` commands into `"foo", "bar"` + ^^^^^^^^^ Homebrew/ShellCommands: Separate `Utils.safe_popen_read` commands into `"foo", "bar"` end end RUBY @@ -121,7 +121,7 @@ module RuboCop class Foo < Formula def install Utils.popen_write("foo bar") - ^^^^^^^^^ Separate `Utils.popen_write` commands into `"foo", "bar"` + ^^^^^^^^^ Homebrew/ShellCommands: Separate `Utils.popen_write` commands into `"foo", "bar"` end end RUBY @@ -140,7 +140,7 @@ module RuboCop class Foo < Formula def install Utils.safe_popen_write("foo bar") - ^^^^^^^^^ Separate `Utils.safe_popen_write` commands into `"foo", "bar"` + ^^^^^^^^^ Homebrew/ShellCommands: Separate `Utils.safe_popen_write` commands into `"foo", "bar"` end end RUBY @@ -159,7 +159,7 @@ module RuboCop class Foo < Formula def install Utils.popen_read("\#{bin}/foo bar") - ^^^^^^^^^^^^^^^^ Separate `Utils.popen_read` commands into `"\#{bin}/foo", "bar"` + ^^^^^^^^^^^^^^^^ Homebrew/ShellCommands: Separate `Utils.popen_read` commands into `"\#{bin}/foo", "bar"` end end RUBY @@ -198,7 +198,7 @@ module RuboCop class Foo < Formula def install Utils.popen_read({ "SHELL" => "bash"}, "foo bar") - ^^^^^^^^^ Separate `Utils.popen_read` commands into `"foo", "bar"` + ^^^^^^^^^ Homebrew/ShellCommands: Separate `Utils.popen_read` commands into `"foo", "bar"` end end RUBY @@ -222,7 +222,7 @@ module RuboCop expect_offense(<<~RUBY) fork do exec "foo bar > output" - ^^^^^^^^^^^^^^^^^^ Don't use shell metacharacters in `exec`. Implement the logic in Ruby instead, using methods like `$stdout.reopen`. + ^^^^^^^^^^^^^^^^^^ Homebrew/ExecShellMetacharacters: Don't use shell metacharacters in `exec`. Implement the logic in Ruby instead, using methods like `$stdout.reopen`. end RUBY end diff --git a/Library/Homebrew/test/rubocops/text/assert_statements_spec.rb b/Library/Homebrew/test/rubocops/text/assert_statements_spec.rb index 90cce65e23..7a06d7ef26 100644 --- a/Library/Homebrew/test/rubocops/text/assert_statements_spec.rb +++ b/Library/Homebrew/test/rubocops/text/assert_statements_spec.rb @@ -13,7 +13,7 @@ describe RuboCop::Cop::FormulaAudit::AssertStatements do desc "foo" url 'https://brew.sh/foo-1.0.tgz' assert File.read("inbox").include?("Sample message 1") - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Use `assert_match` instead of `assert ...include?` + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/AssertStatements: Use `assert_match` instead of `assert ...include?` end RUBY end @@ -24,7 +24,7 @@ describe RuboCop::Cop::FormulaAudit::AssertStatements do desc "foo" url 'https://brew.sh/foo-1.0.tgz' assert File.exist? "default.ini" - ^^^^^^^^^^^^^^^^^^^^^^^^^ Use `assert_predicate , :exist?` instead of `assert File.exist? "default.ini"` + ^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/AssertStatements: Use `assert_predicate , :exist?` instead of `assert File.exist? "default.ini"` end RUBY end @@ -35,7 +35,7 @@ describe RuboCop::Cop::FormulaAudit::AssertStatements do desc "foo" url 'https://brew.sh/foo-1.0.tgz' assert !File.exist?("default.ini") - ^^^^^^^^^^^^^^^^^^^^^^^^^^^ Use `refute_predicate , :exist?` instead of `assert !File.exist?("default.ini")` + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/AssertStatements: Use `refute_predicate , :exist?` instead of `assert !File.exist?("default.ini")` end RUBY end @@ -46,7 +46,7 @@ describe RuboCop::Cop::FormulaAudit::AssertStatements do desc "foo" url 'https://brew.sh/foo-1.0.tgz' assert File.executable? f - ^^^^^^^^^^^^^^^^^^ Use `assert_predicate , :executable?` instead of `assert File.executable? f` + ^^^^^^^^^^^^^^^^^^ FormulaAudit/AssertStatements: Use `assert_predicate , :executable?` instead of `assert File.executable? f` end RUBY end diff --git a/Library/Homebrew/test/rubocops/text/comments_spec.rb b/Library/Homebrew/test/rubocops/text/comments_spec.rb index 0861b7f543..6384a61a30 100644 --- a/Library/Homebrew/test/rubocops/text/comments_spec.rb +++ b/Library/Homebrew/test/rubocops/text/comments_spec.rb @@ -13,7 +13,7 @@ describe RuboCop::Cop::FormulaAudit::Comments do desc "foo" url 'https://brew.sh/foo-1.0.tgz' # system "cmake", ".", *std_cmake_args - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Please remove default template comments + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/Comments: Please remove default template comments end RUBY end @@ -22,7 +22,7 @@ describe RuboCop::Cop::FormulaAudit::Comments do expect_offense(<<~RUBY) class Foo < Formula # PLEASE REMOVE - ^^^^^^^^^^^^^^^ Please remove default template comments + ^^^^^^^^^^^^^^^ FormulaAudit/Comments: Please remove default template comments desc "foo" url 'https://brew.sh/foo-1.0.tgz' end @@ -35,7 +35,7 @@ describe RuboCop::Cop::FormulaAudit::Comments do desc "foo" url 'https://brew.sh/foo-1.0.tgz' # depends_on "foo" - ^^^^^^^^^^^^^^^^^^ Commented-out dependency "foo" + ^^^^^^^^^^^^^^^^^^ FormulaAudit/Comments: Commented-out dependency "foo" end RUBY end @@ -46,11 +46,11 @@ describe RuboCop::Cop::FormulaAudit::Comments do desc "foo" url 'https://brew.sh/foo-1.0.tgz' # cite Howell_2009: - ^^^^^^^^^^^^^^^^^^^ Formulae in homebrew/core should not use `cite` comments + ^^^^^^^^^^^^^^^^^^^ FormulaAudit/Comments: Formulae in homebrew/core should not use `cite` comments # doi "10.111/222.x" - ^^^^^^^^^^^^^^^^^^^^ Formulae in homebrew/core should not use `doi` comments + ^^^^^^^^^^^^^^^^^^^^ FormulaAudit/Comments: Formulae in homebrew/core should not use `doi` comments # tag "software" - ^^^^^^^^^^^^^^^^ Formulae in homebrew/core should not use `tag` comments + ^^^^^^^^^^^^^^^^ FormulaAudit/Comments: Formulae in homebrew/core should not use `tag` comments end RUBY end diff --git a/Library/Homebrew/test/rubocops/text/license_arrays_spec.rb b/Library/Homebrew/test/rubocops/text/license_arrays_spec.rb index 2cbadfaa60..30866a6a8c 100644 --- a/Library/Homebrew/test/rubocops/text/license_arrays_spec.rb +++ b/Library/Homebrew/test/rubocops/text/license_arrays_spec.rb @@ -43,7 +43,7 @@ describe RuboCop::Cop::FormulaAudit::LicenseArrays do desc "foo" url 'https://brew.sh/foo-1.0.tgz' license ["MIT", "0BSD"] - ^^^^^^^^^^^^^^^^^^^^^^^ Use `license any_of: ["MIT", "0BSD"]` instead of `license ["MIT", "0BSD"]` + ^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/LicenseArrays: Use `license any_of: ["MIT", "0BSD"]` instead of `license ["MIT", "0BSD"]` end RUBY diff --git a/Library/Homebrew/test/rubocops/text/licenses_spec.rb b/Library/Homebrew/test/rubocops/text/licenses_spec.rb index 5fc3fe1f74..6a44bd6a74 100644 --- a/Library/Homebrew/test/rubocops/text/licenses_spec.rb +++ b/Library/Homebrew/test/rubocops/text/licenses_spec.rb @@ -80,7 +80,7 @@ describe RuboCop::Cop::FormulaAudit::Licenses do desc "foo" url 'https://brew.sh/foo-1.0.tgz' license any_of: ["MIT", all_of: ["0BSD", "Zlib"]] - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Split nested license declarations onto multiple lines + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/Licenses: Split nested license declarations onto multiple lines end RUBY end diff --git a/Library/Homebrew/test/rubocops/text/make_check_spec.rb b/Library/Homebrew/test/rubocops/text/make_check_spec.rb index da902cdfe0..c60be6b8db 100644 --- a/Library/Homebrew/test/rubocops/text/make_check_spec.rb +++ b/Library/Homebrew/test/rubocops/text/make_check_spec.rb @@ -27,7 +27,7 @@ describe RuboCop::Cop::FormulaAuditStrict::MakeCheck do desc "foo" url 'https://brew.sh/foo-1.0.tgz' system "make", "-j1", "test" - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Formulae in homebrew/core (except e.g. cryptography, libraries) should not run build-time checks + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAuditStrict/MakeCheck: Formulae in homebrew/core (except e.g. cryptography, libraries) should not run build-time checks end RUBY end diff --git a/Library/Homebrew/test/rubocops/text/miscellaneous_spec.rb b/Library/Homebrew/test/rubocops/text/miscellaneous_spec.rb index cb3781bd45..fda2096c4c 100644 --- a/Library/Homebrew/test/rubocops/text/miscellaneous_spec.rb +++ b/Library/Homebrew/test/rubocops/text/miscellaneous_spec.rb @@ -13,7 +13,7 @@ describe RuboCop::Cop::FormulaAudit::Miscellaneous do desc "foo" url 'https://brew.sh/foo-1.0.tgz' FileUtils.mv "hello" - ^^^^^^^^^^^^^^^^^^^^ Don't need 'FileUtils.' before mv + ^^^^^^^^^^^^^^^^^^^^ FormulaAudit/Miscellaneous: Don't need 'FileUtils.' before mv end RUBY end @@ -24,7 +24,7 @@ describe RuboCop::Cop::FormulaAudit::Miscellaneous do desc "foo" url 'https://brew.sh/foo-1.0.tgz' inreplace "foo" do |longvar| - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ "inreplace do |s|" is preferred over "|longvar|". + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/Miscellaneous: "inreplace do |s|" is preferred over "|longvar|". somerandomCall(longvar) end end @@ -38,7 +38,7 @@ describe RuboCop::Cop::FormulaAudit::Miscellaneous do url 'https://brew.sh/foo-1.0.tgz' bottle do rebuild 0 - ^^^^^^^^^ 'rebuild 0' should be removed + ^^^^^^^^^ FormulaAudit/Miscellaneous: 'rebuild 0' should be removed sha256 "fe0679b932dd43a87fd415b609a7fbac7a069d117642ae8ebaac46ae1fb9f0b3" => :sierra end end @@ -54,7 +54,7 @@ describe RuboCop::Cop::FormulaAudit::Miscellaneous do sha256 "fe0679b932dd43a87fd415b609a7fbac7a069d117642ae8ebaac46ae1fb9f0b3" => :sierra end fails_with :llvm do - ^^^^^^^^^^^^^^^^ 'fails_with :llvm' is now a no-op so should be removed + ^^^^^^^^^^^^^^^^ FormulaAudit/Miscellaneous: 'fails_with :llvm' is now a no-op so should be removed build 2335 cause "foo" end @@ -69,7 +69,7 @@ describe RuboCop::Cop::FormulaAudit::Miscellaneous do url 'https://brew.sh/foo-1.0.tgz' def test - ^^^^^^^^ Use new-style test definitions (test do) + ^^^^^^^^ FormulaAudit/Miscellaneous: Use new-style test definitions (test do) assert_equals "1", "1" end end @@ -82,7 +82,7 @@ describe RuboCop::Cop::FormulaAudit::Miscellaneous do desc "foo" url 'https://brew.sh/foo-1.0.tgz' skip_clean :all - ^^^^^^^^^^^^^^^ `skip_clean :all` is deprecated; brew no longer strips symbols. Pass explicit paths to prevent Homebrew from removing empty folders. + ^^^^^^^^^^^^^^^ FormulaAudit/Miscellaneous: `skip_clean :all` is deprecated; brew no longer strips symbols. Pass explicit paths to prevent Homebrew from removing empty folders. end RUBY end @@ -93,7 +93,7 @@ describe RuboCop::Cop::FormulaAudit::Miscellaneous do desc "foo" url 'https://brew.sh/foo-1.0.tgz' if build.universal? - ^^^^^^^^^^^^^^^^ macOS has been 64-bit only since 10.6 so build.universal? is deprecated. + ^^^^^^^^^^^^^^^^ FormulaAudit/Miscellaneous: macOS has been 64-bit only since 10.6 so build.universal? is deprecated. "foo" end end @@ -119,7 +119,7 @@ describe RuboCop::Cop::FormulaAudit::Miscellaneous do url 'https://brew.sh/foo-1.0.tgz' if build? ENV.universal_binary - ^^^^^^^^^^^^^^^^^^^^ macOS has been 64-bit only since 10.6 so ENV.universal_binary is deprecated. + ^^^^^^^^^^^^^^^^^^^^ FormulaAudit/Miscellaneous: macOS has been 64-bit only since 10.6 so ENV.universal_binary is deprecated. end end RUBY @@ -143,7 +143,7 @@ describe RuboCop::Cop::FormulaAudit::Miscellaneous do desc "foo" url 'https://brew.sh/foo-1.0.tgz' system "install_name_tool", "-id" - ^^^^^^^^^^^^^^^^^^^ Use ruby-macho instead of calling "install_name_tool" + ^^^^^^^^^^^^^^^^^^^ FormulaAudit/Miscellaneous: Use ruby-macho instead of calling "install_name_tool" end RUBY end @@ -154,7 +154,7 @@ describe RuboCop::Cop::FormulaAudit::Miscellaneous do desc "foo" url 'https://brew.sh/foo-1.0.tgz' system "npm", "install" - ^^^^^^^^^^^^^^^^^^^^^^^ Use Language::Node for npm install args + ^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/Miscellaneous: Use Language::Node for npm install args end RUBY end @@ -175,7 +175,7 @@ describe RuboCop::Cop::FormulaAudit::Miscellaneous do desc "foo" url 'https://brew.sh/foo-1.0.tgz' depends_on FOO::BAR.new - ^^^^^^^^^^^^ `depends_on` can take requirement classes instead of instances + ^^^^^^^^^^^^ FormulaAudit/Miscellaneous: `depends_on` can take requirement classes instead of instances end RUBY end @@ -187,7 +187,7 @@ describe RuboCop::Cop::FormulaAudit::Miscellaneous do url 'https://brew.sh/foo-1.0.tgz' rm_rf Dir["src/{llvm,test,librustdoc,etc/snapshot.pyc}"] rm_rf Dir["src/snapshot.pyc"] - ^^^^^^^^^^^^^^^^^^ Dir(["src/snapshot.pyc"]) is unnecessary; just use "src/snapshot.pyc" + ^^^^^^^^^^^^^^^^^^ FormulaAudit/Miscellaneous: Dir(["src/snapshot.pyc"]) is unnecessary; just use "src/snapshot.pyc" end RUBY end @@ -198,7 +198,7 @@ describe RuboCop::Cop::FormulaAudit::Miscellaneous do desc "foo" url 'https://brew.sh/foo-1.0.tgz' system "mkdir", "foo" - ^^^^^^^ Use the `mkdir` Ruby method instead of `system "mkdir", "foo"` + ^^^^^^^ FormulaAudit/Miscellaneous: Use the `mkdir` Ruby method instead of `system "mkdir", "foo"` end RUBY end @@ -206,7 +206,7 @@ describe RuboCop::Cop::FormulaAudit::Miscellaneous do it "reports an offense when top-level functions are defined outside of a class body" do expect_offense(<<~RUBY) def test - ^^^^^^^^ Define method test in the class body, not at the top-level + ^^^^^^^^ FormulaAudit/Miscellaneous: Define method test in the class body, not at the top-level nil end class Foo < Formula @@ -223,7 +223,7 @@ describe RuboCop::Cop::FormulaAudit::Miscellaneous do url 'https://brew.sh/foo-1.0.tgz' def install man1.install man+"man8" => "faad.1" - ^^^^^^ "man+"man8"" should be "man8" + ^^^^^^ FormulaAudit/Miscellaneous: "man+"man8"" should be "man8" end end RUBY @@ -236,7 +236,7 @@ describe RuboCop::Cop::FormulaAudit::Miscellaneous do url 'https://brew.sh/foo-1.0.tgz' def install system "/usr/bin/gcc", "foo" - ^^^^^^^^^^^^^^ Use "#{ENV.cc}" instead of hard-coding "gcc" + ^^^^^^^^^^^^^^ FormulaAudit/Miscellaneous: Use "#{ENV.cc}" instead of hard-coding "gcc" end end RUBY @@ -249,7 +249,7 @@ describe RuboCop::Cop::FormulaAudit::Miscellaneous do url 'https://brew.sh/foo-1.0.tgz' def install system "/usr/bin/g++", "-o", "foo", "foo.cc" - ^^^^^^^^^^^^^^ Use "#{ENV.cxx}" instead of hard-coding "g++" + ^^^^^^^^^^^^^^ FormulaAudit/Miscellaneous: Use "#{ENV.cxx}" instead of hard-coding "g++" end end RUBY @@ -262,7 +262,7 @@ describe RuboCop::Cop::FormulaAudit::Miscellaneous do url 'https://brew.sh/foo-1.0.tgz' def install ENV["COMPILER_PATH"] = "/usr/bin/c++" - ^^^^^^^^^^^^^^ Use "#{ENV.cxx}" instead of hard-coding "c++" + ^^^^^^^^^^^^^^ FormulaAudit/Miscellaneous: Use "#{ENV.cxx}" instead of hard-coding "c++" end end RUBY @@ -275,7 +275,7 @@ describe RuboCop::Cop::FormulaAudit::Miscellaneous do url 'https://brew.sh/foo-1.0.tgz' def install ENV["COMPILER_PATH"] = "/usr/bin/gcc" - ^^^^^^^^^^^^^^ Use "\#{ENV.cc}" instead of hard-coding "gcc" + ^^^^^^^^^^^^^^ FormulaAudit/Miscellaneous: Use "\#{ENV.cc}" instead of hard-coding "gcc" end end RUBY @@ -288,7 +288,7 @@ describe RuboCop::Cop::FormulaAudit::Miscellaneous do url 'https://brew.sh/foo-1.0.tgz' def install mv "#{share}/man", share - ^^^^ "#{share}/man" should be "#{man}" + ^^^^ FormulaAudit/Miscellaneous: "#{share}/man" should be "#{man}" end end RUBY @@ -301,7 +301,7 @@ describe RuboCop::Cop::FormulaAudit::Miscellaneous do url 'https://brew.sh/foo-1.0.tgz' def install mv "#{prefix}/libexec", share - ^^^^^^^^ "#{prefix}/libexec" should be "#{libexec}" + ^^^^^^^^ FormulaAudit/Miscellaneous: "#{prefix}/libexec" should be "#{libexec}" end end RUBY @@ -314,7 +314,7 @@ describe RuboCop::Cop::FormulaAudit::Miscellaneous do url 'https://brew.sh/foo-1.0.tgz' def install system "./configure", "--INFODIR=#{prefix}/share/info" - ^^^^^^^^^^^ "#{prefix}/share/info" should be "#{info}" + ^^^^^^^^^^^ FormulaAudit/Miscellaneous: "#{prefix}/share/info" should be "#{info}" end end RUBY @@ -327,7 +327,7 @@ describe RuboCop::Cop::FormulaAudit::Miscellaneous do url 'https://brew.sh/foo-1.0.tgz' def install system "./configure", "--MANDIR=#{prefix}/share/man/man8" - ^^^^^^^^^^^^^^^ "#{prefix}/share/man/man8" should be "#{man8}" + ^^^^^^^^^^^^^^^ FormulaAudit/Miscellaneous: "#{prefix}/share/man/man8" should be "#{man8}" end end RUBY @@ -339,7 +339,7 @@ describe RuboCop::Cop::FormulaAudit::Miscellaneous do desc "foo" url 'https://brew.sh/foo-1.0.tgz' depends_on "lpeg" => :lua51 - ^^^^^^ lua modules should be vendored rather than use deprecated `depends_on "lpeg" => :lua51` + ^^^^^^ FormulaAudit/Miscellaneous: lua modules should be vendored rather than use deprecated `depends_on "lpeg" => :lua51` end RUBY end @@ -350,7 +350,7 @@ describe RuboCop::Cop::FormulaAudit::Miscellaneous do desc "foo" url 'https://brew.sh/foo-1.0.tgz' system "export", "var=value" - ^^^^^^^^ Use ENV instead of invoking 'export' to modify the environment + ^^^^^^^^ FormulaAudit/Miscellaneous: Use ENV instead of invoking 'export' to modify the environment end RUBY end @@ -361,7 +361,7 @@ describe RuboCop::Cop::FormulaAudit::Miscellaneous do desc "foo" url 'https://brew.sh/foo-1.0.tgz' depends_on "foo" => "with-bar" - ^^^^^^^^^^ Dependency foo should not use option with-bar + ^^^^^^^^^^ FormulaAudit/Miscellaneous: Dependency foo should not use option with-bar end RUBY end @@ -373,9 +373,9 @@ describe RuboCop::Cop::FormulaAudit::Miscellaneous do url 'https://brew.sh/foo-1.0.tgz' depends_on "httpd" => [:build, :test] depends_on "foo" => [:optional, "with-bar"] - ^^^^^^^^^^ Dependency foo should not use option with-bar + ^^^^^^^^^^ FormulaAudit/Miscellaneous: Dependency foo should not use option with-bar depends_on "icu4c" => [:optional, "c++11"] - ^^^^^^^ Dependency icu4c should not use option c++11 + ^^^^^^^ FormulaAudit/Miscellaneous: Dependency icu4c should not use option c++11 end RUBY end @@ -386,7 +386,7 @@ describe RuboCop::Cop::FormulaAudit::Miscellaneous do desc "foo" url 'https://brew.sh/foo-1.0.tgz' if version == "HEAD" - ^^^^^^^^^^^^^^^^^ Use 'build.head?' instead of inspecting 'version' + ^^^^^^^^^^^^^^^^^ FormulaAudit/Miscellaneous: Use 'build.head?' instead of inspecting 'version' foo() end end @@ -400,8 +400,8 @@ describe RuboCop::Cop::FormulaAudit::Miscellaneous do url 'https://brew.sh/foo-1.0.tgz' test do head = ARGV.include? "--HEAD" - ^^^^ Use build instead of ARGV to check options - ^^^^^^^^^^^^^^^^^^^^^^ Use "if build.head?" instead + ^^^^ FormulaAudit/Miscellaneous: Use build instead of ARGV to check options + ^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/Miscellaneous: Use "if build.head?" instead end end RUBY @@ -413,7 +413,7 @@ describe RuboCop::Cop::FormulaAudit::Miscellaneous do desc "foo" url 'https://brew.sh/foo-1.0.tgz' needs :openmp - ^^^^^^^^^^^^^ 'needs :openmp' should be replaced with 'depends_on "gcc"' + ^^^^^^^^^^^^^ FormulaAudit/Miscellaneous: 'needs :openmp' should be replaced with 'depends_on "gcc"' end RUBY end @@ -425,7 +425,7 @@ describe RuboCop::Cop::FormulaAudit::Miscellaneous do url 'https://brew.sh/foo-1.0.tgz' test do version = MACOS_VERSION - ^^^^^^^^^^^^^ Use MacOS.version instead of MACOS_VERSION + ^^^^^^^^^^^^^ FormulaAudit/Miscellaneous: Use MacOS.version instead of MACOS_VERSION end end RUBY @@ -437,7 +437,7 @@ describe RuboCop::Cop::FormulaAudit::Miscellaneous do desc "foo" url 'https://brew.sh/foo-1.0.tgz' depends_on "foo" if build.with? "foo" - ^^^^^^^^^^^^^^^^ Replace depends_on "foo" if build.with? "foo" with depends_on "foo" => :optional + ^^^^^^^^^^^^^^^^ FormulaAudit/Miscellaneous: Replace depends_on "foo" if build.with? "foo" with depends_on "foo" => :optional end RUBY end @@ -448,7 +448,7 @@ describe RuboCop::Cop::FormulaAudit::Miscellaneous do desc "foo" url 'https://brew.sh/foo-1.0.tgz' depends_on :foo unless build.without? "foo" - ^^^^^^^^^^^^^^^ Replace depends_on :foo unless build.without? "foo" with depends_on :foo => :recommended + ^^^^^^^^^^^^^^^ FormulaAudit/Miscellaneous: Replace depends_on :foo unless build.without? "foo" with depends_on :foo => :recommended end RUBY end @@ -459,7 +459,7 @@ describe RuboCop::Cop::FormulaAudit::Miscellaneous do desc "foo" url 'https://brew.sh/foo-1.0.tgz' depends_on :foo unless build.include? "without-foo" - ^^^^^^^^^^^^^^^ Replace depends_on :foo unless build.include? "without-foo" with depends_on :foo => :recommended + ^^^^^^^^^^^^^^^ FormulaAudit/Miscellaneous: Replace depends_on :foo unless build.include? "without-foo" with depends_on :foo => :recommended end RUBY end diff --git a/Library/Homebrew/test/rubocops/text/mpi_check_spec.rb b/Library/Homebrew/test/rubocops/text/mpi_check_spec.rb index 56c944c2d0..c3986fdc40 100644 --- a/Library/Homebrew/test/rubocops/text/mpi_check_spec.rb +++ b/Library/Homebrew/test/rubocops/text/mpi_check_spec.rb @@ -13,7 +13,7 @@ describe RuboCop::Cop::FormulaAudit::MpiCheck do desc "foo" url 'https://brew.sh/foo-1.0.tgz' depends_on "mpich" - ^^^^^^^^^^^^^^^^^^ Formulae in homebrew/core should use 'depends_on "open-mpi"' instead of 'depends_on "mpich"'. + ^^^^^^^^^^^^^^^^^^ FormulaAudit/MpiCheck: Formulae in homebrew/core should use 'depends_on "open-mpi"' instead of 'depends_on "mpich"'. end RUBY diff --git a/Library/Homebrew/test/rubocops/text/on_system_conditionals_spec.rb b/Library/Homebrew/test/rubocops/text/on_system_conditionals_spec.rb index 24ed0a1e86..4172932c65 100644 --- a/Library/Homebrew/test/rubocops/text/on_system_conditionals_spec.rb +++ b/Library/Homebrew/test/rubocops/text/on_system_conditionals_spec.rb @@ -12,7 +12,7 @@ describe RuboCop::Cop::FormulaAudit::OnSystemConditionals do class Foo < Formula desc "foo" if OS.linux? - ^^^^^^^^^^^^ Don't use `if OS.linux?`, use `on_linux do` instead. + ^^^^^^^^^^^^ FormulaAudit/OnSystemConditionals: Don't use `if OS.linux?`, use `on_linux do` instead. url 'https://brew.sh/linux-1.0.tgz' else url 'https://brew.sh/linux-1.0.tgz' @@ -38,7 +38,7 @@ describe RuboCop::Cop::FormulaAudit::OnSystemConditionals do class Foo < Formula desc "foo" if OS.mac? - ^^^^^^^^^^ Don't use `if OS.mac?`, use `on_macos do` instead. + ^^^^^^^^^^ FormulaAudit/OnSystemConditionals: Don't use `if OS.mac?`, use `on_macos do` instead. url 'https://brew.sh/mac-1.0.tgz' else url 'https://brew.sh/linux-1.0.tgz' @@ -67,7 +67,7 @@ describe RuboCop::Cop::FormulaAudit::OnSystemConditionals do def install on_macos do - ^^^^^^^^ Don't use `on_macos` in `def install`, use `if OS.mac?` instead. + ^^^^^^^^ FormulaAudit/OnSystemConditionals: Don't use `on_macos` in `def install`, use `if OS.mac?` instead. true end end @@ -96,7 +96,7 @@ describe RuboCop::Cop::FormulaAudit::OnSystemConditionals do def install on_linux do - ^^^^^^^^ Don't use `on_linux` in `def install`, use `if OS.linux?` instead. + ^^^^^^^^ FormulaAudit/OnSystemConditionals: Don't use `on_linux` in `def install`, use `if OS.linux?` instead. true end end @@ -125,7 +125,7 @@ describe RuboCop::Cop::FormulaAudit::OnSystemConditionals do test do on_macos do - ^^^^^^^^ Don't use `on_macos` in `test do`, use `if OS.mac?` instead. + ^^^^^^^^ FormulaAudit/OnSystemConditionals: Don't use `on_macos` in `test do`, use `if OS.mac?` instead. true end end @@ -153,7 +153,7 @@ describe RuboCop::Cop::FormulaAudit::OnSystemConditionals do class Foo < Formula desc "foo" if Hardware::CPU.arm? - ^^^^^^^^^^^^^^^^^^^^^ Don't use `if Hardware::CPU.arm?`, use `on_arm do` instead. + ^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/OnSystemConditionals: Don't use `if Hardware::CPU.arm?`, use `on_arm do` instead. url 'https://brew.sh/linux-1.0.tgz' else url 'https://brew.sh/linux-1.0.tgz' @@ -179,7 +179,7 @@ describe RuboCop::Cop::FormulaAudit::OnSystemConditionals do class Foo < Formula desc "foo" if Hardware::CPU.intel? - ^^^^^^^^^^^^^^^^^^^^^^^ Don't use `if Hardware::CPU.intel?`, use `on_intel do` instead. + ^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/OnSystemConditionals: Don't use `if Hardware::CPU.intel?`, use `on_intel do` instead. url 'https://brew.sh/mac-1.0.tgz' else url 'https://brew.sh/linux-1.0.tgz' @@ -208,7 +208,7 @@ describe RuboCop::Cop::FormulaAudit::OnSystemConditionals do def install on_intel do - ^^^^^^^^ Don't use `on_intel` in `def install`, use `if Hardware::CPU.intel?` instead. + ^^^^^^^^ FormulaAudit/OnSystemConditionals: Don't use `on_intel` in `def install`, use `if Hardware::CPU.intel?` instead. true end end @@ -237,7 +237,7 @@ describe RuboCop::Cop::FormulaAudit::OnSystemConditionals do def install on_arm do - ^^^^^^ Don't use `on_arm` in `def install`, use `if Hardware::CPU.arm?` instead. + ^^^^^^ FormulaAudit/OnSystemConditionals: Don't use `on_arm` in `def install`, use `if Hardware::CPU.arm?` instead. true end end @@ -266,7 +266,7 @@ describe RuboCop::Cop::FormulaAudit::OnSystemConditionals do test do on_intel do - ^^^^^^^^ Don't use `on_intel` in `test do`, use `if Hardware::CPU.intel?` instead. + ^^^^^^^^ FormulaAudit/OnSystemConditionals: Don't use `on_intel` in `test do`, use `if Hardware::CPU.intel?` instead. true end end @@ -294,7 +294,7 @@ describe RuboCop::Cop::FormulaAudit::OnSystemConditionals do class Foo < Formula desc "foo" if MacOS.version == :monterey - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Don't use `if MacOS.version == :monterey`, use `on_monterey do` instead. + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/OnSystemConditionals: Don't use `if MacOS.version == :monterey`, use `on_monterey do` instead. url 'https://brew.sh/linux-1.0.tgz' end end @@ -315,7 +315,7 @@ describe RuboCop::Cop::FormulaAudit::OnSystemConditionals do class Foo < Formula desc "foo" if MacOS.version <= :monterey - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Don't use `if MacOS.version <= :monterey`, use `on_system :linux, macos: :monterey_or_older do` instead. + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/OnSystemConditionals: Don't use `if MacOS.version <= :monterey`, use `on_system :linux, macos: :monterey_or_older do` instead. url 'https://brew.sh/mac-1.0.tgz' end end @@ -336,7 +336,7 @@ describe RuboCop::Cop::FormulaAudit::OnSystemConditionals do class Foo < Formula desc "foo" if MacOS.version < :monterey - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Don't use `if MacOS.version < :monterey`, use `on_system do` instead. + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/OnSystemConditionals: Don't use `if MacOS.version < :monterey`, use `on_system do` instead. url 'https://brew.sh/mac-1.0.tgz' end end @@ -348,7 +348,7 @@ describe RuboCop::Cop::FormulaAudit::OnSystemConditionals do class Foo < Formula desc "foo" if MacOS.version >= :monterey - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Don't use `if MacOS.version >= :monterey`, use `on_monterey :or_newer do` instead. + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/OnSystemConditionals: Don't use `if MacOS.version >= :monterey`, use `on_monterey :or_newer do` instead. url 'https://brew.sh/mac-1.0.tgz' else url 'https://brew.sh/linux-1.0.tgz' @@ -362,7 +362,7 @@ describe RuboCop::Cop::FormulaAudit::OnSystemConditionals do class Foo < Formula desc "foo" if MacOS.version > :monterey - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Don't use `if MacOS.version > :monterey`, use `on_monterey do` instead. + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/OnSystemConditionals: Don't use `if MacOS.version > :monterey`, use `on_monterey do` instead. url 'https://brew.sh/mac-1.0.tgz' end end @@ -377,7 +377,7 @@ describe RuboCop::Cop::FormulaAudit::OnSystemConditionals do def install on_monterey do - ^^^^^^^^^^^ Don't use `on_monterey` in `def install`, use `if MacOS.version == :monterey` instead. + ^^^^^^^^^^^ FormulaAudit/OnSystemConditionals: Don't use `on_monterey` in `def install`, use `if MacOS.version == :monterey` instead. true end end @@ -406,7 +406,7 @@ describe RuboCop::Cop::FormulaAudit::OnSystemConditionals do def install on_monterey :or_older do - ^^^^^^^^^^^^^^^^^^^^^ Don't use `on_monterey :or_older` in `def install`, use `if MacOS.version <= :monterey` instead. + ^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/OnSystemConditionals: Don't use `on_monterey :or_older` in `def install`, use `if MacOS.version <= :monterey` instead. true end end @@ -435,7 +435,7 @@ describe RuboCop::Cop::FormulaAudit::OnSystemConditionals do def install on_monterey :or_newer do - ^^^^^^^^^^^^^^^^^^^^^ Don't use `on_monterey :or_newer` in `def install`, use `if MacOS.version >= :monterey` instead. + ^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/OnSystemConditionals: Don't use `on_monterey :or_newer` in `def install`, use `if MacOS.version >= :monterey` instead. true end end @@ -464,7 +464,7 @@ describe RuboCop::Cop::FormulaAudit::OnSystemConditionals do def install on_system :linux, macos: :monterey_or_newer do - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Don't use `on_system :linux, macos: :monterey_or_newer` in `def install`, use `if OS.linux? || MacOS.version >= :monterey` instead. + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/OnSystemConditionals: Don't use `on_system :linux, macos: :monterey_or_newer` in `def install`, use `if OS.linux? || MacOS.version >= :monterey` instead. true end end @@ -493,7 +493,7 @@ describe RuboCop::Cop::FormulaAudit::OnSystemConditionals do test do on_monterey do - ^^^^^^^^^^^ Don't use `on_monterey` in `test do`, use `if MacOS.version == :monterey` instead. + ^^^^^^^^^^^ FormulaAudit/OnSystemConditionals: Don't use `on_monterey` in `test do`, use `if MacOS.version == :monterey` instead. true end end @@ -522,7 +522,7 @@ describe RuboCop::Cop::FormulaAudit::OnSystemConditionals do test do on_system :linux, macos: :monterey do - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Don't use `on_system :linux, macos: :monterey` in `test do`, use `if OS.linux? || MacOS.version == :monterey` instead. + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/OnSystemConditionals: Don't use `on_system :linux, macos: :monterey` in `test do`, use `if OS.linux? || MacOS.version == :monterey` instead. true end end diff --git a/Library/Homebrew/test/rubocops/text/option_declarations_spec.rb b/Library/Homebrew/test/rubocops/text/option_declarations_spec.rb index 446dc60b22..13257dd7e9 100644 --- a/Library/Homebrew/test/rubocops/text/option_declarations_spec.rb +++ b/Library/Homebrew/test/rubocops/text/option_declarations_spec.rb @@ -14,7 +14,7 @@ describe RuboCop::Cop::FormulaAudit::OptionDeclarations do url 'https://brew.sh/foo-1.0.tgz' def install build.without? "bar" - ^^^^^^^^^^^^^^^^^^^^ Formulae in homebrew/core should not use `build.without?`. + ^^^^^^^^^^^^^^^^^^^^ FormulaAudit/OptionDeclarations: Formulae in homebrew/core should not use `build.without?`. end end RUBY @@ -27,7 +27,7 @@ describe RuboCop::Cop::FormulaAudit::OptionDeclarations do url 'https://brew.sh/foo-1.0.tgz' def install build.with? "bar" - ^^^^^^^^^^^^^^^^^ Formulae in homebrew/core should not use `build.with?`. + ^^^^^^^^^^^^^^^^^ FormulaAudit/OptionDeclarations: Formulae in homebrew/core should not use `build.with?`. end end RUBY @@ -37,7 +37,7 @@ describe RuboCop::Cop::FormulaAudit::OptionDeclarations do expect_offense(<<~RUBY) class Foo < Formula depends_on "bar" if build.without?("baz") - ^^^^^^^^^^^^^^^^^^^^^ Use `:optional` or `:recommended` instead of `if build.without?("baz")` + ^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/OptionDeclarations: Use `:optional` or `:recommended` instead of `if build.without?("baz")` end RUBY end @@ -46,7 +46,7 @@ describe RuboCop::Cop::FormulaAudit::OptionDeclarations do expect_offense(<<~RUBY) class Foo < Formula depends_on "bar" if build.with?("baz") - ^^^^^^^^^^^^^^^^^^ Use `:optional` or `:recommended` instead of `if build.with?("baz")` + ^^^^^^^^^^^^^^^^^^ FormulaAudit/OptionDeclarations: Use `:optional` or `:recommended` instead of `if build.with?("baz")` end RUBY end @@ -58,7 +58,7 @@ describe RuboCop::Cop::FormulaAudit::OptionDeclarations do url 'https://brew.sh/foo-1.0.tgz' def post_install return unless build.without? "bar" - ^^^^^^^^^^^^^^^^^^^^ Use if build.with? "bar" instead of unless build.without? "bar" + ^^^^^^^^^^^^^^^^^^^^ FormulaAudit/OptionDeclarations: Use if build.with? "bar" instead of unless build.without? "bar" end end RUBY @@ -71,7 +71,7 @@ describe RuboCop::Cop::FormulaAudit::OptionDeclarations do url 'https://brew.sh/foo-1.0.tgz' def post_install return unless build.with? "bar" - ^^^^^^^^^^^^^^^^^ Use if build.without? "bar" instead of unless build.with? "bar" + ^^^^^^^^^^^^^^^^^ FormulaAudit/OptionDeclarations: Use if build.without? "bar" instead of unless build.with? "bar" end end RUBY @@ -84,7 +84,7 @@ describe RuboCop::Cop::FormulaAudit::OptionDeclarations do url 'https://brew.sh/foo-1.0.tgz' def post_install return if !build.with? "bar" - ^^^^^^^^^^^^^^^^^^ Don't negate 'build.with?': use 'build.without?' + ^^^^^^^^^^^^^^^^^^ FormulaAudit/OptionDeclarations: Don't negate 'build.with?': use 'build.without?' end end RUBY @@ -97,7 +97,7 @@ describe RuboCop::Cop::FormulaAudit::OptionDeclarations do url 'https://brew.sh/foo-1.0.tgz' def post_install return if !build.without? "bar" - ^^^^^^^^^^^^^^^^^^^^^ Don't negate 'build.without?': use 'build.with?' + ^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/OptionDeclarations: Don't negate 'build.without?': use 'build.with?' end end RUBY @@ -110,7 +110,7 @@ describe RuboCop::Cop::FormulaAudit::OptionDeclarations do url 'https://brew.sh/foo-1.0.tgz' def post_install return if build.without? "--without-bar" - ^^^^^^^^^^^^^^^ Don't duplicate 'without': Use `build.without? "bar"` to check for "--without-bar" + ^^^^^^^^^^^^^^^ FormulaAudit/OptionDeclarations: Don't duplicate 'without': Use `build.without? "bar"` to check for "--without-bar" end end RUBY @@ -123,7 +123,7 @@ describe RuboCop::Cop::FormulaAudit::OptionDeclarations do url 'https://brew.sh/foo-1.0.tgz' def post_install return if build.with? "--with-bar" - ^^^^^^^^^^^^ Don't duplicate 'with': Use `build.with? "bar"` to check for "--with-bar" + ^^^^^^^^^^^^ FormulaAudit/OptionDeclarations: Don't duplicate 'with': Use `build.with? "bar"` to check for "--with-bar" end end RUBY @@ -136,7 +136,7 @@ describe RuboCop::Cop::FormulaAudit::OptionDeclarations do url 'https://brew.sh/foo-1.0.tgz' def post_install return if build.include? "foo" - ^^^^^^^^^^^^^^^^^^^^ `build.include?` is deprecated + ^^^^^^^^^^^^^^^^^^^^ FormulaAudit/OptionDeclarations: `build.include?` is deprecated end end RUBY @@ -149,7 +149,7 @@ describe RuboCop::Cop::FormulaAudit::OptionDeclarations do url 'https://brew.sh/foo-1.0.tgz' def options - ^^^^^^^^^^^ Use new-style option definitions + ^^^^^^^^^^^ FormulaAudit/OptionDeclarations: Use new-style option definitions [["--bar", "desc"]] end end diff --git a/Library/Homebrew/test/rubocops/text/python_versions_spec.rb b/Library/Homebrew/test/rubocops/text/python_versions_spec.rb index 372e4d9598..14d6d1be2e 100644 --- a/Library/Homebrew/test/rubocops/text/python_versions_spec.rb +++ b/Library/Homebrew/test/rubocops/text/python_versions_spec.rb @@ -96,7 +96,7 @@ describe RuboCop::Cop::FormulaAudit::PythonVersions do def install puts "python@3.8" - ^^^^^^^^^^^^ References to `python@3.8` should match the specified python dependency (`python@3.9`) + ^^^^^^^^^^^^ FormulaAudit/PythonVersions: References to `python@3.8` should match the specified python dependency (`python@3.9`) end end RUBY @@ -119,7 +119,7 @@ describe RuboCop::Cop::FormulaAudit::PythonVersions do def install puts "python3.8" - ^^^^^^^^^^^ References to `python3.8` should match the specified python dependency (`python3.9`) + ^^^^^^^^^^^ FormulaAudit/PythonVersions: References to `python3.8` should match the specified python dependency (`python3.9`) end end RUBY @@ -142,7 +142,7 @@ describe RuboCop::Cop::FormulaAudit::PythonVersions do def install puts "python@3.10" - ^^^^^^^^^^^^^ References to `python@3.10` should match the specified python dependency (`python@3.11`) + ^^^^^^^^^^^^^ FormulaAudit/PythonVersions: References to `python@3.10` should match the specified python dependency (`python@3.11`) end end RUBY @@ -165,7 +165,7 @@ describe RuboCop::Cop::FormulaAudit::PythonVersions do def install puts "python3.10" - ^^^^^^^^^^^^ References to `python3.10` should match the specified python dependency (`python3.11`) + ^^^^^^^^^^^^ FormulaAudit/PythonVersions: References to `python3.10` should match the specified python dependency (`python3.11`) end end RUBY diff --git a/Library/Homebrew/test/rubocops/text/safe_popen_commands_spec.rb b/Library/Homebrew/test/rubocops/text/safe_popen_commands_spec.rb index 156c186a06..3ec64167ba 100644 --- a/Library/Homebrew/test/rubocops/text/safe_popen_commands_spec.rb +++ b/Library/Homebrew/test/rubocops/text/safe_popen_commands_spec.rb @@ -12,7 +12,7 @@ describe RuboCop::Cop::FormulaAudit::SafePopenCommands do class Foo < Formula def install Utils.popen_read "foo" - ^^^^^^^^^^^^^^^^^^^^^^ Use `Utils.safe_popen_read` instead of `Utils.popen_read` + ^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/SafePopenCommands: Use `Utils.safe_popen_read` instead of `Utils.popen_read` end end RUBY @@ -31,7 +31,7 @@ describe RuboCop::Cop::FormulaAudit::SafePopenCommands do class Foo < Formula def install Utils.popen_write "foo" - ^^^^^^^^^^^^^^^^^^^^^^^ Use `Utils.safe_popen_write` instead of `Utils.popen_write` + ^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/SafePopenCommands: Use `Utils.safe_popen_write` instead of `Utils.popen_write` end end RUBY diff --git a/Library/Homebrew/test/rubocops/text/shell_variables_spec.rb b/Library/Homebrew/test/rubocops/text/shell_variables_spec.rb index c10bcb26f4..2c8a274794 100644 --- a/Library/Homebrew/test/rubocops/text/shell_variables_spec.rb +++ b/Library/Homebrew/test/rubocops/text/shell_variables_spec.rb @@ -12,7 +12,7 @@ describe RuboCop::Cop::FormulaAudit::ShellVariables do class Foo < Formula def install Utils.popen "SHELL=bash foo" - ^^^^^^^^^^^^^^^^ Use `Utils.popen({ "SHELL" => "bash" }, "foo")` instead of `Utils.popen "SHELL=bash foo"` + ^^^^^^^^^^^^^^^^ FormulaAudit/ShellVariables: Use `Utils.popen({ "SHELL" => "bash" }, "foo")` instead of `Utils.popen "SHELL=bash foo"` end end RUBY @@ -31,7 +31,7 @@ describe RuboCop::Cop::FormulaAudit::ShellVariables do class Foo < Formula def install Utils.safe_popen_read "SHELL=bash foo" - ^^^^^^^^^^^^^^^^ Use `Utils.safe_popen_read({ "SHELL" => "bash" }, "foo")` instead of `Utils.safe_popen_read "SHELL=bash foo"` + ^^^^^^^^^^^^^^^^ FormulaAudit/ShellVariables: Use `Utils.safe_popen_read({ "SHELL" => "bash" }, "foo")` instead of `Utils.safe_popen_read "SHELL=bash foo"` end end RUBY @@ -50,7 +50,7 @@ describe RuboCop::Cop::FormulaAudit::ShellVariables do class Foo < Formula def install Utils.safe_popen_write "SHELL=bash foo" - ^^^^^^^^^^^^^^^^ Use `Utils.safe_popen_write({ "SHELL" => "bash" }, "foo")` instead of `Utils.safe_popen_write "SHELL=bash foo"` + ^^^^^^^^^^^^^^^^ FormulaAudit/ShellVariables: Use `Utils.safe_popen_write({ "SHELL" => "bash" }, "foo")` instead of `Utils.safe_popen_write "SHELL=bash foo"` end end RUBY @@ -69,7 +69,7 @@ describe RuboCop::Cop::FormulaAudit::ShellVariables do class Foo < Formula def install Utils.popen "SHELL=bash \#{bin}/foo" - ^^^^^^^^^^^^^^^^^^^^^^^ Use `Utils.popen({ "SHELL" => "bash" }, "\#{bin}/foo")` instead of `Utils.popen "SHELL=bash \#{bin}/foo"` + ^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/ShellVariables: Use `Utils.popen({ "SHELL" => "bash" }, "\#{bin}/foo")` instead of `Utils.popen "SHELL=bash \#{bin}/foo"` end end RUBY diff --git a/Library/Homebrew/test/rubocops/text/strict_spec.rb b/Library/Homebrew/test/rubocops/text/strict_spec.rb index f2ebfaedb7..4a48d1dc69 100644 --- a/Library/Homebrew/test/rubocops/text/strict_spec.rb +++ b/Library/Homebrew/test/rubocops/text/strict_spec.rb @@ -13,7 +13,7 @@ describe RuboCop::Cop::FormulaAuditStrict::Text do url "https://brew.sh/foo-1.0.tgz" env :userpaths - ^^^^^^^^^^^^^^ `env :userpaths` in homebrew/core formulae is deprecated + ^^^^^^^^^^^^^^ FormulaAuditStrict/Text: `env :userpaths` in homebrew/core formulae is deprecated end RUBY end @@ -24,7 +24,7 @@ describe RuboCop::Cop::FormulaAuditStrict::Text do url "https://brew.sh/foo-1.0.tgz" env :std - ^^^^^^^^ `env :std` in homebrew/core formulae is deprecated + ^^^^^^^^ FormulaAuditStrict/Text: `env :std` in homebrew/core formulae is deprecated end RUBY end @@ -34,7 +34,7 @@ describe RuboCop::Cop::FormulaAuditStrict::Text do class Foo < Formula def install ohai "\#{share}/foo" - ^^^^^^^^^^^^^^ Use `\#{pkgshare}` instead of `\#{share}/foo` + ^^^^^^^^^^^^^^ FormulaAuditStrict/Text: Use `\#{pkgshare}` instead of `\#{share}/foo` end end RUBY @@ -43,7 +43,7 @@ describe RuboCop::Cop::FormulaAuditStrict::Text do class Foo < Formula def install ohai "\#{share}/foo/bar" - ^^^^^^^^^^^^^^^^^^ Use `\#{pkgshare}` instead of `\#{share}/foo` + ^^^^^^^^^^^^^^^^^^ FormulaAuditStrict/Text: Use `\#{pkgshare}` instead of `\#{share}/foo` end end RUBY @@ -52,7 +52,7 @@ describe RuboCop::Cop::FormulaAuditStrict::Text do class Foolibcxx < Formula def install ohai "\#{share}/foolibc++" - ^^^^^^^^^^^^^^^^^^^^ Use `\#{pkgshare}` instead of `\#{share}/foolibc++` + ^^^^^^^^^^^^^^^^^^^^ FormulaAuditStrict/Text: Use `\#{pkgshare}` instead of `\#{share}/foolibc++` end end RUBY @@ -63,7 +63,7 @@ describe RuboCop::Cop::FormulaAuditStrict::Text do class Foo < Formula def install ohai share/"foo" - ^^^^^^^^^^^ Use `pkgshare` instead of `share/"foo"` + ^^^^^^^^^^^ FormulaAuditStrict/Text: Use `pkgshare` instead of `share/"foo"` end end RUBY @@ -72,7 +72,7 @@ describe RuboCop::Cop::FormulaAuditStrict::Text do class Foo < Formula def install ohai share/"foo/bar" - ^^^^^^^^^^^^^^^ Use `pkgshare` instead of `share/"foo"` + ^^^^^^^^^^^^^^^ FormulaAuditStrict/Text: Use `pkgshare` instead of `share/"foo"` end end RUBY @@ -81,7 +81,7 @@ describe RuboCop::Cop::FormulaAuditStrict::Text do class Foolibcxx < Formula def install ohai share/"foolibc++" - ^^^^^^^^^^^^^^^^^ Use `pkgshare` instead of `share/"foolibc++"` + ^^^^^^^^^^^^^^^^^ FormulaAuditStrict/Text: Use `pkgshare` instead of `share/"foolibc++"` end end RUBY diff --git a/Library/Homebrew/test/rubocops/text_spec.rb b/Library/Homebrew/test/rubocops/text_spec.rb index bd6e48ab26..22e5327bdc 100644 --- a/Library/Homebrew/test/rubocops/text_spec.rb +++ b/Library/Homebrew/test/rubocops/text_spec.rb @@ -10,7 +10,7 @@ describe RuboCop::Cop::FormulaAudit::Text do it 'reports an offense if `require "formula"` is present' do expect_offense(<<~RUBY) require "formula" - ^^^^^^^^^^^^^^^^^ `require "formula"` is now unnecessary + ^^^^^^^^^^^^^^^^^ FormulaAudit/Text: `require "formula"` is now unnecessary class Foo < Formula url "https://brew.sh/foo-1.0.tgz" homepage "https://brew.sh" @@ -33,7 +33,7 @@ describe RuboCop::Cop::FormulaAudit::Text do depends_on "openssl" depends_on "libressl" => :optional - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Formulae should not depend on both OpenSSL and LibreSSL (even optionally). + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/Text: Formulae should not depend on both OpenSSL and LibreSSL (even optionally). end RUBY @@ -44,7 +44,7 @@ describe RuboCop::Cop::FormulaAudit::Text do depends_on "openssl" depends_on "libressl" - ^^^^^^^^^^^^^^^^^^^^^ Formulae should not depend on both OpenSSL and LibreSSL (even optionally). + ^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/Text: Formulae should not depend on both OpenSSL and LibreSSL (even optionally). end RUBY end @@ -55,7 +55,7 @@ describe RuboCop::Cop::FormulaAudit::Text do url "https://brew.sh/foo-1.0.tgz" homepage "https://brew.sh" depends_on "veclibfort" - ^^^^^^^^^^^^^^^^^^^^^^^ Formulae in homebrew/core should use OpenBLAS as the default serial linear algebra library. + ^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/Text: Formulae in homebrew/core should use OpenBLAS as the default serial linear algebra library. end RUBY end @@ -66,7 +66,7 @@ describe RuboCop::Cop::FormulaAudit::Text do url "https://brew.sh/foo-1.0.tgz" homepage "https://brew.sh" depends_on "lapack" - ^^^^^^^^^^^^^^^^^^^ Formulae in homebrew/core should use OpenBLAS as the default serial linear algebra library. + ^^^^^^^^^^^^^^^^^^^ FormulaAudit/Text: Formulae in homebrew/core should use OpenBLAS as the default serial linear algebra library. end RUBY end @@ -79,7 +79,7 @@ describe RuboCop::Cop::FormulaAudit::Text do def install system "go", "get", "bar" - ^^^^^^^^^^^^^^^^^^^^^^^^^ Do not use `go get`. Please ask upstream to implement Go vendoring + ^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/Text: Do not use `go get`. Please ask upstream to implement Go vendoring end end RUBY @@ -93,7 +93,7 @@ describe RuboCop::Cop::FormulaAudit::Text do def install system "xcodebuild", "foo", "bar" - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ use "xcodebuild *args" instead of "system 'xcodebuild', *args" + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/Text: use "xcodebuild *args" instead of "system 'xcodebuild', *args" end end RUBY @@ -107,11 +107,11 @@ describe RuboCop::Cop::FormulaAudit::Text do def install system "xcodebuild", "foo", "bar" - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ use "xcodebuild *args" instead of "system 'xcodebuild', *args" + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/Text: use "xcodebuild *args" instead of "system 'xcodebuild', *args" end def plist - ^^^^^^^^^ Please set plist_options when using a formula-defined plist. + ^^^^^^^^^ FormulaAudit/Text: Please set plist_options when using a formula-defined plist. <<~XML @@ -130,7 +130,7 @@ describe RuboCop::Cop::FormulaAudit::Text do it 'reports an offense if `require "language/go"` is present' do expect_offense(<<~RUBY) require "language/go" - ^^^^^^^^^^^^^^^^^^^^^ require "language/go" is unnecessary unless using `go_resource`s + ^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/Text: require "language/go" is unnecessary unless using `go_resource`s class Foo < Formula url "https://brew.sh/foo-1.0.tgz" @@ -138,7 +138,7 @@ describe RuboCop::Cop::FormulaAudit::Text do def install system "go", "get", "bar" - ^^^^^^^^^^^^^^^^^^^^^^^^^ Do not use `go get`. Please ask upstream to implement Go vendoring + ^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/Text: Do not use `go get`. Please ask upstream to implement Go vendoring end end RUBY @@ -152,7 +152,7 @@ describe RuboCop::Cop::FormulaAudit::Text do def install Formula.factory(name) - ^^^^^^^^^^^^^^^^^^^^^ "Formula.factory(name)" is deprecated in favor of "Formula[name]" + ^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/Text: "Formula.factory(name)" is deprecated in favor of "Formula[name]" end end RUBY @@ -166,7 +166,7 @@ describe RuboCop::Cop::FormulaAudit::Text do def install system "dep", "ensure" - ^^^^^^^^^^^^^^^^^^^^^^ use "dep", "ensure", "-vendor-only" + ^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/Text: use "dep", "ensure", "-vendor-only" end end RUBY @@ -180,7 +180,7 @@ describe RuboCop::Cop::FormulaAudit::Text do def install system "cargo", "build" - ^^^^^^^^^^^^^^^^^^^^^^^ use "cargo", "install", *std_cargo_args + ^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/Text: use "cargo", "install", *std_cargo_args end end RUBY @@ -204,7 +204,7 @@ describe RuboCop::Cop::FormulaAudit::Text do class Foo < Formula def install system "make && make install" - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Use separate `make` calls + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/Text: Use separate `make` calls end end RUBY @@ -215,7 +215,7 @@ describe RuboCop::Cop::FormulaAudit::Text do class Foo < Formula def install ohai "foo \#{bar + "baz"}" - ^^^^^^^^^^^^^^ Do not concatenate paths in string interpolation + ^^^^^^^^^^^^^^ FormulaAudit/Text: Do not concatenate paths in string interpolation end end RUBY @@ -226,7 +226,7 @@ describe RuboCop::Cop::FormulaAudit::Text do class Foo < Formula def install ohai prefix + "bin" - ^^^^^^^^^^^^^^ Use `bin` instead of `prefix + "bin"` + ^^^^^^^^^^^^^^ FormulaAudit/Text: Use `bin` instead of `prefix + "bin"` end end RUBY @@ -235,7 +235,7 @@ describe RuboCop::Cop::FormulaAudit::Text do class Foo < Formula def install ohai prefix + "bin/foo" - ^^^^^^^^^^^^^^^^^^ Use `bin` instead of `prefix + "bin"` + ^^^^^^^^^^^^^^^^^^ FormulaAudit/Text: Use `bin` instead of `prefix + "bin"` end end RUBY diff --git a/Library/Homebrew/test/rubocops/urls/git_spec.rb b/Library/Homebrew/test/rubocops/urls/git_spec.rb index a4f77f45db..319e5b4e01 100644 --- a/Library/Homebrew/test/rubocops/urls/git_spec.rb +++ b/Library/Homebrew/test/rubocops/urls/git_spec.rb @@ -56,7 +56,7 @@ describe RuboCop::Cop::FormulaAudit::GitUrls do class Foo < Formula desc "foo" url "https://github.com/foo/bar.git", - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Formulae in homebrew/core should specify a revision for git URLs + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/GitUrls: Formulae in homebrew/core should specify a revision for git URLs tag: "v1.0.0" end RUBY @@ -67,7 +67,7 @@ describe RuboCop::Cop::FormulaAudit::GitUrls do class Foo < Formula desc "foo" url "https://github.com/foo/bar.git", - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Formulae in homebrew/core should specify a revision for git URLs + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/GitUrls: Formulae in homebrew/core should specify a revision for git URLs shallow: false, tag: "v1.0.0" end diff --git a/Library/Homebrew/test/rubocops/urls/git_strict_spec.rb b/Library/Homebrew/test/rubocops/urls/git_strict_spec.rb index d5fc0cc251..3451c18aa8 100644 --- a/Library/Homebrew/test/rubocops/urls/git_strict_spec.rb +++ b/Library/Homebrew/test/rubocops/urls/git_strict_spec.rb @@ -47,7 +47,7 @@ describe RuboCop::Cop::FormulaAuditStrict::GitUrls do class Foo < Formula desc "foo" url "https://github.com/foo/bar.git", - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Formulae in homebrew/core should specify a tag for git URLs + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAuditStrict/GitUrls: Formulae in homebrew/core should specify a tag for git URLs revision: "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" end RUBY @@ -58,7 +58,7 @@ describe RuboCop::Cop::FormulaAuditStrict::GitUrls do class Foo < Formula desc "foo" url "https://github.com/foo/bar.git", - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Formulae in homebrew/core should specify a tag for git URLs + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAuditStrict/GitUrls: Formulae in homebrew/core should specify a tag for git URLs revision: "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", shallow: false end diff --git a/Library/Homebrew/test/rubocops/urls/pypi_spec.rb b/Library/Homebrew/test/rubocops/urls/pypi_spec.rb index 516a616d01..50ac8ea8f2 100644 --- a/Library/Homebrew/test/rubocops/urls/pypi_spec.rb +++ b/Library/Homebrew/test/rubocops/urls/pypi_spec.rb @@ -12,7 +12,7 @@ describe RuboCop::Cop::FormulaAudit::PyPiUrls do class Foo < Formula desc "foo" url "https://pypi.python.org/packages/source/foo/foo-0.1.tar.gz" - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ use the `Source` url found on PyPI downloads page (`https://pypi.org/project/foo/#files`) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/PyPiUrls: use the `Source` url found on PyPI downloads page (`https://pypi.org/project/foo/#files`) end RUBY end @@ -22,7 +22,7 @@ describe RuboCop::Cop::FormulaAudit::PyPiUrls do class Foo < Formula desc "foo" url "https://files.pythonhosted.org/packages/source/f/foo/foo-0.1.tar.gz" - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ use the `Source` url found on PyPI downloads page (`https://pypi.org/project/foo/#files`) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/PyPiUrls: use the `Source` url found on PyPI downloads page (`https://pypi.org/project/foo/#files`) end RUBY end diff --git a/Library/Homebrew/test/rubocops/urls_spec.rb b/Library/Homebrew/test/rubocops/urls_spec.rb index e9fe82409b..058dd2abae 100644 --- a/Library/Homebrew/test/rubocops/urls_spec.rb +++ b/Library/Homebrew/test/rubocops/urls_spec.rb @@ -194,7 +194,7 @@ describe RuboCop::Cop::FormulaAudit::Urls do url "#{offense_info["url"]}" end RUBY - expected_offenses = [{ message: offense_info["msg"], + expected_offenses = [{ message: "FormulaAudit/Urls: #{offense_info["msg"]}", severity: :convention, line: 3, column: offense_info["col"], @@ -219,7 +219,7 @@ describe RuboCop::Cop::FormulaAudit::Urls do stable do url "git://github.com/foo.git", - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Please use https:// for git://github.com/foo.git + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/Urls: Please use https:// for git://github.com/foo.git :tag => "v1.0.1", :revision => "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" version "1.0.1" @@ -234,7 +234,7 @@ describe RuboCop::Cop::FormulaAudit::Urls do desc "foo" url "https://ftpmirror.fnu.org/foo/foo-1.0.tar.gz" mirror "https://ftpmirror.fnu.org/foo/foo-1.0.tar.gz" - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ URL should not be duplicated as a mirror: https://ftpmirror.fnu.org/foo/foo-1.0.tar.gz + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/Urls: URL should not be duplicated as a mirror: https://ftpmirror.fnu.org/foo/foo-1.0.tar.gz end RUBY end diff --git a/Library/Homebrew/test/rubocops/uses_from_macos_spec.rb b/Library/Homebrew/test/rubocops/uses_from_macos_spec.rb index 6a12800505..ba64ccda4d 100644 --- a/Library/Homebrew/test/rubocops/uses_from_macos_spec.rb +++ b/Library/Homebrew/test/rubocops/uses_from_macos_spec.rb @@ -13,7 +13,7 @@ describe RuboCop::Cop::FormulaAudit::UsesFromMacos do homepage "https://brew.sh" uses_from_macos "postgresql" - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `uses_from_macos` should only be used for macOS dependencies, not postgresql. + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/UsesFromMacos: `uses_from_macos` should only be used for macOS dependencies, not postgresql. end RUBY end diff --git a/Library/Homebrew/test/rubocops/version_spec.rb b/Library/Homebrew/test/rubocops/version_spec.rb index c055fed61f..e411abac50 100644 --- a/Library/Homebrew/test/rubocops/version_spec.rb +++ b/Library/Homebrew/test/rubocops/version_spec.rb @@ -12,7 +12,7 @@ describe RuboCop::Cop::FormulaAudit::Version do class Foo < Formula url 'https://brew.sh/foo-1.0.tgz' version "" - ^^^^^^^^^^ version is set to an empty string + ^^^^^^^^^^ FormulaAudit/Version: version is set to an empty string end RUBY end @@ -22,7 +22,7 @@ describe RuboCop::Cop::FormulaAudit::Version do class Foo < Formula url 'https://brew.sh/foo-1.0.tgz' version "v1.0" - ^^^^^^^^^^^^^^ version v1.0 should not have a leading 'v' + ^^^^^^^^^^^^^^ FormulaAudit/Version: version v1.0 should not have a leading 'v' end RUBY end @@ -32,7 +32,7 @@ describe RuboCop::Cop::FormulaAudit::Version do class Foo < Formula url 'https://brew.sh/foo-1.0.tgz' version "1_0" - ^^^^^^^^^^^^^ version 1_0 should not end with an underline and a number + ^^^^^^^^^^^^^ FormulaAudit/Version: version 1_0 should not end with an underline and a number end RUBY end