| 
									
										
										
										
											2019-04-19 15:38:03 +09:00
										 |  |  | # frozen_string_literal: true | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-10-26 19:41:14 +01:00
										 |  |  | require "rubocops/text" | 
					
						
							| 
									
										
										
										
											2017-05-24 00:08:31 +05:30
										 |  |  | 
 | 
					
						
							|  |  |  | describe RuboCop::Cop::FormulaAudit::Text do | 
					
						
							|  |  |  |   subject(:cop) { described_class.new } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-01-14 17:59:45 -08:00
										 |  |  |   context "when auditing formula text" do | 
					
						
							|  |  |  |     it 'reports an offense if `require "formula"` is present' do | 
					
						
							| 
									
										
										
										
											2020-07-06 10:26:21 -04:00
										 |  |  |       expect_offense(<<~RUBY) | 
					
						
							|  |  |  |         require "formula" | 
					
						
							| 
									
										
										
										
											2023-04-07 17:16:48 +01:00
										 |  |  |         ^^^^^^^^^^^^^^^^^ FormulaAudit/Text: `require "formula"` is now unnecessary | 
					
						
							| 
									
										
										
										
											2020-07-06 10:26:21 -04:00
										 |  |  |         class Foo < Formula | 
					
						
							|  |  |  |           url "https://brew.sh/foo-1.0.tgz" | 
					
						
							|  |  |  |           homepage "https://brew.sh" | 
					
						
							|  |  |  |         end | 
					
						
							|  |  |  |       RUBY | 
					
						
							| 
									
										
										
										
											2021-01-12 12:01:29 +11:00
										 |  |  | 
 | 
					
						
							|  |  |  |       expect_correction(<<~RUBY) | 
					
						
							|  |  |  |         class Foo < Formula | 
					
						
							|  |  |  |           url "https://brew.sh/foo-1.0.tgz" | 
					
						
							|  |  |  |           homepage "https://brew.sh" | 
					
						
							|  |  |  |         end | 
					
						
							|  |  |  |       RUBY | 
					
						
							| 
									
										
										
										
											2020-07-06 10:26:21 -04:00
										 |  |  |     end | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-10-04 23:28:30 +01:00
										 |  |  |     it "reports an offense if 'revision 0' is present" do | 
					
						
							|  |  |  |       expect_offense(<<~RUBY) | 
					
						
							|  |  |  |         class Foo < Formula | 
					
						
							|  |  |  |           url "https://brew.sh/foo-1.0.tgz" | 
					
						
							|  |  |  |           homepage "https://brew.sh" | 
					
						
							|  |  |  |           revision 0
 | 
					
						
							|  |  |  |           ^^^^^^^^^^ FormulaAudit/Text: "revision 0" is unnecessary | 
					
						
							|  |  |  |         end | 
					
						
							|  |  |  |       RUBY | 
					
						
							|  |  |  |     end | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-01-14 17:59:45 -08:00
										 |  |  |     it "reports an offense if both openssl and libressl are dependencies" do | 
					
						
							| 
									
										
										
										
											2017-10-21 03:12:50 +02:00
										 |  |  |       expect_offense(<<~RUBY) | 
					
						
							| 
									
										
										
										
											2017-08-06 14:48:39 +05:30
										 |  |  |         class Foo < Formula | 
					
						
							| 
									
										
										
										
											2018-11-28 20:51:55 +01:00
										 |  |  |           url "https://brew.sh/foo-1.0.tgz" | 
					
						
							|  |  |  |           homepage "https://brew.sh" | 
					
						
							| 
									
										
										
										
											2017-08-06 14:48:39 +05:30
										 |  |  | 
 | 
					
						
							|  |  |  |           depends_on "openssl" | 
					
						
							|  |  |  |           depends_on "libressl" => :optional | 
					
						
							| 
									
										
										
										
											2023-04-07 17:16:48 +01:00
										 |  |  |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/Text: Formulae should not depend on both OpenSSL and LibreSSL (even optionally). | 
					
						
							| 
									
										
										
										
											2017-08-06 14:48:39 +05:30
										 |  |  |         end | 
					
						
							| 
									
										
										
										
											2017-10-21 03:12:50 +02:00
										 |  |  |       RUBY | 
					
						
							| 
									
										
										
										
											2017-08-06 14:48:39 +05:30
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-10-21 03:12:50 +02:00
										 |  |  |       expect_offense(<<~RUBY) | 
					
						
							| 
									
										
										
										
											2017-08-06 14:48:39 +05:30
										 |  |  |         class Foo < Formula | 
					
						
							| 
									
										
										
										
											2018-11-28 20:51:55 +01:00
										 |  |  |           url "https://brew.sh/foo-1.0.tgz" | 
					
						
							|  |  |  |           homepage "https://brew.sh" | 
					
						
							| 
									
										
										
										
											2017-08-06 14:48:39 +05:30
										 |  |  | 
 | 
					
						
							|  |  |  |           depends_on "openssl" | 
					
						
							|  |  |  |           depends_on "libressl" | 
					
						
							| 
									
										
										
										
											2023-04-07 17:16:48 +01:00
										 |  |  |           ^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/Text: Formulae should not depend on both OpenSSL and LibreSSL (even optionally). | 
					
						
							| 
									
										
										
										
											2017-08-06 14:48:39 +05:30
										 |  |  |         end | 
					
						
							| 
									
										
										
										
											2017-10-21 03:12:50 +02:00
										 |  |  |       RUBY | 
					
						
							| 
									
										
										
										
											2017-08-06 14:48:39 +05:30
										 |  |  |     end | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-01-15 08:41:44 -08:00
										 |  |  |     it "reports an offense if veclibfort is used instead of OpenBLAS (in homebrew/core)" do | 
					
						
							| 
									
										
										
										
											2019-06-06 18:09:44 -04:00
										 |  |  |       expect_offense(<<~RUBY, "/homebrew-core/") | 
					
						
							|  |  |  |         class Foo < Formula | 
					
						
							|  |  |  |           url "https://brew.sh/foo-1.0.tgz" | 
					
						
							|  |  |  |           homepage "https://brew.sh" | 
					
						
							|  |  |  |           depends_on "veclibfort" | 
					
						
							| 
									
										
										
										
											2023-04-07 17:16:48 +01:00
										 |  |  |           ^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/Text: Formulae in homebrew/core should use OpenBLAS as the default serial linear algebra library. | 
					
						
							| 
									
										
										
										
											2019-06-06 18:09:44 -04:00
										 |  |  |         end | 
					
						
							|  |  |  |       RUBY | 
					
						
							|  |  |  |     end | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-01-15 08:41:44 -08:00
										 |  |  |     it "reports an offense if lapack is used instead of OpenBLAS (in homebrew/core)" do | 
					
						
							| 
									
										
										
										
											2019-06-06 18:09:44 -04:00
										 |  |  |       expect_offense(<<~RUBY, "/homebrew-core/") | 
					
						
							|  |  |  |         class Foo < Formula | 
					
						
							|  |  |  |           url "https://brew.sh/foo-1.0.tgz" | 
					
						
							|  |  |  |           homepage "https://brew.sh" | 
					
						
							|  |  |  |           depends_on "lapack" | 
					
						
							| 
									
										
										
										
											2023-04-07 17:16:48 +01:00
										 |  |  |           ^^^^^^^^^^^^^^^^^^^ FormulaAudit/Text: Formulae in homebrew/core should use OpenBLAS as the default serial linear algebra library. | 
					
						
							| 
									
										
										
										
											2019-06-06 18:09:44 -04:00
										 |  |  |         end | 
					
						
							|  |  |  |       RUBY | 
					
						
							|  |  |  |     end | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-01-14 17:59:45 -08:00
										 |  |  |     it "reports an offense if `go get` is executed" do | 
					
						
							| 
									
										
										
										
											2017-10-21 03:12:50 +02:00
										 |  |  |       expect_offense(<<~RUBY) | 
					
						
							| 
									
										
										
										
											2017-05-24 00:08:31 +05:30
										 |  |  |         class Foo < Formula | 
					
						
							| 
									
										
										
										
											2018-11-28 20:51:55 +01:00
										 |  |  |           url "https://brew.sh/foo-1.0.tgz" | 
					
						
							|  |  |  |           homepage "https://brew.sh" | 
					
						
							| 
									
										
										
										
											2017-05-24 00:08:31 +05:30
										 |  |  | 
 | 
					
						
							|  |  |  |           def install | 
					
						
							|  |  |  |             system "go", "get", "bar" | 
					
						
							| 
									
										
										
										
											2023-04-07 17:16:48 +01:00
										 |  |  |             ^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/Text: Do not use `go get`. Please ask upstream to implement Go vendoring | 
					
						
							| 
									
										
										
										
											2017-05-24 00:08:31 +05:30
										 |  |  |           end | 
					
						
							|  |  |  |         end | 
					
						
							| 
									
										
										
										
											2017-10-21 03:12:50 +02:00
										 |  |  |       RUBY | 
					
						
							| 
									
										
										
										
											2017-05-24 00:08:31 +05:30
										 |  |  |     end | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-01-14 17:59:45 -08:00
										 |  |  |     it "reports an offense if `xcodebuild` is executed" do | 
					
						
							| 
									
										
										
										
											2017-10-21 03:12:50 +02:00
										 |  |  |       expect_offense(<<~RUBY) | 
					
						
							| 
									
										
										
										
											2017-05-24 00:08:31 +05:30
										 |  |  |         class Foo < Formula | 
					
						
							| 
									
										
										
										
											2018-11-28 20:51:55 +01:00
										 |  |  |           url "https://brew.sh/foo-1.0.tgz" | 
					
						
							|  |  |  |           homepage "https://brew.sh" | 
					
						
							| 
									
										
										
										
											2017-05-24 00:08:31 +05:30
										 |  |  | 
 | 
					
						
							|  |  |  |           def install | 
					
						
							|  |  |  |             system "xcodebuild", "foo", "bar" | 
					
						
							| 
									
										
										
										
											2023-04-07 17:16:48 +01:00
										 |  |  |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/Text: use "xcodebuild *args" instead of "system 'xcodebuild', *args" | 
					
						
							| 
									
										
										
										
											2017-05-24 00:08:31 +05:30
										 |  |  |           end | 
					
						
							|  |  |  |         end | 
					
						
							| 
									
										
										
										
											2017-10-21 03:12:50 +02:00
										 |  |  |       RUBY | 
					
						
							| 
									
										
										
										
											2017-05-24 00:08:31 +05:30
										 |  |  |     end | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-12-07 22:58:54 +00:00
										 |  |  |     it "reports an offense if `def plist` is used" do | 
					
						
							| 
									
										
										
										
											2017-10-21 03:12:50 +02:00
										 |  |  |       expect_offense(<<~RUBY) | 
					
						
							| 
									
										
										
										
											2017-05-24 00:08:31 +05:30
										 |  |  |         class Foo < Formula | 
					
						
							| 
									
										
										
										
											2018-11-28 20:51:55 +01:00
										 |  |  |           url "https://brew.sh/foo-1.0.tgz" | 
					
						
							|  |  |  |           homepage "https://brew.sh" | 
					
						
							| 
									
										
										
										
											2017-05-24 00:08:31 +05:30
										 |  |  | 
 | 
					
						
							|  |  |  |           def install | 
					
						
							|  |  |  |             system "xcodebuild", "foo", "bar" | 
					
						
							| 
									
										
										
										
											2023-04-07 17:16:48 +01:00
										 |  |  |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/Text: use "xcodebuild *args" instead of "system 'xcodebuild', *args" | 
					
						
							| 
									
										
										
										
											2017-05-24 00:08:31 +05:30
										 |  |  |           end | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-10-15 02:28:32 +02:00
										 |  |  |           def plist | 
					
						
							| 
									
										
										
										
											2023-12-07 22:58:54 +00:00
										 |  |  |           ^^^^^^^^^ FormulaAudit/Text: `def plist` is deprecated. Please use services instead: https://docs.brew.sh/Formula-Cookbook#service-files | 
					
						
							| 
									
										
										
										
											2017-10-15 02:28:32 +02:00
										 |  |  |             <<~XML | 
					
						
							|  |  |  |               <?xml version="1.0" encoding="UTF-8"?> | 
					
						
							|  |  |  |               <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | 
					
						
							|  |  |  |               <plist version="1.0"> | 
					
						
							|  |  |  |               <dict> | 
					
						
							|  |  |  |                 <key>Label</key>
 | 
					
						
							|  |  |  |                 <string>org.nrpe.agent</string>
 | 
					
						
							|  |  |  |               </dict>
 | 
					
						
							|  |  |  |               </plist>
 | 
					
						
							|  |  |  |             XML | 
					
						
							| 
									
										
										
										
											2017-05-24 00:08:31 +05:30
										 |  |  |           end | 
					
						
							|  |  |  |         end | 
					
						
							| 
									
										
										
										
											2017-10-15 02:28:32 +02:00
										 |  |  |       RUBY | 
					
						
							| 
									
										
										
										
											2017-05-24 00:08:31 +05:30
										 |  |  |     end | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-01-14 17:59:45 -08:00
										 |  |  |     it 'reports an offense if `require "language/go"` is present' do | 
					
						
							| 
									
										
										
										
											2017-10-21 03:12:50 +02:00
										 |  |  |       expect_offense(<<~RUBY) | 
					
						
							| 
									
										
										
										
											2017-05-24 00:08:31 +05:30
										 |  |  |         require "language/go" | 
					
						
							| 
									
										
										
										
											2023-04-07 17:16:48 +01:00
										 |  |  |         ^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/Text: require "language/go" is unnecessary unless using `go_resource`s | 
					
						
							| 
									
										
										
										
											2017-05-24 00:08:31 +05:30
										 |  |  | 
 | 
					
						
							|  |  |  |         class Foo < Formula | 
					
						
							| 
									
										
										
										
											2018-11-28 20:51:55 +01:00
										 |  |  |           url "https://brew.sh/foo-1.0.tgz" | 
					
						
							|  |  |  |           homepage "https://brew.sh" | 
					
						
							| 
									
										
										
										
											2017-05-24 00:08:31 +05:30
										 |  |  | 
 | 
					
						
							|  |  |  |           def install | 
					
						
							|  |  |  |             system "go", "get", "bar" | 
					
						
							| 
									
										
										
										
											2023-04-07 17:16:48 +01:00
										 |  |  |             ^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/Text: Do not use `go get`. Please ask upstream to implement Go vendoring | 
					
						
							| 
									
										
										
										
											2017-05-24 00:08:31 +05:30
										 |  |  |           end | 
					
						
							|  |  |  |         end | 
					
						
							| 
									
										
										
										
											2017-10-21 03:12:50 +02:00
										 |  |  |       RUBY | 
					
						
							| 
									
										
										
										
											2017-05-24 00:08:31 +05:30
										 |  |  |     end | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-01-14 17:59:45 -08:00
										 |  |  |     it "reports an offense if `Formula.factory(name)` is present" do | 
					
						
							| 
									
										
										
										
											2017-10-21 03:12:50 +02:00
										 |  |  |       expect_offense(<<~RUBY) | 
					
						
							| 
									
										
										
										
											2017-05-24 00:08:31 +05:30
										 |  |  |         class Foo < Formula | 
					
						
							| 
									
										
										
										
											2018-11-28 20:51:55 +01:00
										 |  |  |           url "https://brew.sh/foo-1.0.tgz" | 
					
						
							|  |  |  |           homepage "https://brew.sh" | 
					
						
							| 
									
										
										
										
											2017-05-24 00:08:31 +05:30
										 |  |  | 
 | 
					
						
							|  |  |  |           def install | 
					
						
							|  |  |  |             Formula.factory(name) | 
					
						
							| 
									
										
										
										
											2023-04-07 17:16:48 +01:00
										 |  |  |             ^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/Text: "Formula.factory(name)" is deprecated in favor of "Formula[name]" | 
					
						
							| 
									
										
										
										
											2017-05-24 00:08:31 +05:30
										 |  |  |           end | 
					
						
							|  |  |  |         end | 
					
						
							| 
									
										
										
										
											2017-10-21 03:12:50 +02:00
										 |  |  |       RUBY | 
					
						
							| 
									
										
										
										
											2017-05-24 00:08:31 +05:30
										 |  |  |     end | 
					
						
							| 
									
										
										
										
											2018-06-08 00:07:07 +10:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-01-14 17:59:45 -08:00
										 |  |  |     it "reports an offense if `dep ensure` is used without `-vendor-only`" do | 
					
						
							| 
									
										
										
										
											2018-06-08 00:07:07 +10:00
										 |  |  |       expect_offense(<<~RUBY) | 
					
						
							|  |  |  |         class Foo < Formula | 
					
						
							| 
									
										
										
										
											2018-11-28 20:51:55 +01:00
										 |  |  |           url "https://brew.sh/foo-1.0.tgz" | 
					
						
							|  |  |  |           homepage "https://brew.sh" | 
					
						
							| 
									
										
										
										
											2018-06-08 00:07:07 +10:00
										 |  |  | 
 | 
					
						
							|  |  |  |           def install | 
					
						
							|  |  |  |             system "dep", "ensure" | 
					
						
							| 
									
										
										
										
											2023-04-07 17:16:48 +01:00
										 |  |  |             ^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/Text: use "dep", "ensure", "-vendor-only" | 
					
						
							| 
									
										
										
										
											2018-06-08 00:07:07 +10:00
										 |  |  |           end | 
					
						
							|  |  |  |         end | 
					
						
							|  |  |  |       RUBY | 
					
						
							|  |  |  |     end | 
					
						
							| 
									
										
										
										
											2018-06-08 10:15:32 +10:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-01-14 17:59:45 -08:00
										 |  |  |     it "reports an offense if `cargo build` is executed" do | 
					
						
							| 
									
										
										
										
											2018-06-08 10:15:32 +10:00
										 |  |  |       expect_offense(<<~RUBY) | 
					
						
							|  |  |  |         class Foo < Formula | 
					
						
							| 
									
										
										
										
											2018-11-28 20:51:55 +01:00
										 |  |  |           url "https://brew.sh/foo-1.0.tgz" | 
					
						
							|  |  |  |           homepage "https://brew.sh" | 
					
						
							| 
									
										
										
										
											2018-06-08 10:15:32 +10:00
										 |  |  | 
 | 
					
						
							|  |  |  |           def install | 
					
						
							|  |  |  |             system "cargo", "build" | 
					
						
							| 
									
										
										
										
											2023-04-07 17:16:48 +01:00
										 |  |  |             ^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/Text: use "cargo", "install", *std_cargo_args | 
					
						
							| 
									
										
										
										
											2018-06-08 10:15:32 +10:00
										 |  |  |           end | 
					
						
							|  |  |  |         end | 
					
						
							|  |  |  |       RUBY | 
					
						
							|  |  |  |     end | 
					
						
							| 
									
										
										
										
											2020-07-03 16:27:35 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-01-31 20:08:45 -05:00
										 |  |  |     it "doesn't reports an offense if `cargo build` is executed with --lib" do | 
					
						
							|  |  |  |       expect_no_offenses(<<~RUBY) | 
					
						
							|  |  |  |         class Foo < Formula | 
					
						
							|  |  |  |           url "https://brew.sh/foo-1.0.tgz" | 
					
						
							|  |  |  |           homepage "https://brew.sh" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |           def install | 
					
						
							|  |  |  |             system "cargo", "build", "--lib" | 
					
						
							|  |  |  |           end | 
					
						
							|  |  |  |         end | 
					
						
							|  |  |  |       RUBY | 
					
						
							|  |  |  |     end | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-01-14 17:59:45 -08:00
										 |  |  |     it "reports an offense if `make` calls are not separated" do | 
					
						
							| 
									
										
										
										
											2020-07-03 16:27:35 -04:00
										 |  |  |       expect_offense(<<~RUBY) | 
					
						
							|  |  |  |         class Foo < Formula | 
					
						
							|  |  |  |           def install | 
					
						
							|  |  |  |             system "make && make install" | 
					
						
							| 
									
										
										
										
											2023-04-07 17:16:48 +01:00
										 |  |  |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FormulaAudit/Text: Use separate `make` calls | 
					
						
							| 
									
										
										
										
											2020-07-03 16:27:35 -04:00
										 |  |  |           end | 
					
						
							|  |  |  |         end | 
					
						
							|  |  |  |       RUBY | 
					
						
							|  |  |  |     end | 
					
						
							| 
									
										
										
										
											2020-07-05 13:50:48 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-01-14 17:59:45 -08:00
										 |  |  |     it "reports an offense if paths are concatenated in string interpolation" do | 
					
						
							| 
									
										
										
										
											2020-07-05 13:50:48 -04:00
										 |  |  |       expect_offense(<<~RUBY) | 
					
						
							|  |  |  |         class Foo < Formula | 
					
						
							|  |  |  |           def install | 
					
						
							|  |  |  |             ohai "foo \#{bar + "baz"}" | 
					
						
							| 
									
										
										
										
											2023-04-07 17:16:48 +01:00
										 |  |  |                       ^^^^^^^^^^^^^^ FormulaAudit/Text: Do not concatenate paths in string interpolation | 
					
						
							| 
									
										
										
										
											2020-07-05 13:50:48 -04:00
										 |  |  |           end | 
					
						
							|  |  |  |         end | 
					
						
							|  |  |  |       RUBY | 
					
						
							|  |  |  |     end | 
					
						
							| 
									
										
										
										
											2020-07-05 14:32:27 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-01-14 17:59:45 -08:00
										 |  |  |     it 'reports an offense if `prefix + "bin"` is present' do | 
					
						
							| 
									
										
										
										
											2020-07-05 15:02:47 -04:00
										 |  |  |       expect_offense(<<~RUBY) | 
					
						
							|  |  |  |         class Foo < Formula | 
					
						
							|  |  |  |           def install | 
					
						
							|  |  |  |             ohai prefix + "bin" | 
					
						
							| 
									
										
										
										
											2023-04-07 17:16:48 +01:00
										 |  |  |                  ^^^^^^^^^^^^^^ FormulaAudit/Text: Use `bin` instead of `prefix + "bin"` | 
					
						
							| 
									
										
										
										
											2020-07-05 15:02:47 -04:00
										 |  |  |           end | 
					
						
							|  |  |  |         end | 
					
						
							|  |  |  |       RUBY | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |       expect_offense(<<~RUBY) | 
					
						
							|  |  |  |         class Foo < Formula | 
					
						
							|  |  |  |           def install | 
					
						
							|  |  |  |             ohai prefix + "bin/foo" | 
					
						
							| 
									
										
										
										
											2023-04-07 17:16:48 +01:00
										 |  |  |                  ^^^^^^^^^^^^^^^^^^ FormulaAudit/Text: Use `bin` instead of `prefix + "bin"` | 
					
						
							| 
									
										
										
										
											2020-07-05 15:02:47 -04:00
										 |  |  |           end | 
					
						
							|  |  |  |         end | 
					
						
							|  |  |  |       RUBY | 
					
						
							|  |  |  |     end | 
					
						
							| 
									
										
										
										
											2017-05-24 00:08:31 +05:30
										 |  |  |   end | 
					
						
							|  |  |  | end |