mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
rubocop: Drop "fn" from Naming/MethodParameterName
allowlist
- I originally thought this was short for "function", but upon closer inspection all its usages are to do with filenames. So, use "filename", it's clearer.
This commit is contained in:
parent
3e7a46f474
commit
6d822d9a62
@ -198,7 +198,6 @@ Naming/MethodParameterName:
|
|||||||
"e",
|
"e",
|
||||||
"f",
|
"f",
|
||||||
"ff",
|
"ff",
|
||||||
"fn",
|
|
||||||
"o",
|
"o",
|
||||||
"p",
|
"p",
|
||||||
"pr",
|
"pr",
|
||||||
|
@ -57,7 +57,7 @@ module Cask
|
|||||||
downloader.basename
|
downloader.basename
|
||||||
end
|
end
|
||||||
|
|
||||||
def verify_download_integrity(fn)
|
def verify_download_integrity(filename)
|
||||||
if @cask.sha256 == :no_check
|
if @cask.sha256 == :no_check
|
||||||
opoo "No checksum defined for cask '#{@cask}', skipping verification."
|
opoo "No checksum defined for cask '#{@cask}', skipping verification."
|
||||||
return
|
return
|
||||||
@ -65,13 +65,13 @@ module Cask
|
|||||||
|
|
||||||
begin
|
begin
|
||||||
ohai "Verifying checksum for cask '#{@cask}'" if verbose?
|
ohai "Verifying checksum for cask '#{@cask}'" if verbose?
|
||||||
fn.verify_checksum(@cask.sha256)
|
filename.verify_checksum(@cask.sha256)
|
||||||
rescue ChecksumMissingError
|
rescue ChecksumMissingError
|
||||||
opoo <<~EOS
|
opoo <<~EOS
|
||||||
Cannot verify integrity of '#{fn.basename}'.
|
Cannot verify integrity of '#{filename.basename}'.
|
||||||
No checksum was provided for this cask.
|
No checksum was provided for this cask.
|
||||||
For your reference, the checksum is:
|
For your reference, the checksum is:
|
||||||
sha256 "#{fn.sha256}"
|
sha256 "#{filename.sha256}"
|
||||||
EOS
|
EOS
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -2281,8 +2281,8 @@ class Formula
|
|||||||
end
|
end
|
||||||
|
|
||||||
# @private
|
# @private
|
||||||
def verify_download_integrity(fn)
|
def verify_download_integrity(filename)
|
||||||
active_spec.verify_download_integrity(fn)
|
active_spec.verify_download_integrity(filename)
|
||||||
end
|
end
|
||||||
|
|
||||||
# @private
|
# @private
|
||||||
|
@ -118,9 +118,9 @@ module Readall
|
|||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def syntax_errors_or_warnings?(rb)
|
def syntax_errors_or_warnings?(filename)
|
||||||
# Retrieve messages about syntax errors/warnings printed to `$stderr`.
|
# Retrieve messages about syntax errors/warnings printed to `$stderr`.
|
||||||
_, err, status = system_command(RUBY_PATH, args: ["-c", "-w", rb], print_stderr: false)
|
_, err, status = system_command(RUBY_PATH, args: ["-c", "-w", filename], print_stderr: false)
|
||||||
|
|
||||||
# Ignore unnecessary warning about named capture conflicts.
|
# Ignore unnecessary warning about named capture conflicts.
|
||||||
# See https://bugs.ruby-lang.org/issues/12359.
|
# See https://bugs.ruby-lang.org/issues/12359.
|
||||||
|
@ -187,17 +187,17 @@ class Resource
|
|||||||
download
|
download
|
||||||
end
|
end
|
||||||
|
|
||||||
def verify_download_integrity(fn)
|
def verify_download_integrity(filename)
|
||||||
if fn.file?
|
if filename.file?
|
||||||
ohai "Verifying checksum for '#{fn.basename}'" if verbose?
|
ohai "Verifying checksum for '#{filename.basename}'" if verbose?
|
||||||
fn.verify_checksum(checksum)
|
filename.verify_checksum(checksum)
|
||||||
end
|
end
|
||||||
rescue ChecksumMissingError
|
rescue ChecksumMissingError
|
||||||
opoo <<~EOS
|
opoo <<~EOS
|
||||||
Cannot verify integrity of '#{fn.basename}'.
|
Cannot verify integrity of '#{filename.basename}'.
|
||||||
No checksum was provided for this resource.
|
No checksum was provided for this resource.
|
||||||
For your reference, the checksum is:
|
For your reference, the checksum is:
|
||||||
sha256 "#{fn.sha256}"
|
sha256 "#{filename.sha256}"
|
||||||
EOS
|
EOS
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -286,7 +286,7 @@ class HeadSoftwareSpec < SoftwareSpec
|
|||||||
@resource.version = Version.create("HEAD")
|
@resource.version = Version.create("HEAD")
|
||||||
end
|
end
|
||||||
|
|
||||||
def verify_download_integrity(_fn)
|
def verify_download_integrity(_filename)
|
||||||
# no-op
|
# no-op
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user