Extra empty line detected at block body end. Open
end
- Read upRead up
- Exclude checks
This cops checks if empty lines around the bodies of blocks match the configuration.
Example: EnforcedStyle: empty_lines
# good
foo do |bar|
# ...
end
Example: EnforcedStyle: noemptylines (default)
# good
foo do |bar|
# ...
end
Use %q
only for strings that contain both single quotes and double quotes. Open
s.description = %q{Easily view SNMP tables in a variety of different formats including as a table in the terminal, json or csv.}
- Exclude checks
%q
-literals should be delimited by (
and )
. Open
s.summary = %q{Easily view SNMP tables.}
- Read upRead up
- Exclude checks
This cop enforces the consistent usage of %
-literal delimiters.
Specify the 'default' key to set all preferred delimiters at once. You can continue to specify individual preferred delimiters to override the default.
Example:
# Style/PercentLiteralDelimiters:
# PreferredDelimiters:
# default: '[]'
# '%i': '()'
# good
%w[alpha beta] + %i(gamma delta)
# bad
%W(alpha #{beta})
# bad
%I(alpha beta)
Dependencies should be sorted in an alphabetical order within their section of the gemspec. Dependency coveralls
should appear before rb-inotify
. Open
s.add_development_dependency 'coveralls', '~> 0.7'
- 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'
Dependencies should be sorted in an alphabetical order within their section of the gemspec. Dependency guard-rspec
should appear before rspec
. Open
s.add_development_dependency 'guard-rspec', '~> 4.2', '>= 4.2.5'
- 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'
Unnecessary utf-8 encoding comment. Open
# -*- encoding: utf-8 -*-
- Exclude checks
Space missing to the left of {. Open
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
- Read upRead up
- Exclude checks
Checks that block braces have or don't have a space before the opening brace depending on configuration.
Example:
# bad
foo.map{ |a|
a.bar.to_s
}
# good
foo.map { |a|
a.bar.to_s
}
%q
-literals should be delimited by (
and )
. Open
s.description = %q{Easily view SNMP tables in a variety of different formats including as a table in the terminal, json or csv.}
- Read upRead up
- Exclude checks
This cop enforces the consistent usage of %
-literal delimiters.
Specify the 'default' key to set all preferred delimiters at once. You can continue to specify individual preferred delimiters to override the default.
Example:
# Style/PercentLiteralDelimiters:
# PreferredDelimiters:
# default: '[]'
# '%i': '()'
# good
%w[alpha beta] + %i(gamma delta)
# bad
%W(alpha #{beta})
# bad
%I(alpha beta)
Use %q
only for strings that contain both single quotes and double quotes. Open
s.summary = %q{Easily view SNMP tables.}
- Exclude checks
Prefer $LOAD_PATH
over $:
. Open
$:.push File.expand_path(File.join('..', 'lib'), __FILE__)
- Exclude checks
Line is too long. [83/80] Open
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
- Exclude checks
Add an empty line after magic comments. Open
$:.push File.expand_path(File.join('..', 'lib'), __FILE__)
- Read upRead up
- Exclude checks
Checks for a newline after the final magic comment.
Example:
# good
# frozen_string_literal: true
# Some documentation for Person
class Person
# Some code
end
# bad
# frozen_string_literal: true
# Some documentation for Person
class Person
# Some code
end
Line is too long. [130/80] Open
s.description = %q{Easily view SNMP tables in a variety of different formats including as a table in the terminal, json or csv.}
- Exclude checks