This is an automated email from the ASF dual-hosted git repository.
sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git
The following commit(s) were added to refs/heads/master by this push:
new 27a2874 Unused variables
27a2874 is described below
commit 27a287404c3c2be9cc23dc96ca51803bc6f1c7ca
Author: Sebb <[email protected]>
AuthorDate: Tue Nov 24 16:07:45 2020 +0000
Unused variables
---
lib/whimsy/asf/agenda/front.rb | 5 ++---
tools/namemap.rb | 4 ++--
tools/ponypoop.rb | 12 ++++++------
tools/site_member_check.rb | 2 +-
tools/votes2ini.rb | 2 +-
www/board/agenda/spec/actions_spec.rb | 2 +-
www/board/agenda/spec/vue_server.rb | 6 +++---
www/board/agenda/views/committers_report.text.rb | 8 ++++----
www/committers/subscribe.cgi | 2 +-
www/committers/tm-report.cgi | 2 +-
www/committers/tools.cgi | 6 +++---
11 files changed, 25 insertions(+), 26 deletions(-)
diff --git a/lib/whimsy/asf/agenda/front.rb b/lib/whimsy/asf/agenda/front.rb
index 05429d8..6ac6c38 100644
--- a/lib/whimsy/asf/agenda/front.rb
+++ b/lib/whimsy/asf/agenda/front.rb
@@ -14,14 +14,13 @@ class ASF::Board::Agenda
scan @file, pattern do |attr|
if attr['title'] == 'Roll Call'
attr['people'] = {}
- list = nil
absent = attr['text'].scan(/Absent:\n\n.*?\n\n/m).join
directors = attr['text'].scan(/^ +Directors[ \S]*?:\n\n.*?\n\n/m).join
officers = attr['text'].scan(/^ +Executive[ \S]*?:\n\n.*?\n\n/m).join
# attempt to identify the people mentioned in the Roll Call
- people = attr['text'].scan(/^ {8}(\w.*)/).flatten.each do |name|
+ attr['text'].scan(/^ {8}(\w.*)/).flatten.each do |name|
next if name == 'none'
# Remove (extraneous [comments in past board minutes
name.gsub! /(\s*[\[(]|\s+-).*/, ''
@@ -68,7 +67,7 @@ class ASF::Board::Agenda
if attr['people']
attr['people'] = Hash[attr['people'].
- sort_by {|id, person| person[:sortName]}]
+ sort_by {|_id, person| person[:sortName]}]
end
elsif attr['title'] == 'Call to order'
attr['timestamp'] = timestamp(attr['text'][/\d+:\d+([ap]m)?/])
diff --git a/tools/namemap.rb b/tools/namemap.rb
index a03cbfc..2136a64 100644
--- a/tools/namemap.rb
+++ b/tools/namemap.rb
@@ -121,7 +121,7 @@ module NameMap
# TODO Depends on file format of exported other system accounts
# @param f filename to read from
# @return json data
- def get_other(f)
+ def get_other(_f)
return TEST_OTHER
end
@@ -239,7 +239,7 @@ module NameMap
dups = {}
histogram = Hash.new{|k,v| v = 0}
cids, cmails = hash_committers(get_committers(io))
- cids.each do |id, hsh|
+ cids.each do |_id, hsh|
histogram[hsh[MAIL].length] += 1
end
cmails.each do |addr, ary|
diff --git a/tools/ponypoop.rb b/tools/ponypoop.rb
index b027d8c..f6286bf 100755
--- a/tools/ponypoop.rb
+++ b/tools/ponypoop.rb
@@ -38,7 +38,7 @@ def analyze_threads(threads)
if threads['children'].is_a?(Array) then
max += 1
threads['children'].each do |thread|
- m, t = analyze_threads(thread)
+ _m, t = analyze_threads(thread)
total += t
end
p "Hsh: #{threads.class} - #{threads.size} at #{threads['epoch']}
#{max}/#{total}"
@@ -66,12 +66,12 @@ def analyze_stats(fname, results, subject_regex, errors)
results.last[:interesting] = results.last[:email]
results.last[:threads] = jzon['no_threads']
subject_regex.each do |t, s|
- results.last[t] = jzon['emails'].select{ |email| email['subject'] =~ s
}.size
+ results.last[t] = jzon['emails'].select { |email| email['subject'] =~
s }.size
results.last[:interesting] -= results.last[t] if
subject_regex.keys.include? t
end
# TODO: there's a more rubyish way to combine these loops
- subject_regex.each do |t, s|
- jzon['emails'].reject!{ |email| email['subject'] =~ s }
+ subject_regex.each do |_t, s|
+ jzon['emails'].reject! { |email| email['subject'] =~ s }
end
jzon['emails'].each do |email|
subjects << email['subject']
@@ -168,10 +168,10 @@ def optparse
options[:subdomain] = s.chomp('@.')
end
- opts.on('-p', '--pull', 'Pull down stats JSON files into -d dir
(otherwise, default analyzes existing stats JSON in dir)') do |p|
+ opts.on('-p', '--pull', 'Pull down stats JSON files into -d dir
(otherwise, default analyzes existing stats JSON in dir)') do
options[:pull] = true
end
- opts.on('-m', '--mbox', 'Pull down mbox files into -d dir') do |p|
+ opts.on('-m', '--mbox', 'Pull down mbox files into -d dir') do
options[:mbox] = true
end
diff --git a/tools/site_member_check.rb b/tools/site_member_check.rb
index f02ad99..8db3cae 100755
--- a/tools/site_member_check.rb
+++ b/tools/site_member_check.rb
@@ -10,7 +10,7 @@ members=ASF::Member.list.keys
path = ASF::SVN.svnpath!('site-foundation', 'members.mdtext')
-rev,contents = ASF::SVN.get(path)
+_rev, contents = ASF::SVN.get(path)
# # Members of The Apache Software Foundation #
#
diff --git a/tools/votes2ini.rb b/tools/votes2ini.rb
index 668a3b2..c1bc060 100755
--- a/tools/votes2ini.rb
+++ b/tools/votes2ini.rb
@@ -12,7 +12,7 @@ txt_file = raw_file.sub('.json', '.txt')
ini_file = File.dirname(raw_file) + '/board_nominations.ini'
votes = ''
-raw_votes['votes'].sort_by {|key, data| data['timestamp']}.each do |key, data|
+raw_votes['votes'].sort_by {|_key, data| data['timestamp']}.each do |key, data|
time = Time.at(data['timestamp']).gmtime.strftime("%Y/%m/%d %H:%M:%S")
vote = data['vote'].split(' ').map {|vote| vote[-1]}.join.downcase
votes += "[#{time}] #{key[0..31]} #{vote}\n"
diff --git a/www/board/agenda/spec/actions_spec.rb
b/www/board/agenda/spec/actions_spec.rb
index 74ceef1..b30cac6 100644
--- a/www/board/agenda/spec/actions_spec.rb
+++ b/www/board/agenda/spec/actions_spec.rb
@@ -370,7 +370,7 @@ feature 'server actions' do
end
if @commits
- @commits.each do |name, contents|
+ @commits.each do |name, _contents|
Agenda[name].replace :mtime=>0
File.unlink "#{AGENDA_WORK}/#{name}"
end
diff --git a/www/board/agenda/spec/vue_server.rb
b/www/board/agenda/spec/vue_server.rb
index 032d43f..1657b50 100644
--- a/www/board/agenda/spec/vue_server.rb
+++ b/www/board/agenda/spec/vue_server.rb
@@ -60,7 +60,7 @@ class VueServer
http = Net::HTTP.new('localhost', @@port)
request = Net::HTTP::Post.new('/', {})
request.body = "response.end('bye'); process.exit(0)"
- response = http.request(request)
+ _response = http.request(request)
rescue Errno::ECONNREFUSED, EOFError
nil
ensure
@@ -71,7 +71,7 @@ class VueServer
# the server itself
@@server = proc do
- cleanup = require("jsdom-global/register")
+ _cleanup = require("jsdom-global/register")
delete global.XMLHttpRequest
process.env.VUE_ENV = 'server'
@@ -122,7 +122,7 @@ class VueServer
return app
end
- jQuery = require('jquery')
+ _jQuery = require('jquery')
http = require('http')
server = http.createServer do |request, response|
diff --git a/www/board/agenda/views/committers_report.text.rb
b/www/board/agenda/views/committers_report.text.rb
index dae80b5..ccd9fa5 100644
--- a/www/board/agenda/views/committers_report.text.rb
+++ b/www/board/agenda/views/committers_report.text.rb
@@ -10,8 +10,8 @@ minutes = YAML.load_file(minutes_file) rescue {}
agenda = Agenda.parse(File.basename(agenda_file), :full)
# extract attendance from minutes and people from agenda
-attendance = Array(minutes['attendance']).select {|name, info| info[:present]}.
- sort_by {|name, info| info[:sortName]}
+attendance = Array(minutes['attendance']).select {|_name, info|
info[:present]}.
+ sort_by {|_name, info| info[:sortName]}
people = agenda[1]['people'].values
# merge role from agenda into attendance
@@ -21,8 +21,8 @@ attendance.each do |name, info|
end
# group attendance by role (directors, officers, guests)
-@attendance = attendance.group_by {|name, info| info[:role]}.
- map {|group, list| [group, list.map {|name, info| name}]}.to_h
+@attendance = attendance.group_by {|_name, info| info[:role]}.
+ map {|group, list| [group, list.map {|name, _info| name}]}.to_h
# get a list of missing attachments
@missing_reports = Array.new
diff --git a/www/committers/subscribe.cgi b/www/committers/subscribe.cgi
index b584e04..2b46833 100755
--- a/www/committers/subscribe.cgi
+++ b/www/committers/subscribe.cgi
@@ -159,7 +159,7 @@ _html do
# collect subscriptions
response = {}
ASF::MLIST.subscriptions(user.all_mail, response)
- subscriptions = response[:subscriptions].group_by {|list, mail| list}
+ subscriptions = response[:subscriptions].group_by {|list, _mail|
list}
subscriptions = subscriptions.map do |list, names|
list = $1 if list =~ /^(.*?)@apache\.org$/
list = "#$2-#$1" if list =~ /^(.*?)@(.*?)\.apache\.org$/
diff --git a/www/committers/tm-report.cgi b/www/committers/tm-report.cgi
index f4eda2a..ba65730 100755
--- a/www/committers/tm-report.cgi
+++ b/www/committers/tm-report.cgi
@@ -186,7 +186,7 @@ def emit_form()
end
# Validation as needed within the script
-def validate_form(formdata: {})
+def validate_form(_formdata: {})
true # Futureuse
end
diff --git a/www/committers/tools.cgi b/www/committers/tools.cgi
index 27c1a85..7c1725e 100755
--- a/www/committers/tools.cgi
+++ b/www/committers/tools.cgi
@@ -44,18 +44,18 @@ _html do
# Create array entry for each category
scan.each{ |k,v| v[1].each {|l| scan_by[l] << [k,v]}}
_ul.list_inline do
- scan_by.sort.each do |cat, l|
+ scan_by.sort.each do |cat, _l|
_li do
_a cat.capitalize, href: "##{cat}"
end
end
end
- scan_by.sort.each do | category, links |
+ scan_by.sort.each do |category, links|
_ul.list_group do
_li.list_group_item.active do
_span category.capitalize, id: category
end
- links.sort_by{|k,v| v}.each do |l, desc|
+ links.sort_by{|_k, v| v}.each do |l, desc|
_li.list_group_item do
if 2 == desc.length
_span.glyphicon :aria_hidden, class: AUTHPUBLIC