Fixed Lint/UnusedMethodArgument RuboCop offense
authorŽeljko Filipin <zeljko.filipin@gmail.com>
Wed, 18 Mar 2015 17:50:13 +0000 (18:50 +0100)
committerZfilipin <zfilipin@wikimedia.org>
Wed, 18 Mar 2015 18:02:30 +0000 (18:02 +0000)
$ bundle exec rubocop --auto-correct
Inspecting 25 files
.W.......................

Offenses:

maintenance/jsduck/custom_tags.rb:14:26: W: [Corrected] Unused method
argument - position. If it's necessary, use _ or _position as an
argument name to indicate that it won't be used.
  def parse_doc(scanner, position)
                         ^^^^^^^^
...
25 files inspected, 2 offenses detected, 2 offenses corrected

Bug: T91485
Change-Id: Ide96774c284af97f8d587bd6cde302c4500496ed

.rubocop_todo.yml
maintenance/jsduck/custom_tags.rb

index da1c3af..6c84b52 100644 (file)
@@ -5,11 +5,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: 2
-# Cop supports --auto-correct.
-Lint/UnusedMethodArgument:
-  Enabled: false
-
 # Offense count: 8
 # Cop supports --auto-correct.
 # Configuration parameters: EnforcedStyle, SupportedStyles.
index 2de3ac0..9130227 100644 (file)
@@ -11,7 +11,7 @@ class CommonTag < JsDuck::Tag::Tag
     @repeatable = true
   end
 
-  def parse_doc(scanner, position)
+  def parse_doc(scanner, _position)
     if @multiline
       return { :tagname => @tagname, :doc => :multiline }
     else
@@ -20,7 +20,7 @@ class CommonTag < JsDuck::Tag::Tag
     end
   end
 
-  def process_doc(context, tags, position)
+  def process_doc(context, tags, _position)
     context[@tagname] = tags
   end