rubocop: Denote unused block arguments

This commit is contained in:
Will Binns 2019-01-26 16:41:27 +00:00 committed by Will Binns
parent bbbc8bacf1
commit 282bfd16d7
8 changed files with 10 additions and 23 deletions

View File

@ -6,19 +6,6 @@
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.
# Offense count: 10
# Cop supports --auto-correct.
# Configuration parameters: IgnoreEmptyBlocks, AllowUnusedKeywordArguments.
Lint/UnusedBlockArgument:
Exclude:
- '_contrib/comparelinks.rb'
- '_plugins/alphab_for.rb'
- '_plugins/autocrossref.rb'
- '_plugins/contributors.rb'
- '_plugins/sitemap.rb'
- '_plugins/templates.rb'
- '_plugins/wallets.rb'
# Offense count: 2
# Cop supports --auto-correct.
# Configuration parameters: AllowUnusedKeywordArguments, IgnoreEmptyMethods.

View File

@ -72,12 +72,12 @@ Dir.mktmpdir { |workdir|
# Find added links, removed links
diffaddlinks = []
diffrmlinks = []
newlinks.each { |link, etag|
newlinks.each { |link, _etag|
next if oldlinks.has_key?(link)
diffaddlinks.push(link)
}
oldlinks.each { |link, etag|
oldlinks.each { |link, _etag|
next if newlinks.has_key?(link)
diffrmlinks.push(link)

View File

@ -48,7 +48,7 @@ module Jekyll
# recreate collection with new ordering
sorted_collection = []
for va in translated do
val = assoc.select { |k, v| v == va }
val = assoc.select { |_k, v| v == va }
# compatibility with old ruby versions that return an Array
if val.is_a?(Array)
val = { val[0][0] => va }

View File

@ -63,7 +63,7 @@ module Jekyll
## first (e.g. "block chain" before "block"). Otherwise short
## terms would get linked first and there'd be nothing for long
## terms to link to.
site['crossref'].sort_by { |k, v| -k.length }.each { |term|
site['crossref'].sort_by { |k, _v| -k.length }.each { |term|
term[1] = term[0] if term[1].nil? || term[1].empty?
term[0] = Regexp.escape(term[0])

View File

@ -70,7 +70,7 @@ module Jekyll
end
end
# Generate final ordered contributors array
result.each do |key, value|
result.each do |_key, value|
contributors.push(value)
end
contributors.sort_by { |commits| - commits['contributions'] }

View File

@ -46,14 +46,14 @@ module Jekyll
sitemap.puts '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"'
sitemap.puts ' xmlns:xhtml="http://www.w3.org/1999/xhtml">'
# Add translated pages with their alternative in each languages
locs['en']['url'].each do |id, value|
locs.each do |lang, var|
locs['en']['url'].each do |id, _value|
locs.each do |lang, _var|
# Don't add a page if their url is not translated
next if locs[lang]['url'][id].nil? or locs[lang]['url'][id] == ''
sitemap.puts '<url>'
sitemap.puts ' <loc>https://bitcoin.org/' + lang + '/' + CGI::escape(locs[lang]['url'][id]) + '</loc>'
locs.each do |altlang, altvar|
locs.each do |altlang, _altvar|
next if locs[altlang]['url'][id].nil? or locs[altlang]['url'][id] == '' or altlang == lang
sitemap.puts ' <xhtml:link'

View File

@ -41,7 +41,7 @@ module Jekyll
if !File.directory?(site.dest)
Dir.mkdir(site.dest)
end
locs.each do |lang, value|
locs.each do |lang, _value|
Dir.foreach('_templates') do |file|
next if file == '.' or file == '..'

View File

@ -71,7 +71,7 @@ module Jekyll
end
# Getting information about each found wallet
locs.each do |lang, value|
locs.each do |lang, _value|
title = locs[lang]['choose-your-wallet']['title']
platformsCol.docs.each do |doc|