mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
rubocop: fix brew style warnings.
This commit is contained in:
parent
8cd0d85afb
commit
1f48e17f1b
@ -165,11 +165,11 @@ class FormulaCreator
|
||||
path.write ERB.new(template, nil, ">").result(binding)
|
||||
end
|
||||
|
||||
def template; <<~EOS
|
||||
def template
|
||||
<<~EOS
|
||||
# Documentation: https://docs.brew.sh/Formula-Cookbook.html
|
||||
# http://www.rubydoc.info/github/Homebrew/brew/master/Formula
|
||||
# PLEASE REMOVE ALL GENERATED COMMENTS BEFORE SUBMITTING YOUR PULL REQUEST!
|
||||
|
||||
class #{Formulary.class_s(name)} < Formula
|
||||
desc "#{desc}"
|
||||
homepage "#{homepage}"
|
||||
@ -182,7 +182,6 @@ class FormulaCreator
|
||||
<% end %>
|
||||
sha256 "#{sha256}"
|
||||
<% end %>
|
||||
|
||||
<% if mode == :cmake %>
|
||||
depends_on "cmake" => :build
|
||||
<% elsif mode == :meson %>
|
||||
@ -191,10 +190,8 @@ class FormulaCreator
|
||||
<% elsif mode.nil? %>
|
||||
# depends_on "cmake" => :build
|
||||
<% end %>
|
||||
|
||||
def install
|
||||
# ENV.deparallelize # if your formula fails when building in parallel
|
||||
|
||||
<% if mode == :cmake %>
|
||||
system "cmake", ".", *std_cmake_args
|
||||
<% elsif mode == :autotools %>
|
||||
@ -222,7 +219,6 @@ class FormulaCreator
|
||||
system "make", "install" # if this fails, try separate make/make install steps
|
||||
<% end %>
|
||||
end
|
||||
|
||||
test do
|
||||
# `test do` will create, run in and delete a temporary directory.
|
||||
#
|
||||
|
@ -54,7 +54,8 @@ class Keg
|
||||
end
|
||||
|
||||
class DirectoryNotWritableError < LinkError
|
||||
def to_s; <<~EOS
|
||||
def to_s
|
||||
<<~EOS
|
||||
Could not symlink #{src}
|
||||
#{dst.dirname} is not writable.
|
||||
EOS
|
||||
|
@ -232,7 +232,8 @@ describe Hbc::DSL, :cask do
|
||||
expect(cask.caveats).to be_empty
|
||||
|
||||
cask = Hbc::Cask.new("cask-with-caveats") do
|
||||
def caveats; <<~EOS
|
||||
def caveats
|
||||
<<~EOS
|
||||
When you install this Cask, you probably want to know this.
|
||||
EOS
|
||||
end
|
||||
|
@ -19,7 +19,7 @@ module Test
|
||||
return super(block) unless @tty
|
||||
|
||||
colored_tty_block = lambda do
|
||||
instance_eval("$#{@output}").extend(Module.new do
|
||||
instance_eval("$#{@output}", __FILE__, __LINE__).extend(Module.new do
|
||||
def tty?
|
||||
true
|
||||
end
|
||||
@ -32,7 +32,7 @@ module Test
|
||||
return super(colored_tty_block) if @colors
|
||||
|
||||
uncolored_tty_block = lambda do
|
||||
instance_eval <<-EOS
|
||||
instance_eval <<-EOS, __FILE__, __LINE__ + 1
|
||||
begin
|
||||
captured_stream = StringIO.new
|
||||
|
||||
|
@ -129,7 +129,7 @@ module GitHub
|
||||
# This is a no-op if the user is opting out of using the GitHub API.
|
||||
return block_given? ? yield({}) : {} if ENV["HOMEBREW_NO_GITHUB_API"]
|
||||
|
||||
args = %W[--header application/vnd.github.v3+json --write-out \n%{http_code}]
|
||||
args = %W[--header application/vnd.github.v3+json --write-out \n%{http_code}] # rubocop:disable Lint/NestedPercentLiteral
|
||||
args += curl_args
|
||||
|
||||
token, username = api_credentials
|
||||
|
Loading…
x
Reference in New Issue
Block a user