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 d795398  Document unused variables
d795398 is described below

commit d795398e5f508a1309310bb61e3f6d3bbe01592d
Author: Sebb <[email protected]>
AuthorDate: Tue Sep 22 18:14:42 2020 +0100

    Document unused variables
---
 lib/whimsy/asf/agenda.rb                       |  2 +-
 tools/download_check.rb                        | 14 +++++++-------
 tools/mboxhdr2csv.rb                           | 12 ++++++------
 tools/ponyapi.rb                               | 16 ++++++++--------
 www/board/agenda/views/actions/publish.json.rb |  2 +-
 www/board/agenda/views/pages/adjournment.js.rb |  1 -
 www/events/other.cgi                           |  8 ++++----
 www/members/meeting-util.rb                    |  3 +--
 www/members/non-participants.cgi               | 10 +++++-----
 www/members/proxy.cgi                          |  2 +-
 www/officers/acreq.cgi                         | 14 +++++++-------
 www/officers/surveys.cgi                       |  4 ++--
 www/secretary/public-names.cgi                 | 10 +++++-----
 www/secretary/workbench/views/parts.js.rb      | 12 ++++++------
 14 files changed, 54 insertions(+), 56 deletions(-)

diff --git a/lib/whimsy/asf/agenda.rb b/lib/whimsy/asf/agenda.rb
index 1c3b3f3..dc53d3c 100644
--- a/lib/whimsy/asf/agenda.rb
+++ b/lib/whimsy/asf/agenda.rb
@@ -160,7 +160,7 @@ class ASF::Board::Agenda
     end
 
     # look for missing titles
-    @sections.each do |section, hash|
+    @sections.each do |_section, hash|
       hash['title'] ||= "UNKNOWN"
 
       if hash['title'] == "UNKNOWN"
diff --git a/tools/download_check.rb b/tools/download_check.rb
index 4070a9f..741fe4e 100755
--- a/tools/download_check.rb
+++ b/tools/download_check.rb
@@ -239,11 +239,11 @@ end
 def get_links(body)
   doc = Nokogiri::HTML(body)
   nodeset = doc.css('a[href]')    # Get anchors w href attribute via css
-  links = nodeset.map {|node|
+  nodeset.map { |node|
     href = node.attribute("href").to_s
     text = node.text.gsub(/[[:space:]]+/,' ')
     [href,text]
-  }.select{|x,y| x =~ %r{^(https?:)?//} }
+  }.select{|x, _y| x =~ %r{^(https?:)?//} }
 end
 
 VERIFY_TEXT = [
@@ -356,7 +356,7 @@ def _checkDownloadPage(path, tlp, version)
   #   https://www.apache.org/dist/httpcomponents/httpclient/KEYS
   expurl = "https://[downloads.|www.]apache.org/[dist/][incubator/]#{tlp}/KEYS"
   expurlre = 
%r{^https://((www\.)?apache\.org/dist|downloads\.apache\.org)/(incubator/)?#{tlp}/KEYS$}
-  keys = links.select{|h,v| h =~ expurlre}
+  keys = links.select{|h, _v| h =~ expurlre}
   if keys.size >= 1
     keyurl = keys.first.first
     keytext = keys.first[1]
@@ -367,7 +367,7 @@ def _checkDownloadPage(path, tlp, version)
     end
     check_head(keyurl,:E, "200", false, true)
   else
-    keys = links.select{|h,v| v.strip == 'KEYS' || v == 'KEYS file' || v == 
'[KEYS]'}
+    keys = links.select{|_h, v| v.strip == 'KEYS' || v == 'KEYS file' || v == 
'[KEYS]'}
     if keys.size >= 1
       I 'Found KEYS link'
       keyurl = keys.first.first
@@ -485,7 +485,7 @@ def _checkDownloadPage(path, tlp, version)
 
   links.each do |h,t|
     if h =~ %r{\.(asc|sha256|sha512)$}
-      host, stem, ext = check_hash_loc(h,tlp)
+      host, _stem, _ext = check_hash_loc(h,tlp)
       if host == 'archive'
         if $ARCHIVE_CHECK
           check_head(h, :E, "200", true, true)
@@ -514,7 +514,7 @@ def _checkDownloadPage(path, tlp, version)
         next
       end
       name = $1
-      ext = $2
+      _ext = $2
       if h =~ %r{https?://archive\.apache\.org/}
         unless $ARCHIVE_CHECK
             I "Ignoring archive artifact #{h}"
@@ -539,7 +539,7 @@ def _checkDownloadPage(path, tlp, version)
         bdy = check_page(h, :E, "200", false)
         if bdy
           lks = get_links(bdy)
-          lks.each do |l,t|
+          lks.each do |l, _t|
              # Don't want to match archive server (closer.cgi defaults to it 
if file is not found)
              if l.end_with?(name) and l !~ %r{//archive\.apache\.org/}
                 path = l
diff --git a/tools/mboxhdr2csv.rb b/tools/mboxhdr2csv.rb
index b824b6e..abefe87 100644
--- a/tools/mboxhdr2csv.rb
+++ b/tools/mboxhdr2csv.rb
@@ -173,7 +173,7 @@ module MailUtils
     if File.file?(cache_json)
       begin
         return JSON.parse(File.read(cache_json))
-      rescue StandardError => e
+      rescue StandardError => _e
         # No-op: fall through to attempt to re-create cache
       end
     end
@@ -212,14 +212,14 @@ module MailUtils
     emails[TOOLS].each do |mail|
       emails[TOOLCOUNT][mail[TOOLS]] += 1
     end
-    emails[TOOLCOUNT] = emails[TOOLCOUNT].sort_by { |k,v| -v}.to_h
+    emails[TOOLCOUNT] = emails[TOOLCOUNT].sort_by { |_k, v| -v}.to_h
 
     emails[MAILS].sort_by! { |email| email[DATE] }
     emails[MAILCOUNT] = Hash.new {|h, k| h[k] = 0 }
     emails[MAILS].each do |mail|
       emails[MAILCOUNT]["#{mail[WHO]} (#{mail[AVAILID]})"] += 1
     end
-    emails[MAILCOUNT] = emails[MAILCOUNT].sort_by { |k,v| -v}.to_h
+    emails[MAILCOUNT] = emails[MAILCOUNT].sort_by { |_k, v| -v}.to_h
 
     # If yearmonth is before current month, then write out yearmonth.json as 
cache
     if yearmonth < Date.today.strftime('%Y%m')
@@ -289,7 +289,7 @@ module MboxUtils
           mdata[:subject] = mail[:subject].value
           mdata[:listid] = mail[:List_Id].value
           mdata[:date] = mail.date.to_s
-        rescue => ee
+        rescue => _e
           mdata[:from] = mail[:from]
           mdata[:subject] = mail[:subject]
           mdata[:listid] = mail[:List_Id]
@@ -334,7 +334,7 @@ module MboxUtils
           mdata[:w] = d.wday
           mdata[:h] = d.hour
           mdata[:z] = d.zone
-        rescue => noop
+        rescue => _e
           # no-op - not critical
           puts "DEBUG: #{e.message} parsing: #{mdata[:date]}"
         end
@@ -432,7 +432,7 @@ def optparse
     opts.on('-oOUTPUT.CSV', '--output OUTPUT.CSV', "Filename to output rows 
into; default #{DEFAULT_OUTPUT}") do |o|
       options[:output] = o
     end
-    opts.on('-j', '--json', "Process .mbox to .json (optional)") do |j|
+    opts.on('-j', '--json', "Process .mbox to .json (optional)") do
       options[:json] = true
     end
     begin
diff --git a/tools/ponyapi.rb b/tools/ponyapi.rb
index d527ff2..35ced0e 100755
--- a/tools/ponyapi.rb
+++ b/tools/ponyapi.rb
@@ -61,7 +61,7 @@ module PonyAPI
   # it returns the data as a hash
   def get_pony_prefs(dir=nil, cookie=nil, sort_list=false)
     cookie=get_cookie() if cookie == 'prompt'
-    uri, request, response = fetch_pony(PONYPREFS, cookie)
+    uri, _request, response = fetch_pony(PONYPREFS, cookie)
     jzon = {}
     if response.code == '200' then
       jzon = JSON.parse(response.body)
@@ -74,7 +74,7 @@ module PonyAPI
           rescue JSON::GeneratorError
             puts "WARN:get_pony_prefs(#{uri.request_uri}) #{e.message} 
#{e.backtrace[0]}, continuing without pretty"
             f.puts jzon
-          end    
+          end
         end
       end
     else
@@ -91,9 +91,9 @@ module PonyAPI
   # Download one month of stats as a JSON
   # Must supply cookie = 'ponymail-logged-in-cookie' if a private list
   def get_pony_stats(dir, list, subdomain, year, month, cookie=nil, 
sort_list=false)
-    cookie=get_cookie() if cookie == 'prompt'
-    args =  make_args(list, subdomain, year, month)
-    uri, request, response = fetch_pony(PONYSTATS % args, cookie)
+    cookie = get_cookie() if cookie == 'prompt'
+    args = make_args(list, subdomain, year, month)
+    uri, _request, response = fetch_pony(PONYSTATS % args, cookie)
     if response.code == '200' then
       openfile(dir, STATSMBOX % args) do |f|
         begin
@@ -131,9 +131,9 @@ module PonyAPI
   # Caveats: uses response's encoding; overwrites existing .json file
   # Must supply cookie = 'ponymail-logged-in-cookie' if a private list
   def get_pony_mbox(dir, list, subdomain, year, month, cookie=nil)
-    cookie=get_cookie() if cookie == 'prompt'
-    args =  make_args(list, subdomain, year, month)
-    uri, request, response = fetch_pony(PONYMBOX % args, cookie)
+    cookie = get_cookie() if cookie == 'prompt'
+    args = make_args(list, subdomain, year, month)
+    uri, _request, response = fetch_pony(PONYMBOX % args, cookie)
     if response.code == '200'
       openfile(dir, FILEMBOX % args, "w:#{response.body.encoding}") do |f|
         f.puts response.body
diff --git a/www/board/agenda/views/actions/publish.json.rb 
b/www/board/agenda/views/actions/publish.json.rb
index 60af001..19c7419 100755
--- a/www/board/agenda/views/actions/publish.json.rb
+++ b/www/board/agenda/views/actions/publish.json.rb
@@ -88,7 +88,7 @@ end
 # ...
 
 # Update the Calendar from SVN
-ASF::SVN.update ASF::SVN.svnpath!('site-board', 'calendar.mdtext' ).untaint, 
@message, env, _ do |tmpdir, calendar|
+ASF::SVN.update ASF::SVN.svnpath!('site-board', 'calendar.mdtext' ).untaint, 
@message, env, _ do |_tmpdir, calendar|
   # add year header
   unless calendar.include? "# #{year} Board meeting minutes"
     calendar[/^()#.*Board meeting minutes #/,1] =
diff --git a/www/board/agenda/views/pages/adjournment.js.rb 
b/www/board/agenda/views/pages/adjournment.js.rb
index 831832b..0bf1a1c 100644
--- a/www/board/agenda/views/pages/adjournment.js.rb
+++ b/www/board/agenda/views/pages/adjournment.js.rb
@@ -188,7 +188,6 @@ class PMCActions < Vue
     @resolutions = []
 
     Agenda.index.each do |item|
-      action = name = nil
 
       %w(change establish terminate).each do |todo_type|
         Todos[todo_type].each do |todo| 
diff --git a/www/events/other.cgi b/www/events/other.cgi
index f06a816..3bd9329 100755
--- a/www/events/other.cgi
+++ b/www/events/other.cgi
@@ -14,8 +14,8 @@ require 'date'
 
 $cache = Cache.new(dir: 'other')
 
-def getJSON(url,name)
-  uri, response, status = $cache.get(url)
+def getJSON(url, _name)
+  _uri, response, _status = $cache.get(url)
 #  $stderr.puts "#{name} #{uri} #{status}"
   JSON.parse(response)
 end
@@ -73,7 +73,7 @@ _html do
       _thead_ do
         _tr do
           _th 'Conference', data_sort: 'string'
-          cols.each do |id, desc|
+          cols.each do |_id, desc|
             _th! desc, data_sort: 'string'
           end
           _th 'Last Event', data_sort: 'string'
@@ -86,7 +86,7 @@ _html do
                 _a conf['name'], href: conf['website']
               end
               if conf[SPEAKERKIT] then
-                cols.each do |id, desc|
+                cols.each do |id, _desc|
                   _td! conf[SPEAKERKIT][id]
                 end            
               else
diff --git a/www/members/meeting-util.rb b/www/members/meeting-util.rb
index b4f2f11..9575c5c 100644
--- a/www/members/meeting-util.rb
+++ b/www/members/meeting-util.rb
@@ -43,8 +43,7 @@ class MeetingUtil
   def self.getVolunteers(mtg_dir)
     lines = IO.read(File.join(mtg_dir, 'proxies'))
     # split by ---- underlines, then by blank lines; pick second para and drop 
leading spaces
-    volunteers = lines.split(/^-----------/)[1].split(/\n\n/)[1].scan(/^\ 
+(\S.*$)/).flatten
-
+    lines.split(/^-----------/)[1].split(/\n\n/)[1].scan(/^\ +(\S.*$)/).flatten
   end
   # Get info about current users's proxying
   # @return "help text", ["id | name (proxy)", ...] if they are a proxy for 
other(s)
diff --git a/www/members/non-participants.cgi b/www/members/non-participants.cgi
index 835e92f..1fc7d35 100755
--- a/www/members/non-participants.cgi
+++ b/www/members/non-participants.cgi
@@ -24,7 +24,7 @@ def get_attend_matrices(dir)
 
   # compute mappings of names to ids
   members = ASF::Member.list
-  active = Hash[members.select {|id, data| not data['status']}]
+  active = Hash[members.select {|_id, data| not data['status']}]
   nameMap = Hash[members.map {|id, data| [id, data[:name]]}]
   idMap = Hash[nameMap.to_a.map(&:reverse)]
 
@@ -87,7 +87,7 @@ _html do
         end
       end
 
-      matrix.each do |id, name, first, missed|
+      matrix.each do |id, _name, first, missed|
         next unless id
 
         if missed >= @meetingsMissed
@@ -123,12 +123,12 @@ end
 
 _json do
   meetingsMissed = (@meetingsMissed || 3).to_i
-  attendance, matrix, dates, nameMap = get_attend_matrices(MEETINGS)
-  inactive = matrix.select do |id, name, first, missed|
+  _attendance, matrix, _dates, _nameMap = get_attend_matrices(MEETINGS)
+  inactive = matrix.select do |id, _name, _first, missed|
     id and missed >= meetingsMissed
   end
 
-  Hash[inactive.map {|id, name, first, missed| 
+  Hash[inactive.map {|id, name, _first, missed| 
     [id, {name: name, missed: missed, status: 'no response yet'}]
     }]
 end
diff --git a/www/members/proxy.cgi b/www/members/proxy.cgi
index 0e26259..2b5d768 100755
--- a/www/members/proxy.cgi
+++ b/www/members/proxy.cgi
@@ -57,7 +57,7 @@ def emit_instructions(today, cur_mtg_dir, meeting)
 end
 
 # Emit meeting data and form for user to select a proxy - GET
-def emit_form(cur_mtg_dir, meeting, volunteers)
+def emit_form(cur_mtg_dir, _meeting, volunteers)
   help, copypasta = MeetingUtil.is_user_proxied(cur_mtg_dir, $USER)
   user_is_proxy = help && copypasta
   _whimsy_panel(user_is_proxy ? "You Are Proxying For Others" : "Select A 
Proxy For Upcoming Meeting", style: 'panel-success') do
diff --git a/www/officers/acreq.cgi b/www/officers/acreq.cgi
index f74ba58..e98e1de 100755
--- a/www/officers/acreq.cgi
+++ b/www/officers/acreq.cgi
@@ -19,9 +19,9 @@ end
 ICLAS = ASF::SVN.svnpath!('officers', 'iclas.txt')
 
 # get up to date data...
-requests, err = ASF::SVN.svn('cat', ASF::SVN.svnpath!('acreq', 
'new-account-reqs.txt'), {env: env})
+requests, _err = ASF::SVN.svn('cat', ASF::SVN.svnpath!('acreq', 
'new-account-reqs.txt'), {env: env})
 
-iclas_txt,err = ASF::SVN.svn('cat', ICLAS, {env: env}).force_encoding('utf-8')
+iclas_txt, _err = ASF::SVN.svn('cat', ICLAS, {env: 
env}).force_encoding('utf-8')
 
 # grab the current list of PMCs from ldap
 pmcs = ASF::Committee.pmcs.map(&:name).sort
@@ -48,9 +48,9 @@ elsif iclas == '1' and email and iclas_txt =~ 
/^notinavail:.*?:(.*?):#{email}:/
   iclas = {email => $1}
 else
   count = iclas ? iclas.to_i : 300 rescue 300
-  log, err = ASF::SVN.svn(['log', '--incremental', '-q', "-l#{count}"], ICLAS, 
{revision: 'HEAD:0', env: env})
+  log, _err = ASF::SVN.svn(['log', '--incremental', '-q', "-l#{count}"], 
ICLAS, {revision: 'HEAD:0', env: env})
   oldrev = log.split("\n")[-1].split()[0][1..-1].to_i
-  diff, err = ASF::SVN.svn('diff', ICLAS, {revision: "#{oldrev}:HEAD", env: 
env})
+  diff, _err = ASF::SVN.svn('diff', ICLAS, {revision: "#{oldrev}:HEAD", env: 
env})
   iclas = Hash[*diff.scan(/^[+]notinavail:.*?:(.*?):(.*?):Signed 
CLA/).flatten.reverse]
 end
 
@@ -190,9 +190,9 @@ _html do
                 _div.col_sm_10 do
                   _select.form_control name: "email", id: "email", required: 
true do
                     _option value: ''
-                    iclas.to_a.sort_by {|email, name| email.downcase}.
+                    iclas.to_a.sort_by {|email, _name| email.downcase}.
                       each do |email, name|
-                      _option email.downcase, value: email, data_name:name
+                      _option email.downcase, value: email, data_name: name
                     end
                   end
                 end
@@ -333,7 +333,7 @@ _html do
                   EOF
 
                   msg = "#{@user} account request by #{user.id} for 
#{requestor}"
-                  rc = ASF::SVN.update(ASF::SVN.svnpath!('acreq', 
'new-account-reqs.txt'), msg, env, _) do |dir, input|
+                  rc = ASF::SVN.update(ASF::SVN.svnpath!('acreq', 
'new-account-reqs.txt'), msg, env, _) do |_dir, input|
                     _h2 'Commit messages'
                     input + line + "\n"
                   end
diff --git a/www/officers/surveys.cgi b/www/officers/surveys.cgi
index 096ca71..969c4c2 100755
--- a/www/officers/surveys.cgi
+++ b/www/officers/surveys.cgi
@@ -51,7 +51,7 @@ def get_survey_path(f)
   # test
   begin
     return File.join(ASF::SVN[get_survey_root(true)], filename)
-  rescue Exception => e
+  rescue Exception => _e
     return "ERROR-NO-OFFICERS_SURVEYS-CHECKOUT" # Improve error display in 
browser
   end
 end
@@ -100,7 +100,7 @@ def display_survey(survey_layout)
 end
 
 # Validation as needed within the script
-def validate_survey(formdata: {})
+def validate_survey(_formdata: {})
   return true # TODO: Futureuse
 end
 
diff --git a/www/secretary/public-names.cgi b/www/secretary/public-names.cgi
index 9e3156b..3ba3db7 100755
--- a/www/secretary/public-names.cgi
+++ b/www/secretary/public-names.cgi
@@ -39,7 +39,7 @@ _html do
   _h1 "public names: LDAP vs iclas.txt"
 
   # prefetch LDAP data
-  people = ASF::Person.preload(%w(cn dn))
+  ASF::Person.preload(%w(cn dn))
 
   if @updates
 
@@ -83,16 +83,16 @@ _html do
       end
       path = File.join(ASF::SVN.svnurl('officers'),'iclas.txt')
       env = Struct.new(:user, :password).new($USER, $PASSWORD)
-      ASF::SVN.update(path,message,env,_) do |tmpdir, iclas|
+      ASF::SVN.update(path,message,env,_) do |_tmpdir, iclas|
         updates.each do |id, names|
           pattern = Regexp.new("^#{Regexp.escape(id)}:(.*?):(.*?):")
 
           if names['legal_name']
-            iclas[pattern,1] = names['legal_name'].gsub("\u00A0", ' ')  
+            iclas[pattern,1] = names['legal_name'].gsub("\u00A0", ' ')
           end
 
           if names['public_name']
-            iclas[pattern,2] = names['public_name'].gsub("\u00A0", ' ') 
+            iclas[pattern,2] = names['public_name'].gsub("\u00A0", ' ')
           end
         end
 
@@ -336,7 +336,7 @@ _html do
         input.focus()
 
         # when focus leaves input, replace cell with modified text
-        input.addEventListener(:blur) do |event|
+        input.addEventListener(:blur) do
           parent = input.parentNode
           value = input.value
           input.remove()
diff --git a/www/secretary/workbench/views/parts.js.rb 
b/www/secretary/workbench/views/parts.js.rb
index 567e8ee..1d03045 100644
--- a/www/secretary/workbench/views/parts.js.rb
+++ b/www/secretary/workbench/views/parts.js.rb
@@ -278,7 +278,7 @@ class Parts < Vue
     for i in 0...frames.length
       begin
         frames[i].onkeydown=self.keydown
-      rescue => error
+      rescue => _e
       end
     end
 
@@ -298,7 +298,7 @@ class Parts < Vue
 
     # when back button is clicked, go all of the way back
     history_length =  window.history.length
-    window.addEventListener 'popstate' do |event|
+    window.addEventListener 'popstate' do
       window.history.go(history_length - window.history.length)
     end
 
@@ -364,7 +364,7 @@ class Parts < Vue
   # N.B. @selected is an encoded URI; @menu is not encoded
 
   # burst a PDF into individual pages
-  def burst(event)
+  def burst(_event)
     data = {
       selected: @menu || decodeURI(@selected),
       message: window.parent.location.pathname
@@ -434,7 +434,7 @@ class Parts < Vue
   end
 
   # convert an attachment to pdf
-  def pdfize(event)
+  def pdfize(_event)
     message = window.parent.location.pathname
 
     data = {
@@ -457,7 +457,7 @@ class Parts < Vue
   end
 
   # parse pdf and display extracted data
-  def pdfparse(event)
+  def pdfparse(_event)
     message = window.parent.location.pathname
     attachment = @menu || decodeURI(@selected)
     url = message.sub('/workbench/','/icla-parse/') + attachment
@@ -622,7 +622,7 @@ class Parts < Vue
   end
 
   # cancel drag operation
-  def dragEnd(event)
+  def dragEnd(_event)
     @drag = nil
   end
 

Reply via email to