Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Renamed Rlint to RubyLint.

Signed-off-by: Yorick Peterse <yorickpeterse@gmail.com>
  • Loading branch information...
commit 6d4efd8c9cc8b978428a44cb39e53679617e62cf 1 parent 1c73d26
@YorickPeterse authored
Showing with 1,134 additions and 1,131 deletions.
  1. +64 −61 MANIFEST
  2. +30 −30 README.md
  3. +1 −1  bin/{rlint → ruby-lint}
  4. +32 −32 lib/ruby-lint/analyze/coding_style.rb
  5. +13 −13 lib/ruby-lint/analyze/definitions.rb
  6. +5 −5 lib/ruby-lint/analyze/method_validation.rb
  7. +5 −5 lib/ruby-lint/analyze/shadowing_variables.rb
  8. +7 −7 lib/ruby-lint/analyze/undefined_variables.rb
  9. +6 −6 lib/ruby-lint/analyze/unused_variables.rb
  10. +11 −11 lib/ruby-lint/callback.rb
  11. +15 −15 lib/ruby-lint/cli.rb
  12. +6 −6 lib/ruby-lint/constant_importer.rb
  13. +10 −10 lib/ruby-lint/definition.rb
  14. +6 −6 lib/ruby-lint/formatter/text.rb
  15. +11 −11 lib/ruby-lint/helper/definition_resolver.rb
  16. +14 −14 lib/ruby-lint/helper/scoping.rb
  17. +22 −22 lib/ruby-lint/iterator.rb
  18. +9 −9 lib/ruby-lint/options.rb
  19. +108 −108 lib/ruby-lint/parser.rb
  20. +3 −3 lib/ruby-lint/parser_error.rb
  21. +7 −7 lib/ruby-lint/report.rb
  22. +4 −4 lib/ruby-lint/token/assignment_token.rb
  23. +7 −7 lib/ruby-lint/token/begin_rescue_token.rb
  24. +3 −3 lib/ruby-lint/token/block_token.rb
  25. +5 −5 lib/ruby-lint/token/case_token.rb
  26. +3 −3 lib/ruby-lint/token/class_token.rb
  27. +8 −8 lib/ruby-lint/token/method_definition_token.rb
  28. +7 −7 lib/ruby-lint/token/method_token.rb
  29. +6 −6 lib/ruby-lint/token/parameters_token.rb
  30. +2 −2 lib/ruby-lint/token/regexp_token.rb
  31. +6 −6 lib/ruby-lint/token/statement_token.rb
  32. +6 −6 lib/ruby-lint/token/token.rb
  33. +3 −3 lib/ruby-lint/token/variable_token.rb
  34. +2 −2 lib/ruby-lint/version.rb
  35. +3 −3 ruby-lint.gemspec
  36. +5 −5 spec/benchmarks/memory.rb
  37. +2 −2 spec/benchmarks/parse_parser.rb
  38. +1 −1  spec/helper.rb
  39. +30 −30 spec/ruby-lint/analyze/coding_style.rb
  40. +25 −25 spec/ruby-lint/analyze/definitions/classes.rb
  41. +22 −22 spec/ruby-lint/analyze/definitions/methods.rb
  42. +41 −41 spec/ruby-lint/analyze/definitions/modules.rb
  43. +8 −8 spec/ruby-lint/analyze/definitions/stdlib.rb
  44. +27 −27 spec/ruby-lint/analyze/definitions/variables.rb
  45. +31 −31 spec/ruby-lint/analyze/method_validation.rb
  46. +6 −6 spec/ruby-lint/analyze/shadowing_variables.rb
  47. +37 −37 spec/ruby-lint/analyze/undefined_variables.rb
  48. +21 −21 spec/ruby-lint/analyze/unused_variables.rb
  49. +7 −7 spec/ruby-lint/callback.rb
  50. +6 −6 spec/ruby-lint/constant_importer.rb
  51. +24 −24 spec/ruby-lint/definition.rb
  52. +4 −4 spec/ruby-lint/formatter/text.rb
  53. +38 −38 spec/ruby-lint/iterator.rb
  54. +28 −28 spec/ruby-lint/parser/arrays.rb
  55. +23 −23 spec/ruby-lint/parser/classes.rb
  56. +3 −3 spec/ruby-lint/parser/errors.rb
  57. +24 −24 spec/ruby-lint/parser/hashes.rb
  58. +50 −50 spec/ruby-lint/parser/methods.rb
  59. +8 −8 spec/ruby-lint/parser/modules.rb
  60. +8 −8 spec/ruby-lint/parser/objects.rb
  61. +14 −14 spec/ruby-lint/parser/operators.rb
  62. +26 −26 spec/ruby-lint/parser/procs.rb
  63. +9 −9 spec/ruby-lint/parser/ranges.rb
  64. +5 −5 spec/ruby-lint/parser/regexp.rb
  65. +17 −17 spec/ruby-lint/parser/scalars.rb
  66. +94 −94 spec/ruby-lint/parser/statements.rb
  67. +37 −37 spec/ruby-lint/parser/variables.rb
  68. +3 −3 spec/ruby-lint/report.rb
View
125 MANIFEST
@@ -11,69 +11,72 @@ doc/.gitkeep
doc/build/.gitkeep
doc/css/.gitkeep
doc/css/common.css
-lib/rlint.rb
-lib/rlint/analyze/coding_style.rb
-lib/rlint/analyze/definitions.rb
-lib/rlint/analyze/method_validation.rb
-lib/rlint/analyze/shadowing_variables.rb
-lib/rlint/analyze/undefined_variables.rb
-lib/rlint/analyze/unused_variables.rb
-lib/rlint/callback.rb
-lib/rlint/cli.rb
-lib/rlint/constant_importer.rb
-lib/rlint/definition.rb
-lib/rlint/formatter/text.rb
-lib/rlint/helper/definition_resolver.rb
-lib/rlint/helper/scoping.rb
-lib/rlint/iterator.rb
-lib/rlint/options.rb
-lib/rlint/parser.rb
-lib/rlint/parser_error.rb
-lib/rlint/report.rb
-lib/rlint/token/assignment_token.rb
-lib/rlint/token/begin_rescue_token.rb
-lib/rlint/token/block_token.rb
-lib/rlint/token/case_token.rb
-lib/rlint/token/class_token.rb
-lib/rlint/token/method_definition_token.rb
-lib/rlint/token/method_token.rb
-lib/rlint/token/parameters_token.rb
-lib/rlint/token/regexp_token.rb
-lib/rlint/token/statement_token.rb
-lib/rlint/token/token.rb
-lib/rlint/token/variable_token.rb
-lib/rlint/version.rb
+lib/ruby-lint.rb
+lib/ruby-lint/analyze/coding_style.rb
+lib/ruby-lint/analyze/definitions.rb
+lib/ruby-lint/analyze/method_validation.rb
+lib/ruby-lint/analyze/shadowing_variables.rb
+lib/ruby-lint/analyze/undefined_variables.rb
+lib/ruby-lint/analyze/unused_variables.rb
+lib/ruby-lint/callback.rb
+lib/ruby-lint/cli.rb
+lib/ruby-lint/constant_importer.rb
+lib/ruby-lint/definition.rb
+lib/ruby-lint/formatter/text.rb
+lib/ruby-lint/helper/definition_resolver.rb
+lib/ruby-lint/helper/scoping.rb
+lib/ruby-lint/iterator.rb
+lib/ruby-lint/options.rb
+lib/ruby-lint/parser.rb
+lib/ruby-lint/parser_error.rb
+lib/ruby-lint/report.rb
+lib/ruby-lint/token/assignment_token.rb
+lib/ruby-lint/token/begin_rescue_token.rb
+lib/ruby-lint/token/block_token.rb
+lib/ruby-lint/token/case_token.rb
+lib/ruby-lint/token/class_token.rb
+lib/ruby-lint/token/method_definition_token.rb
+lib/ruby-lint/token/method_token.rb
+lib/ruby-lint/token/parameters_token.rb
+lib/ruby-lint/token/regexp_token.rb
+lib/ruby-lint/token/statement_token.rb
+lib/ruby-lint/token/token.rb
+lib/ruby-lint/token/variable_token.rb
+lib/ruby-lint/version.rb
ruby-lint.gemspec
spec/benchmarks/memory.rb
spec/benchmarks/parse_parser.rb
+spec/fixtures/stdlib/un.rb
spec/helper.rb
-spec/rlint/analyze/coding_style.rb
-spec/rlint/analyze/definitions/classes.rb
-spec/rlint/analyze/definitions/methods.rb
-spec/rlint/analyze/definitions/modules.rb
-spec/rlint/analyze/definitions/variables.rb
-spec/rlint/analyze/method_validation.rb
-spec/rlint/analyze/shadowing_variables.rb
-spec/rlint/analyze/undefined_variables.rb
-spec/rlint/analyze/unused_variables.rb
-spec/rlint/callback.rb
-spec/rlint/constant_importer.rb
-spec/rlint/definition.rb
-spec/rlint/formatter/text.rb
-spec/rlint/iterator.rb
-spec/rlint/parser/arrays.rb
-spec/rlint/parser/classes.rb
-spec/rlint/parser/errors.rb
-spec/rlint/parser/hashes.rb
-spec/rlint/parser/methods.rb
-spec/rlint/parser/modules.rb
-spec/rlint/parser/objects.rb
-spec/rlint/parser/operators.rb
-spec/rlint/parser/procs.rb
-spec/rlint/parser/ranges.rb
-spec/rlint/parser/regexp.rb
-spec/rlint/parser/scalars.rb
-spec/rlint/parser/statements.rb
-spec/rlint/parser/variables.rb
-spec/rlint/report.rb
+spec/ruby-lint/analyze/coding_style.rb
+spec/ruby-lint/analyze/definitions/classes.rb
+spec/ruby-lint/analyze/definitions/methods.rb
+spec/ruby-lint/analyze/definitions/modules.rb
+spec/ruby-lint/analyze/definitions/stdlib.rb
+spec/ruby-lint/analyze/definitions/variables.rb
+spec/ruby-lint/analyze/method_validation.rb
+spec/ruby-lint/analyze/shadowing_variables.rb
+spec/ruby-lint/analyze/undefined_variables.rb
+spec/ruby-lint/analyze/unused_variables.rb
+spec/ruby-lint/callback.rb
+spec/ruby-lint/constant_importer.rb
+spec/ruby-lint/definition.rb
+spec/ruby-lint/formatter/text.rb
+spec/ruby-lint/iterator.rb
+spec/ruby-lint/parser/arrays.rb
+spec/ruby-lint/parser/classes.rb
+spec/ruby-lint/parser/errors.rb
+spec/ruby-lint/parser/hashes.rb
+spec/ruby-lint/parser/methods.rb
+spec/ruby-lint/parser/modules.rb
+spec/ruby-lint/parser/objects.rb
+spec/ruby-lint/parser/operators.rb
+spec/ruby-lint/parser/procs.rb
+spec/ruby-lint/parser/ranges.rb
+spec/ruby-lint/parser/regexp.rb
+spec/ruby-lint/parser/scalars.rb
+spec/ruby-lint/parser/statements.rb
+spec/ruby-lint/parser/variables.rb
+spec/ruby-lint/report.rb
+task/manifest.rake
task/test.rake
View
60 README.md
@@ -1,12 +1,12 @@
# README
-**Rlint is currently alpha quality, expect things to break and change without
+**RubyLint is currently alpha quality, expect things to break and change without
notice. Patches and bug reports are more than welcome.**
-Rlint (short name for Ruby Lint) is a linter and static code analysis tool for
-Ruby inspired by similar tools such as JSHint. It makes it possible for
-developers to detect errors such as undefined (or unused) variables and the
-use of non existing methods.
+Ruby Lint is a linter and static code analysis tool for Ruby inspired by
+similar tools such as JSHint. It makes it possible for developers to detect
+errors such as undefined (or unused) variables and the use of non existing
+methods.
## Requirements
@@ -15,7 +15,7 @@ use of non existing methods.
## Installation
-Rlint can be installed by running the following command:
+RubyLint can be installed by running the following command:
$ gem install ruby-lint --pre
@@ -28,34 +28,34 @@ abandoned) that uses the same name.
## Usage
-Rlint can be used in two different ways: using the CLI interface and by using
+RubyLint can be used in two different ways: using the CLI interface and by using
the Ruby code directly.
The CLI can be used using the command `rlint`, see the output of `rlint --help`
for more information on how to configure it and how to analyze Ruby files.
The Ruby code itself takes a bit more effort but gives you more flexibility. In
-the future you'll also be able to customize Rlint using a Ruby configuration
+the future you'll also be able to customize RubyLint using a Ruby configuration
files. In order to analyze Ruby code you'll need a few things:
-* An instance of `Rlint::Iterator`
-* An instance of `Rlint::Report`
+* An instance of `RubyLint::Iterator`
+* An instance of `RubyLint::Report`
* A formatter for the report
* A block of Ruby code
-* A number of analyzer classes such as `Rlint::Analyze::UndefinedVariables`
+* A number of analyzer classes such as `RubyLint::Analyze::UndefinedVariables`
A short example is the following:
require 'ruby-lint'
code = 'obviously your Ruby code goes in here'
- tokens = Rlint::Parser.new(code).parse
- report = Rlint::Report.new
- formatter = Rlint::Formatter.new
- iterator = Rlint::Iterator.new(report)
+ tokens = RubyLint::Parser.new(code).parse
+ report = RubyLint::Report.new
+ formatter = RubyLint::Formatter.new
+ iterator = RubyLint::Iterator.new(report)
- iterator.bind(Rlint::Analyze::Definitions)
- iterator.bind(Rlint::Analyze::MethodValidation)
+ iterator.bind(RubyLint::Analyze::Definitions)
+ iterator.bind(RubyLint::Analyze::MethodValidation)
iterator.run(tokens)
@@ -63,11 +63,11 @@ A short example is the following:
## Design
-Rlint's design is broken up into 5 different parts:
+RubyLint's design is broken up into 5 different parts:
* A parser that turns a block of Ruby code into an AST.
* A class that iterates over this AST and executes callback methods (aptly
- named `Rlint::Iterator`).
+ named `RubyLint::Iterator`).
* A set of callback classes that are used by an iterator. These callback
classes perform the actual data analysis.
* A report for storing error messages, warnings and informal messages.
@@ -82,27 +82,27 @@ The process of analyzing code basically looks like the following:
|
v
+---------------+
- | Rlint::Parser |
+ | RubyLint::Parser |
+---------------+
|
v
+-----------------+
- | Rlint::Iterator |
+ | RubyLint::Iterator |
+-----------------+
|
v
+---------------------------+
- | Rlint::Callback instances |
+ | RubyLint::Callback instances |
+---------------------------+
|
v
+---------------+
- | Rlint::Report |
+ | RubyLint::Report |
+---------------+
|
v
+----------------------------+
- | Rlint::Formatter instances |
+ | RubyLint::Formatter instances |
+----------------------------+
|
v
@@ -117,18 +117,18 @@ there's no single giant lump of code that does everything.
## Compatibility Issues
-Currently Rlint can only be executed using MRI 1.9.3, it does not run on MRI
+Currently RubyLint can only be executed using MRI 1.9.3, it does not run on MRI
1.8.x due to the lack of Ripper. It also does not yet run without errors on
MRI 2.0 as the addition of named variables changes the Ripper output, something
-Rlint doesn't properly handle at the moment.
+RubyLint doesn't properly handle at the moment.
-For the time being Rlint will stick to using Ripper which means it's also
+For the time being RubyLint will stick to using Ripper which means it's also
limited to MRI 1.9.x/2.0.x. I've been looking around for alternatives so that
-Rlint can be run on Jruby/Rubinius in the future but so far I haven't really
-found a worthy alternative. For now I'd rather focus on making Rlint work on
+RubyLint can be run on Jruby/Rubinius in the future but so far I haven't really
+found a worthy alternative. For now I'd rather focus on making RubyLint work on
one implementation instead of a number of different ones.
-Also keep in mind that while in theory Rlint should run on MRI 1.8.x I couldn't
+Also keep in mind that while in theory RubyLint should run on MRI 1.8.x I couldn't
get the "ripper" gem to install properly, thus I'm unable to confirm this. Feel
free to try it out but I won't bother with MRI 1.8.x myself if it requires more
than a few minutes worth of work.
View
2  bin/rlint → bin/ruby-lint
@@ -3,4 +3,4 @@
require File.expand_path('../../lib/ruby-lint', __FILE__)
require 'ruby-lint/cli'
-Rlint::CLI.new.run
+RubyLint::CLI.new.run
View
64 lib/ruby-lint/analyze/coding_style.rb
@@ -1,7 +1,7 @@
-module Rlint
+module RubyLint
module Analyze
##
- # {Rlint::Analyze::CodingStyle} checks if a block of code matches a given
+ # {RubyLint::Analyze::CodingStyle} checks if a block of code matches a given
# set of coding standards. While none of the problems found by this class
# are considered harmful they are usually frowned upon as they do not
# follow the unofficial but generally accepted Ruby coding standards.
@@ -21,7 +21,7 @@ module Analyze
# This class checks for the following:
#
# * The length of method and variable names, should be less than the value
- # set in {Rlint::Analyze::CodingStyle::MAXIMUM\_NAME\_LENGTH}.
+ # set in {RubyLint::Analyze::CodingStyle::MAXIMUM\_NAME\_LENGTH}.
# * The use of class variables (it's relatively rare that you actually need
# those).
# * The use of parenthesis around various statements: these are not needed
@@ -32,7 +32,7 @@ module Analyze
# * If a particular method name should be replaced by a different one (e.g.
# "map" instead of "collect").
#
- class CodingStyle < Rlint::Callback
+ class CodingStyle < RubyLint::Callback
##
# A short description of this class.
#
@@ -62,7 +62,7 @@ class CodingStyle < Rlint::Callback
}
##
- # @see Rlint::Callback#initialize
+ # @see RubyLint::Callback#initialize
#
def initialize(*args)
super
@@ -79,9 +79,9 @@ def initialize(*args)
# * Whether or not instance variables are `snake_cased` instead of
# camelCased.
# * Whether or not the length of an instance variable is smaller than the
- # value defined in {Rlint::Analyze::CodingStyle::MAXIMUM\_NAME\_LENGTH}.
+ # value defined in {RubyLint::Analyze::CodingStyle::MAXIMUM\_NAME\_LENGTH}.
#
- # @param [Rlint::Token::VariableToken] token The token containing details
+ # @param [RubyLint::Token::VariableToken] token The token containing details
# about the variable.
#
def on_instance_variable(token)
@@ -92,10 +92,10 @@ def on_instance_variable(token)
# Called when a class variable is found.
#
# This method will check for the same things as
- # {Rlint::Analyze::CodingStyle#on_instance_variable} along with adding an
+ # {RubyLint::Analyze::CodingStyle#on_instance_variable} along with adding an
# info message about class variables being discouraged.
#
- # @see Rlint::Analyze::CodingStyle#on_instance_variable
+ # @see RubyLint::Analyze::CodingStyle#on_instance_variable
#
def on_class_variable(token)
validate_name(token)
@@ -110,7 +110,7 @@ def on_class_variable(token)
##
# Called when a constant is found.
#
- # @see Rlint::Analyze::CodingStyle#on_instance_variable
+ # @see RubyLint::Analyze::CodingStyle#on_instance_variable
#
def on_constant(token)
validate_name_length(token)
@@ -119,7 +119,7 @@ def on_constant(token)
##
# Called when a global variable is found.
#
- # @see Rlint::Analyze::CodingStyle#on_instance_variable
+ # @see RubyLint::Analyze::CodingStyle#on_instance_variable
#
def on_global_variable(token)
validate_name(token)
@@ -128,7 +128,7 @@ def on_global_variable(token)
##
# Called when an instance variable is found.
#
- # @see Rlint::Analyze::CodingStyle#on_instance_variable
+ # @see RubyLint::Analyze::CodingStyle#on_instance_variable
#
def on_local_variable(token)
validate_name(token)
@@ -141,8 +141,8 @@ def on_local_variable(token)
# instance variables) as well as adding a warning when an instance
# variable is assigned.
#
- # @see Rlint::Analyze::CodingStyle#on_instance_variable
- # @see Rlint::Analyze::CodingStyle#on_class_variable
+ # @see RubyLint::Analyze::CodingStyle#on_instance_variable
+ # @see RubyLint::Analyze::CodingStyle#on_class_variable
#
def on_assignment(token)
validate_name(token)
@@ -159,7 +159,7 @@ def on_assignment(token)
##
# Called when a return statement is found.
#
- # @param [Rlint::Token::StatementToken] token The token of the return
+ # @param [RubyLint::Token::StatementToken] token The token of the return
# statement.
#
def on_return(token)
@@ -184,7 +184,7 @@ def on_return(token)
# to instance variables as well as checking if the method definition
# modifies a core Ruby constant.
#
- # @see Rlint::Analyze::CodingStyle#on_instance_variable
+ # @see RubyLint::Analyze::CodingStyle#on_instance_variable
#
def on_method_definition(token)
validate_name(token)
@@ -200,7 +200,7 @@ def on_method_definition(token)
# Called when a class is created. This callback adds a warning if a core
# Ruby constant is modified.
#
- # @param [Rlint::Token::ClassToken] token Token class containing details
+ # @param [RubyLint::Token::ClassToken] token Token class containing details
# about the newly created class.
#
def on_class(token)
@@ -211,7 +211,7 @@ def on_class(token)
# Called after a method token has been processed. This callback checks if
# a method is a predicate method and if so if the name is set correctly.
#
- # @param [Rlint::Token::MethodDefinitionToken] token The token containing
+ # @param [RubyLint::Token::MethodDefinitionToken] token The token containing
# details about the method definition.
# @todo This method currently only performs a very limited check for
# predicate methods. Once a proper scoping system has been implemented
@@ -236,7 +236,7 @@ def after_method_definition(token)
# This method checks if the used method should be named differently
# instead (e.g. "map" instead of "collect").
#
- # @param [Rlint::Token::MethodToken] token Token containing details about
+ # @param [RubyLint::Token::MethodToken] token Token containing details about
# the method.
#
def on_method(token)
@@ -260,7 +260,7 @@ def on_method(token)
# This method checks to see if there are any parenthesis around the
# statement and adds an info message if this is the case.
#
- # @param [Rlint::Token::StatementToken] token The token containing
+ # @param [RubyLint::Token::StatementToken] token The token containing
# details about the if statement.
#
def on_if(token)
@@ -270,7 +270,7 @@ def on_if(token)
##
# Called when an elsif statement is found.
#
- # @see Rlint::Analyze::CodingStyle#on_if
+ # @see RubyLint::Analyze::CodingStyle#on_if
#
def on_elsif(token)
validate_parenthesis(token)
@@ -279,7 +279,7 @@ def on_elsif(token)
##
# Called when a while statement is found.
#
- # @see Rlint::Analyze::CodingStyle#on_if
+ # @see RubyLint::Analyze::CodingStyle#on_if
#
def on_while(token)
validate_parenthesis(token)
@@ -288,7 +288,7 @@ def on_while(token)
##
# Called when a case statement is found.
#
- # @see Rlint::Analyze::CodingStyle#on_if
+ # @see RubyLint::Analyze::CodingStyle#on_if
#
def on_case(token)
validate_parenthesis(token)
@@ -297,7 +297,7 @@ def on_case(token)
##
# Called when a when statement is found.
#
- # @see Rlint::Analyze::CodingStyle#on_if
+ # @see RubyLint::Analyze::CodingStyle#on_if
#
def on_when(token)
validate_parenthesis(token)
@@ -306,7 +306,7 @@ def on_when(token)
##
# Called when an until statement is found.
#
- # @see Rlint::Analyze::CodingStyle#on_if
+ # @see RubyLint::Analyze::CodingStyle#on_if
#
def on_until(token)
validate_parenthesis(token)
@@ -315,7 +315,7 @@ def on_until(token)
##
# Called when an unless statement is found.
#
- # @see Rlint::Analyze::CodingStyle#on_if
+ # @see RubyLint::Analyze::CodingStyle#on_if
#
def on_unless(token)
validate_parenthesis(token)
@@ -327,7 +327,7 @@ def on_unless(token)
# Validates the name of the specified token. This method will check for
# the use of camelCase as well as checking for the length of the name.
#
- # @param [Rlint::Token::Token] token The token to validate.
+ # @param [RubyLint::Token::Token] token The token to validate.
#
def validate_name(token)
if !token.respond_to?(:name) or !token.name
@@ -348,9 +348,9 @@ def validate_name(token)
##
# Checks if the name of the given token is too long or not. The maximum
# length of names is set in
- # {Rlint::Analyze::CodingStyle::MAXIMUM\_NAME\_LENGTH}.
+ # {RubyLint::Analyze::CodingStyle::MAXIMUM\_NAME\_LENGTH}.
#
- # @param [Rlint::Token::Token] token The token to validate.
+ # @param [RubyLint::Token::Token] token The token to validate.
#
def validate_name_length(token)
if !token.respond_to?(:name) or !token.name
@@ -370,7 +370,7 @@ def validate_name_length(token)
##
# Checks if there are any parenthesis wrapped around a statement.
#
- # @param [Rlint::Token::Token] token The token to validate.
+ # @param [RubyLint::Token::Token] token The token to validate.
#
def validate_parenthesis(token)
if token.code =~ /#{token.type}\s*\(/
@@ -385,7 +385,7 @@ def validate_parenthesis(token)
##
# Adds a warning for modifying a core Ruby constant.
#
- # @param [Rlint::Token::Token] token The token class to validate.
+ # @param [RubyLint::Token::Token] token The token class to validate.
#
def validate_ruby_constant_modification(token)
if token.name.is_a?(Array)
@@ -404,4 +404,4 @@ def validate_ruby_constant_modification(token)
end
end # CodingStyle
end # Analyze
-end # Rlint
+end # RubyLint
View
26 lib/ruby-lint/analyze/definitions.rb
@@ -1,15 +1,15 @@
-module Rlint
+module RubyLint
module Analyze
##
- # {Rlint::Analyze::Definitions} is a callback class that is used for
+ # {RubyLint::Analyze::Definitions} is a callback class that is used for
# building a list of all the definitions (variables, methods, etc) of a
# block of Ruby code.
#
- # The resulting instance of {Rlint::Definition} is stored in the `@storage`
+ # The resulting instance of {RubyLint::Definition} is stored in the `@storage`
# instance variable under the key `:scope`. This makes it possible for
# other callback classes to access this data easily.
#
- class Definitions < Rlint::Callback
+ class Definitions < RubyLint::Callback
include Helper::Scoping
##
@@ -47,7 +47,7 @@ class Definitions < Rlint::Callback
##
# Called when a value is assigned to a variable.
#
- # @param [Rlint::Token::AssignmentToken] token
+ # @param [RubyLint::Token::AssignmentToken] token
#
def on_assignment(token)
if token.type == :global_variable
@@ -89,7 +89,7 @@ def on_assignment(token)
##
# Called when a new method is defined.
#
- # @param [Rlint::Token::MethodDefinitionToken] token
+ # @param [RubyLint::Token::MethodDefinitionToken] token
#
def on_method_definition(token)
type = :instance_method
@@ -123,7 +123,7 @@ def on_method_definition(token)
##
# Called after a method definition has been processed.
#
- # @see Rlint::Analyze::Definitions#on_method_definition
+ # @see RubyLint::Analyze::Definitions#on_method_definition
#
def after_method_definition(token)
# TODO: exporting these variables should only be done if the method is
@@ -140,7 +140,7 @@ def after_method_definition(token)
##
# Called when a class definition is found.
#
- # @param [Rlint::Token::ClassToken] token
+ # @param [RubyLint::Token::ClassToken] token
#
def on_class(token)
name = token.name.join('::')
@@ -167,7 +167,7 @@ def on_class(token)
##
# Called after a class definition was found and processed.
#
- # @see Rlint::Analyze::Definitions#on_class
+ # @see RubyLint::Analyze::Definitions#on_class
#
def after_class(token)
@scopes.pop
@@ -177,7 +177,7 @@ def after_class(token)
##
# Called when a module is defined.
#
- # @param [Rlint::Token::Token] token
+ # @param [RubyLint::Token::Token] token
#
def on_module(token)
name = token.name.join('::')
@@ -203,7 +203,7 @@ def on_module(token)
##
# Called after a module definition has been processed.
#
- # @see Rlint::Analyze::Definitions#on_module
+ # @see RubyLint::Analyze::Definitions#on_module
#
def after_module(token)
@scopes.pop
@@ -214,7 +214,7 @@ def after_module(token)
# Called when a method call is found. This callback is used to extend
# classes using modules.
#
- # @param [Rlint::Token::MethodToken] token
+ # @param [RubyLint::Token::MethodToken] token
#
def on_method(token)
if INCLUDE_SYMBOLS.key?(token.name)
@@ -241,4 +241,4 @@ def on_method(token)
end
end # Definitions
end # Analyze
-end # Rlint
+end # RubyLint
View
10 lib/ruby-lint/analyze/method_validation.rb
@@ -1,11 +1,11 @@
-module Rlint
+module RubyLint
module Analyze
##
- # {Rlint::Analyze::MethodValidation} is used to validate method calls.
+ # {RubyLint::Analyze::MethodValidation} is used to validate method calls.
# Errors are added for calling undefined methods, calling methods with
# invalid parameters and so on.
#
- class MethodValidation < Rlint::Callback
+ class MethodValidation < RubyLint::Callback
include Helper::DefinitionResolver
##
@@ -37,7 +37,7 @@ class MethodValidation < Rlint::Callback
##
# Called when a method call is found.
#
- # @param [Rlint::Token::MethodToken] token
+ # @param [RubyLint::Token::MethodToken] token
#
def on_method(token)
# Method called on a receiver (e.g. `String.new`).
@@ -101,4 +101,4 @@ def on_method(token)
end
end # MethodValidation
end # Analyze
-end # Rlint
+end # RubyLint
View
10 lib/ruby-lint/analyze/shadowing_variables.rb
@@ -1,10 +1,10 @@
-module Rlint
+module RubyLint
module Analyze
##
- # {Rlint::Analyze::ShadowingVariables} is used to add warnings when block
+ # {RubyLint::Analyze::ShadowingVariables} is used to add warnings when block
# parameters shadow outer local variables.
#
- class ShadowingVariables < Rlint::Callback
+ class ShadowingVariables < RubyLint::Callback
include Helper::DefinitionResolver
##
@@ -19,7 +19,7 @@ class ShadowingVariables < Rlint::Callback
# parameters of the block shadow existing local variables defined in the
# outer scope.
#
- # @param [Rlint::Token::BlockToken] token The token of the block.
+ # @param [RubyLint::Token::BlockToken] token The token of the block.
#
def on_block(token)
token.parameters.each do |param|
@@ -34,4 +34,4 @@ def on_block(token)
end
end # ShadowingVariables
end # Analyze
-end # Rlint
+end # RubyLint
View
14 lib/ruby-lint/analyze/undefined_variables.rb
@@ -1,10 +1,10 @@
-module Rlint
+module RubyLint
module Analyze
##
- # {Rlint::Analyze::UndefinedVariables} is used to add errors for the use of
+ # {RubyLint::Analyze::UndefinedVariables} is used to add errors for the use of
# undefined variables.
#
- class UndefinedVariables < Rlint::Callback
+ class UndefinedVariables < RubyLint::Callback
include Helper::DefinitionResolver
##
@@ -37,7 +37,7 @@ class UndefinedVariables < Rlint::Callback
# Called when a variable assignment is found. Used to validate constant
# paths before assigning data to them.
#
- # @param [Rlint::Token::AssignmentToken] token
+ # @param [RubyLint::Token::AssignmentToken] token
#
def on_assignment(token)
on_constant_path(token) if token.name.is_a?(Array)
@@ -46,7 +46,7 @@ def on_assignment(token)
##
# Called when a constant path is found.
#
- # @param [Rlint::Token::VariableToken] token
+ # @param [RubyLint::Token::VariableToken] token
#
def on_constant_path(token)
current = scope
@@ -73,7 +73,7 @@ def on_constant_path(token)
##
# Called when a method call is found.
#
- # @param [Rlint::Token::MethodToken] token
+ # @param [RubyLint::Token::MethodToken] token
#
def on_method(token)
kernel_method = false
@@ -96,4 +96,4 @@ def on_method(token)
end
end # UndefinedVariables
end # Analyze
-end # Rlint
+end # RubyLint
View
12 lib/ruby-lint/analyze/unused_variables.rb
@@ -1,10 +1,10 @@
-module Rlint
+module RubyLint
module Analyze
##
- # {Rlint::Analyze::UnusedVariables} is used to check for unused local,
+ # {RubyLint::Analyze::UnusedVariables} is used to check for unused local,
# instance, class and global variables.
#
- class UnusedVariables < Rlint::Callback
+ class UnusedVariables < RubyLint::Callback
include Helper::DefinitionResolver
##
@@ -45,7 +45,7 @@ class UnusedVariables < Rlint::Callback
end
##
- # @see Rlint::Callback#initialize
+ # @see RubyLint::Callback#initialize
#
def initialize(*args)
super
@@ -81,7 +81,7 @@ def after_new_scope
##
# Called when a variable is assigned.
#
- # @param [Rlint::Token::AssignmentToken] token
+ # @param [RubyLint::Token::AssignmentToken] token
#
def on_assignment(token)
unused_variables[token.name] = token
@@ -100,4 +100,4 @@ def unused_variables
end
end # UnusedVariables
end # Analyze
-end # Rlint
+end # RubyLint
View
22 lib/ruby-lint/callback.rb
@@ -1,30 +1,30 @@
-module Rlint
+module RubyLint
##
- # {Rlint::Callback} is a class that can be used (but you're not required to)
+ # {RubyLint::Callback} is a class that can be used (but you're not required to)
# to remove some common boilerplate code from custom callback classes.
#
# Using this class can be done by simply extending it:
#
- # class MyCallback < Rlint::Callback
+ # class MyCallback < RubyLint::Callback
#
# end
#
# Once extended the following helper methods are provided:
#
- # * {Rlint::Callback#error}
- # * {Rlint::Callback#warning}
- # * {Rlint::Callback#info}
+ # * {RubyLint::Callback#error}
+ # * {RubyLint::Callback#warning}
+ # * {RubyLint::Callback#info}
#
# These 3 methods can be used to add data to a report. If no report is set
# the methods will not execute any code. This means your own code does not
- # have to check for a valid instance of {Rlint::Report} in the `@report`
+ # have to check for a valid instance of {RubyLint::Report} in the `@report`
# instance variable every time you want to add data to it.
#
class Callback
##
# Creates a new instance of the class and stores the report.
#
- # @param [Rlint::Report|NilClass] report The report instance to use.
+ # @param [RubyLint::Report|NilClass] report The report instance to use.
# @param [Hash] options A hash containing custom options to set for the
# callback.
#
@@ -49,7 +49,7 @@ def error(message, line, column)
##
# Adds a warning message to the report.
#
- # @see Rlint::Callback#error
+ # @see RubyLint::Callback#error
#
def warning(message, line, column)
@report.add(:warning, message, line, column) if @report
@@ -58,10 +58,10 @@ def warning(message, line, column)
##
# Adds a regular informational message to the report.
#
- # @see Rlint::Callback#error
+ # @see RubyLint::Callback#error
#
def info(message, line, column)
@report.add(:info, message, line, column) if @report
end
end # Callback
-end # Rlint
+end # RubyLint
View
30 lib/ruby-lint/cli.rb
@@ -1,21 +1,21 @@
require 'optparse'
-module Rlint
+module RubyLint
##
- # {Rlint::CLI} is the commandline interface to Rlint.
+ # {RubyLint::CLI} is the commandline interface to RubyLint.
#
class CLI
##
# Creates a new instance of the class and configures OptionParser.
#
def initialize
- @formatters = constant_short_names(Rlint::Formatter)
- @analyzers = constant_short_names(Rlint::Analyze)
+ @formatters = constant_short_names(RubyLint::Formatter)
+ @analyzers = constant_short_names(RubyLint::Analyze)
@option_parser = OptionParser.new do |opts|
opts.banner = 'A static code analysis tool and linter for Ruby'
opts.program_name = 'rlint'
- opts.version = Rlint::VERSION
+ opts.version = RubyLint::VERSION
opts.summary_indent = ' '
opts.separator ''
@@ -44,7 +44,7 @@ def initialize
String
) do |formatter|
if @formatters.key?(formatter)
- Rlint.options.formatter = @formatters[formatter]
+ RubyLint.options.formatter = @formatters[formatter]
end
end
@@ -54,7 +54,7 @@ def initialize
'The reporting levels to enable',
Array
) do |levels|
- Rlint.options.levels = levels.map { |level| level.to_sym }
+ RubyLint.options.levels = levels.map { |level| level.to_sym }
end
opts.on(
@@ -73,7 +73,7 @@ def initialize
end
end
- Rlint.options.analyzers = analyzers
+ RubyLint.options.analyzers = analyzers
end
opts.on('-h', '--help', 'Shows this help message') do
@@ -88,7 +88,7 @@ def initialize
end
##
- # Runs Rlint.
+ # Runs RubyLint.
#
# @param [Array] argv Array of commandline parameters.
#
@@ -102,11 +102,11 @@ def run(argv = ARGV)
code = File.read(file, File.size(file))
tokens = Parser.new(code, file).parse
- report = Report.new(file, Rlint.options.levels)
+ report = Report.new(file, RubyLint.options.levels)
iterator = Iterator.new(report)
- formatter = Rlint.options.formatter.new
+ formatter = RubyLint.options.formatter.new
- Rlint.options.analyzers.each { |const| iterator.bind(const) }
+ RubyLint.options.analyzers.each { |const| iterator.bind(const) }
iterator.run(tokens)
@@ -117,10 +117,10 @@ def run(argv = ARGV)
end
##
- # Shows the current version of Rlint.
+ # Shows the current version of RubyLint.
#
def version
- puts "Rlint version #{Rlint::VERSION} running on #{RUBY_DESCRIPTION}"
+ puts "RubyLint version #{RubyLint::VERSION} running on #{RUBY_DESCRIPTION}"
exit
end
@@ -164,4 +164,4 @@ def hash_to_list(hash)
return list.join("\n")
end
end # CLI
-end # Rlint
+end # RubyLint
View
12 lib/ruby-lint/constant_importer.rb
@@ -1,7 +1,7 @@
-module Rlint
+module RubyLint
##
- # {Rlint::ConstantImporter} is a module that can be used to create a list of
- # method definitions (using {Rlint::Token::MethodDefinitionToken} for a
+ # {RubyLint::ConstantImporter} is a module that can be used to create a list of
+ # method definitions (using {RubyLint::Token::MethodDefinitionToken} for a
# supplied list of constant names.
#
module ConstantImporter
@@ -28,7 +28,7 @@ module ConstantImporter
##
# Hash containing the parameter types as returned by `Method#parameters`
# and the attributes they should be stored in in an instance of
- # {Rlint::Token::ParametersToken}.
+ # {RubyLint::Token::ParametersToken}.
#
# @return [Hash]
#
@@ -41,7 +41,7 @@ module ConstantImporter
##
# Imports the methods of a given list of constant names and returns a Hash
- # containing instances of {Rlint::Definition} for each imported constant.
+ # containing instances of {RubyLint::Definition} for each imported constant.
#
# @param [Array] constants An array of constant to import.
# @param [Mixed] source_constant The source constant to use for the
@@ -99,4 +99,4 @@ def self.import(constants, source_constant = Object)
return imported
end
end # ConstantImporter
-end # Rlint
+end # RubyLint
View
20 lib/ruby-lint/definition.rb
@@ -1,6 +1,6 @@
-module Rlint
+module RubyLint
##
- # {Rlint::Definition} is a class used for storing scoping/definition related
+ # {RubyLint::Definition} is a class used for storing scoping/definition related
# information such as the methods that are available for various constants,
# variables that have been defined, etc.
#
@@ -10,7 +10,7 @@ module Rlint
#
# Basic example of using this class:
#
- # scope = Rlint::Definition.new
+ # scope = RubyLint::Definition.new
#
# scope.lookup(:local_variable, 'name') # => nil
#
@@ -72,7 +72,7 @@ class Definition
##
# An array containing all the constant names that belong to the constant
- # set in {Rlint::Definition#constant}. Each name is saved as a String.
+ # set in {RubyLint::Definition#constant}. Each name is saved as a String.
#
# @return [Array]
#
@@ -81,8 +81,8 @@ class Definition
##
# Creates a new instance of the scope class and sets the default symbols.
#
- # @param [Array|Rlint::Definition] parent The parent scope(s). Set this to
- # an Array of {Rlint::Definition} instances to use multiple parent scopes.
+ # @param [Array|RubyLint::Definition] parent The parent scope(s). Set this to
+ # an Array of {RubyLint::Definition} instances to use multiple parent scopes.
# @param [Hash] options A hash containing custom options.
#
# @option options [TrueClass|FalseClass] :lazy When set to `true` missing
@@ -93,7 +93,7 @@ class Definition
# constants, set to `Object` by default.
# @option options [TrueClass|FalseClass] :reset When set to `true` the
# `value` attribute of the token will be set to `nil`
- # @option options [Rlint::Token::Token] :token The token to set for the
+ # @option options [RubyLint::Token::Token] :token The token to set for the
# scope.
#
def initialize(parent = [], options = {})
@@ -184,7 +184,7 @@ def lookup(type, name)
##
# Returns the token associated with the scope.
#
- # @return [Rlint::Token::Token|NilClass]
+ # @return [RubyLint::Token::Token|NilClass]
#
def token
return @options[:token]
@@ -193,7 +193,7 @@ def token
##
# Sets the token of the scope.
#
- # @param [Rlint::Token::Token] token The token to use.
+ # @param [RubyLint::Token::Token] token The token to use.
#
def token=(token)
@options[:token] = token.dup
@@ -227,4 +227,4 @@ def lookup_parent?(type)
return LOOKUP_PARENT.include?(type) && !@parent.empty?
end
end # Definition
-end # Rlint
+end # RubyLint
View
12 lib/ruby-lint/formatter/text.rb
@@ -1,7 +1,7 @@
-module Rlint
+module RubyLint
module Formatter
##
- # {Rlint::Formatter::Text} is a formatter class that formats a report in a
+ # {RubyLint::Formatter::Text} is a formatter class that formats a report in a
# format similar to the one used by Ruby when validating a Ruby file using
# the `ruby` executable. An example of this format is the following:
#
@@ -10,8 +10,8 @@ module Formatter
#
# Basic usage of this formatter is as following:
#
- # report = Rlint::Report.new
- # formatter = Rlint::Formatter::Text.new
+ # report = RubyLint::Report.new
+ # formatter = RubyLint::Formatter::Text.new
#
# # Add some data to the report.
# # ...
@@ -29,7 +29,7 @@ class Text
##
# Formats the specified report.
#
- # @param [Rlint::Report] report The report to format.
+ # @param [RubyLint::Report] report The report to format.
# @return [String]
#
def format(report)
@@ -51,4 +51,4 @@ def format(report)
end
end # Text
end # Formatter
-end # Rlint
+end # RubyLint
View
22 lib/ruby-lint/helper/definition_resolver.rb
@@ -1,10 +1,10 @@
-module Rlint
+module RubyLint
module Helper
##
- # {Rlint::Helper::DefinitionResolver} is a helper module that can be used
- # to work with scoping information similar to {Rlint::Helper::Scoping}.
+ # {RubyLint::Helper::DefinitionResolver} is a helper module that can be used
+ # to work with scoping information similar to {RubyLint::Helper::Scoping}.
#
- # This module depends on {Rlint::Helper::Scoping} and will include it
+ # This module depends on {RubyLint::Helper::Scoping} and will include it
# automatically.
#
# ## Methods
@@ -44,7 +44,7 @@ def on_finish
##
# Sets the scope for the current method definition.
#
- # @param [Rlint::Token::MethodDefinitionToken] token
+ # @param [RubyLint::Token::MethodDefinitionToken] token
#
def on_method_definition(token)
@scopes << scope.lookup(
@@ -60,7 +60,7 @@ def on_method_definition(token)
##
# Resets the scope back to the one used before the method definition.
#
- # @see Rlint::Helper::DefinitionResolver#on_method_definition
+ # @see RubyLint::Helper::DefinitionResolver#on_method_definition
#
def after_method_definition(token)
@scopes.pop
@@ -72,7 +72,7 @@ def after_method_definition(token)
##
# Sets the scope for the current class.
#
- # @param [Rlint::Token::ClassToken] token
+ # @param [RubyLint::Token::ClassToken] token
#
def on_class(token)
name = token.name.join('::')
@@ -87,7 +87,7 @@ def on_class(token)
##
# Resets the scope back to the one used before the class definition.
#
- # @see Rlint::Helper::DefinitionResolver#on_class
+ # @see RubyLint::Helper::DefinitionResolver#on_class
#
def after_class(token)
@scopes.pop
@@ -100,7 +100,7 @@ def after_class(token)
##
# Sets the scope for the current module.
#
- # @param [Rlint::Token::Token] token
+ # @param [RubyLint::Token::Token] token
#
def on_module(token)
name = token.name.join('::')
@@ -115,7 +115,7 @@ def on_module(token)
##
# Resets the scope back to the one used before the module definition.
#
- # @see Rlint::Helper::DefinitionResolver#on_module
+ # @see RubyLint::Helper::DefinitionResolver#on_module
#
def after_module(token)
@scopes.pop
@@ -140,4 +140,4 @@ def call_method(method, *args)
end
end # DefinitionResolver
end # Helper
-end # Rlint
+end # RubyLint
View
28 lib/ruby-lint/helper/scoping.rb
@@ -1,11 +1,11 @@
-module Rlint
+module RubyLint
module Helper
##
- # {Rlint::Helper::Scoping} is a helper module that can be used to more
+ # {RubyLint::Helper::Scoping} is a helper module that can be used to more
# easily access scoping related information in subclasses of
- # {Rlint::Callback}.
+ # {RubyLint::Callback}.
#
- # Note that unlike {Rlint::Helper::DefinitionResolver} this method does not
+ # Note that unlike {RubyLint::Helper::DefinitionResolver} this method does not
# automatically update the `@scopes` array mentioned below, it merely
# creates the required variables and provides a few helper methods.
#
@@ -24,18 +24,18 @@ module Helper
# that includes this module:
#
# * `@scopes`: an array that should be updated with instance of
- # {Rlint::Definition} based on the current scope.
+ # {RubyLint::Definition} based on the current scope.
# * `@namespace`: array containing the constant names for the current
# namespace.
#
# The following keys are set in the `@storage` instance variable:
#
- # * `:scope`: an instance of {Rlint::Definition} that will contain the
+ # * `:scope`: an instance of {RubyLint::Definition} that will contain the
# definition list of the current block of code that's being analyzed.
#
module Scoping
##
- # @see Rlint::Callback#initialize
+ # @see RubyLint::Callback#initialize
#
def initialize(*args)
super
@@ -56,7 +56,7 @@ def initialize(*args)
# constant path.
#
# @param [Array] path The constant path.
- # @return [Rlint::Definition]
+ # @return [RubyLint::Definition]
#
def resolve_definition(path)
current = scope
@@ -72,7 +72,7 @@ def resolve_definition(path)
##
# Checks if the specified token's name is a valid constant path.
#
- # @param [Rlint::Token::VariableToken] token The token to validate.
+ # @param [RubyLint::Token::VariableToken] token The token to validate.
# @return [TrueClass|FalseClass]
#
def valid_constant_path?(token)
@@ -93,12 +93,12 @@ def valid_constant_path?(token)
##
# Checks if the specified type and token result in a valid
- # {Rlint::Definition} instance.
+ # {RubyLint::Definition} instance.
#
# @param [#to_sym] type The type of data to look up.
- # @param [Rlint::Token::VariableToken] token The token containing details
+ # @param [RubyLint::Token::VariableToken] token The token containing details
# about the variable.
- # @param [Rlint::Definition] scope The scope to use for looking up the
+ # @param [RubyLint::Definition] scope The scope to use for looking up the
# data.
# @return [TrueClass|FalseClass]
#
@@ -128,11 +128,11 @@ def call_type
# Returns the current scope. This method is primarily used to make the
# code in this class a bit more pleasant to read.
#
- # @return [Rlint::Definition]
+ # @return [RubyLint::Definition]
#
def scope
return !@scopes.empty? ? @scopes[-1] : @storage[:scope]
end
end # Scoping
end # Helper
-end # Rlint
+end # RubyLint
View
44 lib/ruby-lint/iterator.rb
@@ -1,7 +1,7 @@
-module Rlint
+module RubyLint
##
- # {Rlint::Iterator} is a class that can be used to iterate over the AST
- # generated by {Rlint::Parser} and execute callback methods for each
+ # {RubyLint::Iterator} is a class that can be used to iterate over the AST
+ # generated by {RubyLint::Parser} and execute callback methods for each
# encountered node. Basic usage is as following:
#
# code = <<-CODE
@@ -10,9 +10,9 @@ module Rlint
# end
# CODE
#
- # parser = Rlint::Parser.new(code)
+ # parser = RubyLint::Parser.new(code)
# tokens = parser.parse
- # iterator = Rlint::Iterator.new
+ # iterator = RubyLint::Iterator.new
#
# iterator.run(tokens)
#
@@ -25,7 +25,7 @@ module Rlint
# Without any custom callback classes the iterator class is fairly useless as
# it does nothing but iterate over all the nodes. These classes are defined
# as any ordinary class and are added to an interator instance using
- # {Rlint::Iterator#bind}. At the most basic level each callback class should
+ # {RubyLint::Iterator#bind}. At the most basic level each callback class should
# have the following structure:
#
# class MyCallback
@@ -38,30 +38,30 @@ module Rlint
# end
#
# The constructor method should take two parameters: the first one is used
- # for storing a instance of {Rlint::Report} (this parameter should be set to
+ # for storing a instance of {RubyLint::Report} (this parameter should be set to
# `nil` by default). The second parameter is a Hash containing custom data
- # that is shared between callback classes bound to the same {Rlint::Iterator}
+ # that is shared between callback classes bound to the same {RubyLint::Iterator}
# instance. This Hash can be used to share, for example, definitions defined
# in callback class #1 with callback class #2.
#
# To make this, as well as adding errors and such to a report easier your own
- # classes can extend {Rlint::Callback}:
+ # classes can extend {RubyLint::Callback}:
#
- # class MyCallback < Rlint::Callback
+ # class MyCallback < RubyLint::Callback
#
# end
#
# To add your class to an iterator instance you'd run the following:
#
- # iterator = Rlint::Iterator.new
+ # iterator = RubyLint::Iterator.new
#
# iterator.bind(MyCallback)
#
# ## Callback Methods
#
- # When iterating over an AST the method {Rlint::Iterator#iterator} calls two
+ # When iterating over an AST the method {RubyLint::Iterator#iterator} calls two
# callback methods based on the event name stored in the token (in
- # {Rlint::Token::Token#event}):
+ # {RubyLint::Token::Token#event}):
#
# * `on_EVENT_NAME`
# * `after_EVENT_NAME`
@@ -77,12 +77,12 @@ module Rlint
#
# Each method should take a single parameter that contains details about the
# token that is currently being processed. Each token is an instance of
- # {Rlint::Token::Token} or one of its child classes.
+ # {RubyLint::Token::Token} or one of its child classes.
#
# If you wanted to display the values of all strings in your console you'd
# write the following class:
#
- # class StringPrinter < Rlint::Callback
+ # class StringPrinter < RubyLint::Callback
# def on_string(token)
# puts token.value
# end
@@ -107,7 +107,7 @@ class Iterator
##
# Creates a new instance of the iterator class.
#
- # @param [Rlint::Report|NilClass] report The report to use, set to `nil` by
+ # @param [RubyLint::Report|NilClass] report The report to use, set to `nil` by
# default.
#
def initialize(report = nil)
@@ -118,7 +118,7 @@ def initialize(report = nil)
##
# Processes the entire AST for each callback class in sequence. For each
- # callback class the method {Rlint::Iterator#iterate} is called to process
+ # callback class the method {RubyLint::Iterator#iterate} is called to process
# an *entire* AST before moving on to the next callback class.
#
# @param [#each] nodes An array of nodes to process.
@@ -137,14 +137,14 @@ def run(nodes)
# Processes an AST and calls callbacks methods for a specific callback
# object.
#
- # @param [Rlint::Callback] callback_obj The callback object on which to
+ # @param [RubyLint::Callback] callback_obj The callback object on which to
# invoke callback method.
# @param [#each] nodes An array (or a different object that responds to
# `#each()`) that contains a set of tokens to process.
#
def iterate(callback_obj, nodes)
nodes.each do |node|
- next unless node.is_a?(Rlint::Token::Token)
+ next unless node.is_a?(RubyLint::Token::Token)
event_name = node.event.to_s
callback_name = 'on_' + event_name
@@ -165,7 +165,7 @@ def iterate(callback_obj, nodes)
# instance.
#
# @example
- # iterator = Rlint::Iterator.new
+ # iterator = RubyLint::Iterator.new
#
# iterator.bind(CustomCallbackClass)
#
@@ -181,7 +181,7 @@ def bind(callback_class)
# Loops through all the bound callback classes and executes the specified
# callback method if it exists.
#
- # @param [Rlint::Callback] obj The object on which to invoke the callback
+ # @param [RubyLint::Callback] obj The object on which to invoke the callback
# method.
# @param [String|Symbol] name The name of the callback method to execute.
# @param [Array] args Arguments to pass to the callback method.
@@ -190,4 +190,4 @@ def execute_callback(obj, name, *args)
obj.send(name, *args) if obj.respond_to?(name)
end
end # Iterator
-end # Rlint
+end # RubyLint
View
18 lib/ruby-lint/options.rb
@@ -1,7 +1,7 @@
-module Rlint
+module RubyLint
##
- # {Rlint::Options} is a class that can be used to configure various parts of
- # Rlint such as what formatter to use, the reporting levels, etc.
+ # {RubyLint::Options} is a class that can be used to configure various parts of
+ # RubyLint such as what formatter to use, the reporting levels, etc.
#
class Options
##
@@ -13,16 +13,16 @@ class Options
REQUIRED_ANALYZERS = [Analyze::Definitions]
##
- # The reporting formatter to use, set to {Rlint::Formatter::Text} by
+ # The reporting formatter to use, set to {RubyLint::Formatter::Text} by
# default.
#
- # @return [Rlint::Formatter]
+ # @return [RubyLint::Formatter]
#
attr_accessor :formatter
##
- # The enabled reporting levels. See {Rlint::Report#levels} and
- # {Rlint::Report#initialize} for more information.
+ # The enabled reporting levels. See {RubyLint::Report#levels} and
+ # {RubyLint::Report#initialize} for more information.
#
# @return [Array]
#
@@ -30,7 +30,7 @@ class Options
##
# Array of classes to use for analyzing code. By default all the classes
- # defined under {Rlint::Analyze} are used.
+ # defined under {RubyLint::Analyze} are used.
#
# @return [Array]
#
@@ -55,4 +55,4 @@ def initialize
@options = Options.new
class << self; attr_reader :options; end
-end # Rlint
+end # RubyLint
View
216 lib/ruby-lint/parser.rb
@@ -1,16 +1,16 @@
-module Rlint
+module RubyLint
##
- # {Rlint::Parser} uses Ripper to parse Ruby source code and turn it into an
+ # {RubyLint::Parser} uses Ripper to parse Ruby source code and turn it into an
# AST. Instead of returning arrays (the Ripper default) this class uses the
- # various token classes such as {Rlint::Token::Token} and
- # {Rlint::Token::VariableToken}. It also takes care of a few more things such
+ # various token classes such as {RubyLint::Token::Token} and
+ # {RubyLint::Token::VariableToken}. It also takes care of a few more things such
# as saving the associated line of code and setting method visibility.
#
# Parsing Ruby code requires two steps:
#
# 1. Create a new instance of this class and pass a string containing source
# code to the constructor method.
- # 2. Call the method {Rlint::Parser#parse} and do something with the returned
+ # 2. Call the method {RubyLint::Parser#parse} and do something with the returned
# AST.
#
# For example, to parse a simple "Hello World" example you'd use this parser
@@ -18,20 +18,20 @@ module Rlint
#
# require 'pp'
#
- # parser = Rlint::Parser.new('puts "Hello, world!"')
+ # parser = RubyLint::Parser.new('puts "Hello, world!"')
#
# pp parser.parse
#
# This outputs the following AST:
#
- # [#<Rlint::Token::MethodToken:0x000000012f04d0
+ # [#<RubyLint::Token::MethodToken:0x000000012f04d0
# @code="puts \"Hello, world!\"",
# @column=0,
# @event=:method,
# @line=1,
# @name="puts",
# @parameters=
- # [#<Rlint::Token::Token:0x000000012e9fb8
+ # [#<RubyLint::Token::Token:0x000000012e9fb8
# @code="puts \"Hello, world!\"",
# @column=6,
# @event=:string,
@@ -73,7 +73,7 @@ class Parser < Ripper::SexpBuilderPP
##
# Array of event names that should return an instance of
- # {Rlint::Token::MethodToken}.
+ # {RubyLint::Token::MethodToken}.
#
# @return [Array]
#
@@ -107,7 +107,7 @@ class Parser < Ripper::SexpBuilderPP
#
DEFAULT_VISIBILITY = :public
- # Return an Rlint::Token::Token instance for each scanner event instead of
+ # Return an RubyLint::Token::Token instance for each scanner event instead of
# an array with multiple indexes.
SCANNER_EVENTS.each do |event|
define_method("on_#{event}") do |token|
@@ -185,7 +185,7 @@ def initialize(code, file = '(rlint)', line = 1)
# Called when a parser error was encountered.
#
# @param [String] message The error message.
- # @raise [Rlint::ParserError]
+ # @raise [RubyLint::ParserError]
#
def on_parse_error(message)
raise ParserError.new(message, lineno, column, @file)
@@ -195,7 +195,7 @@ def on_parse_error(message)
# Called when a string literal was found.
#
# @param [Array] token Array containing details about the string.
- # @return [Rlint::Token::Token]
+ # @return [RubyLint::Token::Token]
#
def on_string_literal(token)
if token and token[1]
@@ -214,8 +214,8 @@ def on_string_literal(token)
##
# Called when a symbol is found.
#
- # @param [Rlint::Token::Token] token The symbol token.
- # @return [Rlint::Token::Token]
+ # @param [RubyLint::Token::Token] token The symbol token.
+ # @return [RubyLint::Token::Token]
#
def on_symbol(token)
token.type = :symbol
@@ -226,7 +226,7 @@ def on_symbol(token)
##
# Called when a symbol using quotes was found.
#
- # @see Rlint::Parser#on_symbol
+ # @see RubyLint::Parser#on_symbol
#
def on_dyna_symbol(token)
return on_symbol(token[0])
@@ -236,7 +236,7 @@ def on_dyna_symbol(token)
# Called when an array is found.
#
# @param [Array] values The values of the array.
- # @return [Rlint::Token::Token]
+ # @return [RubyLint::Token::Token]
#
def on_array(values)
values ||= []
@@ -253,9 +253,9 @@ def on_array(values)
##
# Called when a reference to a particular array index is found.
#
- # @param [Rlint::Token::Token] array The array that was referenced.
- # @param [Rlint::Token::Token] index The index that was referenced.
- # @return [Rlint::Token::Token]
+ # @param [RubyLint::Token::Token] array The array that was referenced.
+ # @param [RubyLint::Token::Token] index The index that was referenced.
+ # @return [RubyLint::Token::Token]
#
def on_aref(array, index)
array.key = index
@@ -266,10 +266,10 @@ def on_aref(array, index)
##
# Called when a value is assigned to an array index.
#
- # @param [Rlint::Token::Token] array The array that was referenced.
- # @param [Rlint::Token::Token] index The index of the array that was
+ # @param [RubyLint::Token::Token] array The array that was referenced.
+ # @param [RubyLint::Token::Token] index The index of the array that was
# referenced.
- # @return [Rlint::Token::Token]
+ # @return [RubyLint::Token::Token]
#
def on_aref_field(array, index)
array.key = index
@@ -287,7 +287,7 @@ def on_aref_field(array, index)
# Called when a Hash is found.
#
# @param [Array] pairs An array of key/value pairs of the hash.
- # @return [Rlint::Token::Token]
+ # @return [RubyLint::Token::Token]
#
def on_hash(pairs)
# column() is set to the column number of the very end of the hash.
@@ -306,7 +306,7 @@ def on_hash(pairs)
# Called when a bare Hash is found. A bare Hash is a hash that's declared
# without the curly braces.
#
- # @see Rlint::Parser#on_hash
+ # @see RubyLint::Parser#on_hash
#
def on_bare_assoc_hash(pairs)
return on_hash(pairs)
@@ -315,9 +315,9 @@ def on_bare_assoc_hash(pairs)
##
# Called when a new key/value pair of a Hash is found.
#
- # @param [Rlint::Token::Token] key The key of the pair.
- # @param [Rlint::Token::Token] value The value of the pair.
- # @return [Rlint::Token::Token]
+ # @param [RubyLint::Token::Token] key The key of the pair.
+ # @param [RubyLint::Token::Token] value The value of the pair.
+ # @return [RubyLint::Token::Token]
#
def on_assoc_new(key, value)
key.name = key.value
@@ -329,10 +329,10 @@ def on_assoc_new(key, value)
##
# Called when a block is created using curly braces.
#
- # @param [Rlint::Token::ParametersToken] params The parameters of the
+ # @param [RubyLint::Token::ParametersToken] params The parameters of the
# block.
# @param [Array] body Array containing the tokens of the block.
- # @return [Rlint::Token::BlockToken]
+ # @return [RubyLint::Token::BlockToken]
#
def on_brace_block(params, body)
return Token::BlockToken.new(
@@ -348,7 +348,7 @@ def on_brace_block(params, body)
##
# Called when a block is created using the do/end statements.
#
- # @see Rlint::Parser#on_brace_block
+ # @see RubyLint::Parser#on_brace_block
#
def on_do_block(params, body)
return on_brace_block(params, body)
@@ -357,7 +357,7 @@ def on_do_block(params, body)
##
# Called when a lambda is found.
#
- # @see Rlint::Parser#on_brace_block
+ # @see RubyLint::Parser#on_brace_block
#
def on_lambda(params, body)
token = on_brace_block(params, body)
@@ -369,9 +369,9 @@ def on_lambda(params, body)
##
# Called when a Range is found.
#
- # @param [Rlint::Token::Token] start The start value of the range.
- # @param [Rlint::Token::Token] stop The end value of the range.
- # @return [Rlint::Token::Token]
+ # @param [RubyLint::Token::Token] start The start value of the range.
+ # @param [RubyLint::Token::Token] stop The end value of the range.
+ # @return [RubyLint::Token::Token]
#
def on_dot2(start, stop)
return Token::Token.new(
@@ -387,8 +387,8 @@ def on_dot2(start, stop)
# Called when a regular expression is found.
#
# @param [Array] regexp The regular expression's value.
- # @param [Rlint::Token::Token] modes The modes of the regular expression.
- # @return [Rlint::Token::RegexpToken]
+ # @param [RubyLint::Token::Token] modes The modes of the regular expression.
+ # @return [RubyLint::Token::RegexpToken]
#
def on_regexp_literal(regexp, modes)
regexp = regexp[0]
@@ -411,12 +411,12 @@ def on_regexp_literal(regexp, modes)
##
# Called when a value is assigned to a variable.
#
- # @param [Rlint::Token::Token] variable The variable that is assigned.
- # @param [Rlint::Token::Token] value The value to assign.
- # @return [Rlint::Token::VariableToken]
+ # @param [RubyLint::Token::Token] variable The variable that is assigned.
+ # @param [RubyLint::Token::Token] value The value to assign.
+ # @return [RubyLint::Token::VariableToken]
#
def on_assign(variable, value)
- if variable.class == Rlint::Token::AssignmentToken
+ if variable.class == RubyLint::Token::AssignmentToken
variable.value = value
return variable
@@ -449,7 +449,7 @@ def on_assign(variable, value)
#
# @param [Array] variables The variables that are being assigned values.
# @param [Array] values The values to assign.
- # @return [Rlint::Token::AssignmentToken]
+ # @return [RubyLint::Token::AssignmentToken]
#
def on_massign(variables, values)
return Token::AssignmentToken.new(
@@ -466,13 +466,13 @@ def on_massign(variables, values)
##
# Called when a value is assigned to an object attribute.
#
- # @param [Rlint::Token::VariableToken] receiver The receiver of the
+ # @param [RubyLint::Token::VariableToken] receiver The receiver of the
# assignment.
# @param [Symbol] operator The operator that was used to separate the
# object and attribute.
- # @param [Rlint::Token::Token] attribute The attribute to which the value
+ # @param [RubyLint::Token::Token] attribute The attribute to which the value
# is assigned.
- # @return [Rlint::Token::VariableToken]
+ # @return [RubyLint::Token::VariableToken]
#
def on_field(receiver, operator, attribute)
return Token::AssignmentToken.new(
@@ -489,10 +489,10 @@ def on_field(receiver, operator, attribute)
##
# Called when a (binary) operator operation is performed.
#
- # @param [Rlint::Token::Token] left The left hand side of the operator.
+ # @param [RubyLint::Token::Token] left The left hand side of the operator.
# @param [Symbol] op The operator that was used.
- # @param [Rlint::Token::Token] right The right hand side of the operator.
- # @return [Rlint::Token::Token]
+ # @param [RubyLint::Token::Token] right The right hand side of the operator.
+ # @return [RubyLint::Token::Token]
#
def on_binary(left, op, right)
return Token::Token.new(
@@ -508,8 +508,8 @@ def on_binary(left, op, right)
# Called when an unary operator/operation is found.
#
# @param [Symbol] operator The unary operator.
- # @param [Rlint::Token::Token] token The token after the unary operator.
- # @return [Rlint::Token::Token]
+ # @param [RubyLint::Token::Token] token The token after the unary operator.
+ # @return [RubyLint::Token::Token]
#
def on_unary(operator, token)
return Token::Token.new(
@@ -525,7 +525,7 @@ def on_unary(operator, token)
# Called when a set of parenthesis is found.
#
# @param [Array] value The data inside the parenthesis.
- # @return [Rlint::Token::Token]
+ # @return [RubyLint::Token::Token]
#
def on_paren(value)
if value.is_a?(Array)
@@ -539,7 +539,7 @@ def on_paren(value)
# Called when a return statement is found.
#
# @param [Array] values The return values of the statement.
- # @return [Rlint::Token::StatementToken]
+ # @return [RubyLint::Token::StatementToken]
#
def on_return(values)
source = code(lineno)
@@ -557,9 +557,9 @@ def on_return(values)
##
# Called when a while loop is found.
#
- # @param [Rlint::Token::Token] statement The statement to evaluate.
- # @param [Rlint::Token::Token] value The body of the while loop.
- # @return [Rlint::Token::StatementToken]
+ # @param [RubyLint::Token::Token] statement The statement to evaluate.
+ # @param [RubyLint::Token::Token] value The body of the while loop.
+ # @return [RubyLint::Token::StatementToken]
#
def on_while(statement, value)
source = code(statement.line)
@@ -581,9 +581,9 @@ def on_while(statement, value)
# @param [Array] variables Array of variables to create for each iteration.
#
# pry_binding
- # @param [Rlint::Token::Token] enumerable The enumerable to iterate.
+ # @param [RubyLint::Token::Token] enumerable The enumerable to iterate.
# @param [Array] value The body of the for loop.
- # @return [Rlint::Token::StatementToken]
+ # @return [RubyLint::Token::StatementToken]
#
def on_for(variables, enumerable, value)
source = code(variables[0].line)
@@ -602,12 +602,12 @@ def on_for(variables, enumerable, value)
##
# Called when an if statement is found.
#
- # @param [Rlint::Token::Token] statement The if statement to evaluate.
+ # @param [RubyLint::Token::Token] statement The if statement to evaluate.
# @param [Array] value Array containing the tokens of the code that will
# be executed if the if statement evaluates to true.
# @param [Array] rest Array containing the tokens for the elsif and else
# statements (if any).
- # @return [Rlint::Token::StatementToken]
+ # @return [RubyLint::Token::StatementToken]
#
def on_if(statement, value, rest)
source = code(statement.line)
@@ -643,7 +643,7 @@ def on_if(statement, value, rest)
##
# Called whne a tenary operator is found.
#
- # @see Rlint::Parser#on_if
+ # @see RubyLint::Parser#on_if
#
def on_ifop(statement, value, else_statement)
else_statement = Token::StatementToken.new(
@@ -669,7 +669,7 @@ def on_ifop(statement, value, else_statement)
# Called when an else statement is found.
#
# @param [Array] value The value of the statement.
- # @return [Rlint::Token::StatementToken]
+ # @return [RubyLint::Token::StatementToken]
#
def on_else(value)
return Token::StatementToken.new(
@@ -684,9 +684,9 @@ def on_else(value)
##
# Called when an elsif statement is found.
#
- # @param [Rlint::Token::Token] statement The statement to evaluate.
+ # @param [RubyLint::Token::Token] statement The statement to evaluate.
# @param [Array] value The value of the elsif statement.
- # @param [Array|Rlint::Token::Token] list A list of else and elsif
+ # @param [Array|RubyLint::Token::Token] list A list of else and elsif
# statements.
# @return [Array]
#
@@ -716,11 +716,11 @@ def on_elsif(statement, value, list)
#
# @param [Array] value Array containing the tokens of the body/statement.
# @param [Array] rescues An array of rescue statements.
- # @param [Rlint::Token::StatementToken] else_statement The else statement
+ # @param [RubyLint::Token::StatementToken] else_statement The else statement
# of the block.
- # @param [Rlint::Token::StatementToken] ensure_statement The ensure
+ # @param [RubyLint::Token::StatementToken] ensure_statement The ensure
# statement of the block.
- # @return [Rlint::Token::BeginRescueToken]
+ # @return [RubyLint::Token::BeginRescueToken]
#
def on_bodystmt(value, rescues, else_statement, ensure_statement)
if rescues.nil? and else_statement.nil? and ensure_statement.nil?
@@ -743,11 +743,11 @@ def on_bodystmt(value, rescues, else_statement, ensure_statement)
# Called when a rescue statement is found.
#
# @param [Array] exceptions An array of exceptions to catch.
- # @param [Rlint::Token::Token] variable The variable in which to store
+ # @param [RubyLint::Token::Token] variable The variable in which to store
# the exception details.
# @param [Array] value The value of the rescue statement.
- # @param [Array|Rlint::Token::Token] list A set of all the rescue tokens.
- # @return [Rlint::Token::StatementToken]
+ # @param [Array|RubyLint::Token::Token] list A set of all the rescue tokens.
+ # @return [RubyLint::Token::StatementToken]
#
def on_rescue(exceptions, variable, value, list)
source = code(lineno)
@@ -773,11 +773,11 @@ def on_rescue(exceptions, variable, value, list)
# Called when a single line rescue statement (in the form of `[VALUE]
# rescue [RESCUE VALUE]`) is found.
#
- # @param [Rlint::Token::Token|Array] value The body of the begin/rescue
+ # @param [RubyLint::Token::Token|Array] value The body of the begin/rescue
# statement.
- # @param [Rlint::Token::Token] statement The statement to evaluate when the
+ # @param [RubyLint::Token::Token] statement The statement to evaluate when the
# data in `value` raised an exception.
- # @return [Rlint::Token::BeginRescueToken]
+ # @return [RubyLint::Token::BeginRescueToken]
#
def on_rescue_mod(value, statement)
value = [value] unless value.is_a?(Array)
@@ -797,7 +797,7 @@ def on_rescue_mod(value, statement)
# Called when an ensure statement is found.
#
# @param [Array] value The value of the statement.
- # @return [Rlint::Token::StatementToken]
+ # @return [RubyLint::Token::StatementToken]
#
def on_ensure(value)
return Token::StatementToken.new(
@@ -812,11 +812,11 @@ def on_ensure(value)
##
# Called for an entire case/when/else block.
#
- # @param [Rlint::Token::Token] statement The statement of the `case`
+ # @param [RubyLint::Token::Token] statement The statement of the `case`
# statement itself.
# @param [Array] list Array containing the various when statements and
# optionally an else statement.
- # @return [Rlint::Token::CaseToken]
+ # @return [RubyLint::Token::CaseToken]
#
def on_case(statement, list)
when_statements = []
@@ -876,11 +876,11 @@ def on_when(statement, body, list)
##
# Called when a unless statement is found.
#
- # @param [Rlint::Token::Token] statement The statement to evaluate.
+ # @param [RubyLint::Token::Token] statement The statement to evaluate.
# @param [Array] body The body of the unless statement.
- # @param [Rlint::Token::StatementToken] else_token An optional else
+ # @param [RubyLint::Token::StatementToken] else_token An optional else
# statement.
- # @return [Rlint::Token::StatementToken]
+ # @return [RubyLint::Token::StatementToken]
#
def on_unless(statement, body, else_token)
source = code(statement.line)
@@ -900,7 +900,7 @@ def on_unless(statement, body, else_token)
##
# Called when an until statement is found.
#
- # @see Rlint::Parser#on_unless
+ # @see RubyLint::Parser#on_unless
#
def on_until(statement, body)
source = code(statement.line)
@@ -919,8 +919,8 @@ def on_until(statement, body)
##
# Called when a variable is referenced.
#
- # @param [Rlint::Token::Token] variable The variable that was referenced.
- # @return [Rlint::Token::VariableToken]
+ # @param [RubyLint::Token::Token] variable The variable that was referenced.
+ # @return [RubyLint::Token::VariableToken]
#
def on_var_ref(variable)
return Token::VariableToken.new(
@@ -951,7 +951,7 @@ def on_const_path_ref(*segments)
##
# Called when a constant path is assigned.
#
- # @see Rlint::Parser#on_const_path_ref
+ # @see RubyLint::Parser#on_const_path_ref
#
def on_const_path_field(*segments)
return on_const_path_ref(*segments)
@@ -960,12 +960,12 @@ def on_const_path_field(*segments)
##
# Called when a new method is defined.
#
- # @param [Rlint::Token::Token] name Token containing details about the
+ # @param [RubyLint::Token::Token] name Token containing details about the
# method name.
- # @param [Rlint::Token::ParametersToken] params Token containing details
+ # @param [RubyLint::Token::ParametersToken] params Token containing details