Showing 75 of 75 total issues
Extra blank line detected. Open
def config_dir
- Read upRead up
- Exclude checks
This cops checks for two or more consecutive blank lines.
Example:
# bad - It has two empty lines.
some_method
# one empty line
# two empty lines
some_method
# good
some_method
# one empty line
some_method
Avoid the use of double negation (!!
). Open
!! @handle and return @handle
- Read upRead up
- Exclude checks
This cop checks for uses of double negation (!!) to convert something to a boolean value. As this is both cryptic and usually redundant, it should be avoided.
Example:
# bad
!!something
# good
!something.nil?
Please, note that when something is a boolean value !!something and !something.nil? are not the same thing. As you're unlikely to write code that can accept values of any type this is rarely a problem in practice.
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
VERSION = "0.1.0"
- Read upRead up
- Exclude checks
Checks if uses of quotes match the configured preference.
Example: EnforcedStyle: single_quotes (default)
# bad
"No special symbols"
"No string interpolation"
"Just text"
# good
'No special symbols'
'No string interpolation'
'Just text'
"Wait! What's #{this}!"
Example: EnforcedStyle: double_quotes
# bad
'Just some text'
'No special chars or interpolation'
# good
"Just some text"
"No special chars or interpolation"
"Every string in #{project} uses double_quotes"
Unnecessary utf-8 encoding comment. Open
# coding: utf-8
- Exclude checks
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
require "bundler/setup"
- Read upRead up
- Exclude checks
Checks if uses of quotes match the configured preference.
Example: EnforcedStyle: single_quotes (default)
# bad
"No special symbols"
"No string interpolation"
"Just text"
# good
'No special symbols'
'No string interpolation'
'Just text'
"Wait! What's #{this}!"
Example: EnforcedStyle: double_quotes
# bad
'Just some text'
'No special chars or interpolation'
# good
"Just some text"
"No special chars or interpolation"
"Every string in #{project} uses double_quotes"
Use empty lines between method definitions. Open
def config_dir
- Read upRead up
- Exclude checks
This cop checks whether method definitions are separated by one empty line.
NumberOfEmptyLines
can be and integer (e.g. 1 by default) or
an array (e.g. [1, 2]) to specificy a minimum and a maximum of
empty lines.
AllowAdjacentOneLineDefs
can be used to configure is adjacent
one line methods definitions are an offense
Example:
# bad
def a
end
def b
end
Example:
# good
def a
end
def b
end
Dependencies should be sorted in an alphabetical order within their section of the gemspec. Dependency coveralls
should appear before guard-rspec
. Open
spec.add_development_dependency "coveralls"
- Read upRead up
- Exclude checks
Dependencies in the gemspec should be alphabetically sorted.
Example:
# bad
spec.add_dependency 'rubocop'
spec.add_dependency 'rspec'
# good
spec.add_dependency 'rspec'
spec.add_dependency 'rubocop'
# good
spec.add_dependency 'rubocop'
spec.add_dependency 'rspec'
# bad
spec.add_development_dependency 'rubocop'
spec.add_development_dependency 'rspec'
# good
spec.add_development_dependency 'rspec'
spec.add_development_dependency 'rubocop'
# good
spec.add_development_dependency 'rubocop'
spec.add_development_dependency 'rspec'
# bad
spec.add_runtime_dependency 'rubocop'
spec.add_runtime_dependency 'rspec'
# good
spec.add_runtime_dependency 'rspec'
spec.add_runtime_dependency 'rubocop'
# good
spec.add_runtime_dependency 'rubocop'
spec.add_runtime_dependency 'rspec'
# good only if TreatCommentsAsGroupSeparators is true
# For code quality
spec.add_dependency 'rubocop'
# For tests
spec.add_dependency 'rspec'
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
spec.add_development_dependency "rake", "~> 10.0"
- Read upRead up
- Exclude checks
Checks if uses of quotes match the configured preference.
Example: EnforcedStyle: single_quotes (default)
# bad
"No special symbols"
"No string interpolation"
"Just text"
# good
'No special symbols'
'No string interpolation'
'Just text'
"Wait! What's #{this}!"
Example: EnforcedStyle: double_quotes
# bad
'Just some text'
'No special chars or interpolation'
# good
"Just some text"
"No special chars or interpolation"
"Every string in #{project} uses double_quotes"
Extra blank line detected. Open
private
- Read upRead up
- Exclude checks
This cops checks for two or more consecutive blank lines.
Example:
# bad - It has two empty lines.
some_method
# one empty line
# two empty lines
some_method
# good
some_method
# one empty line
some_method
Space inside parentheses detected. Open
File.expand_path( File.join( config_dir, key ) )
- Read upRead up
- Exclude checks
Checks for spaces inside ordinary round parentheses.
Example:
# bad
f( 3)
g = (a + 3 )
# good
f(3)
g = (a + 3)
Dependencies should be sorted in an alphabetical order within their section of the gemspec. Dependency guard-rspec
should appear before rake
. Open
spec.add_development_dependency "guard-rspec"
- Read upRead up
- Exclude checks
Dependencies in the gemspec should be alphabetically sorted.
Example:
# bad
spec.add_dependency 'rubocop'
spec.add_dependency 'rspec'
# good
spec.add_dependency 'rspec'
spec.add_dependency 'rubocop'
# good
spec.add_dependency 'rubocop'
spec.add_dependency 'rspec'
# bad
spec.add_development_dependency 'rubocop'
spec.add_development_dependency 'rspec'
# good
spec.add_development_dependency 'rspec'
spec.add_development_dependency 'rubocop'
# good
spec.add_development_dependency 'rubocop'
spec.add_development_dependency 'rspec'
# bad
spec.add_runtime_dependency 'rubocop'
spec.add_runtime_dependency 'rspec'
# good
spec.add_runtime_dependency 'rspec'
spec.add_runtime_dependency 'rubocop'
# good
spec.add_runtime_dependency 'rubocop'
spec.add_runtime_dependency 'rspec'
# good only if TreatCommentsAsGroupSeparators is true
# For code quality
spec.add_dependency 'rubocop'
# For tests
spec.add_dependency 'rspec'
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
spec.email = ["dean@deanandadie.net"]
- Read upRead up
- Exclude checks
Checks if uses of quotes match the configured preference.
Example: EnforcedStyle: single_quotes (default)
# bad
"No special symbols"
"No string interpolation"
"Just text"
# good
'No special symbols'
'No string interpolation'
'Just text'
"Wait! What's #{this}!"
Example: EnforcedStyle: double_quotes
# bad
'Just some text'
'No special chars or interpolation'
# good
"Just some text"
"No special chars or interpolation"
"Every string in #{project} uses double_quotes"
Space inside parentheses detected. Open
watch( %r{^spec/cases/.+_spec\.rb$} )
- Read upRead up
- Exclude checks
Checks for spaces inside ordinary round parentheses.
Example:
# bad
f( 3)
g = (a + 3 )
# good
f(3)
g = (a + 3)
Extra blank line detected. Open
def locate_config_file(key)
- Read upRead up
- Exclude checks
This cops checks for two or more consecutive blank lines.
Example:
# bad - It has two empty lines.
some_method
# one empty line
# two empty lines
some_method
# good
some_method
# one empty line
some_method
Space inside parentheses detected. Open
File.expand_path( File.join( File.dirname(__FILE__), '..', '..', 'config' ) )
- Read upRead up
- Exclude checks
Checks for spaces inside ordinary round parentheses.
Example:
# bad
f( 3)
g = (a + 3 )
# good
f(3)
g = (a + 3)