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",
|
||||
"f",
|
||||
"ff",
|
||||
"fn",
|
||||
"o",
|
||||
"p",
|
||||
"pr",
|
||||
|
@ -57,7 +57,7 @@ module Cask
|
||||
downloader.basename
|
||||
end
|
||||
|
||||
def verify_download_integrity(fn)
|
||||
def verify_download_integrity(filename)
|
||||
if @cask.sha256 == :no_check
|
||||
opoo "No checksum defined for cask '#{@cask}', skipping verification."
|
||||
return
|
||||
@ -65,13 +65,13 @@ module Cask
|
||||
|
||||
begin
|
||||
ohai "Verifying checksum for cask '#{@cask}'" if verbose?
|
||||
fn.verify_checksum(@cask.sha256)
|
||||
filename.verify_checksum(@cask.sha256)
|
||||
rescue ChecksumMissingError
|
||||
opoo <<~EOS
|
||||
Cannot verify integrity of '#{fn.basename}'.
|
||||
Cannot verify integrity of '#{filename.basename}'.
|
||||
No checksum was provided for this cask.
|
||||
For your reference, the checksum is:
|
||||
sha256 "#{fn.sha256}"
|
||||
sha256 "#{filename.sha256}"
|
||||
EOS
|
||||
end
|
||||
end
|
||||
|
@ -2281,8 +2281,8 @@ class Formula
|
||||
end
|
||||
|
||||
# @private
|
||||
def verify_download_integrity(fn)
|
||||
active_spec.verify_download_integrity(fn)
|
||||
def verify_download_integrity(filename)
|
||||
active_spec.verify_download_integrity(filename)
|
||||
end
|
||||
|
||||
# @private
|
||||
|
@ -118,9 +118,9 @@ module Readall
|
||||
|
||||
private
|
||||
|
||||
def syntax_errors_or_warnings?(rb)
|
||||
def syntax_errors_or_warnings?(filename)
|
||||
# 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.
|
||||
# See https://bugs.ruby-lang.org/issues/12359.
|
||||
|
@ -187,17 +187,17 @@ class Resource
|
||||
download
|
||||
end
|
||||
|
||||
def verify_download_integrity(fn)
|
||||
if fn.file?
|
||||
ohai "Verifying checksum for '#{fn.basename}'" if verbose?
|
||||
fn.verify_checksum(checksum)
|
||||
def verify_download_integrity(filename)
|
||||
if filename.file?
|
||||
ohai "Verifying checksum for '#{filename.basename}'" if verbose?
|
||||
filename.verify_checksum(checksum)
|
||||
end
|
||||
rescue ChecksumMissingError
|
||||
opoo <<~EOS
|
||||
Cannot verify integrity of '#{fn.basename}'.
|
||||
Cannot verify integrity of '#{filename.basename}'.
|
||||
No checksum was provided for this resource.
|
||||
For your reference, the checksum is:
|
||||
sha256 "#{fn.sha256}"
|
||||
sha256 "#{filename.sha256}"
|
||||
EOS
|
||||
end
|
||||
|
||||
|
@ -286,7 +286,7 @@ class HeadSoftwareSpec < SoftwareSpec
|
||||
@resource.version = Version.create("HEAD")
|
||||
end
|
||||
|
||||
def verify_download_integrity(_fn)
|
||||
def verify_download_integrity(_filename)
|
||||
# no-op
|
||||
end
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user