Showing 509 of 509 total issues
1 trailing blank lines detected. (https://github.com/bbatsov/ruby-style-guide#newline-eof) Open
Open
- Create a ticketCreate a ticket
- Exclude checks
Carriage return character detected. (https://github.com/bbatsov/ruby-style-guide#crlf) Open
Open
#
# Cookbook Name: pig
- Create a ticketCreate a ticket
- Exclude checks
Gems should be sorted in an alphabetical order within their section of the Gemfile. Gem rspec
should appear before sprockets
. Open
Open
gem "rspec", "~> 3.1.0"
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Gems should be alphabetically sorted within groups.
Example:
# bad
gem 'rubocop'
gem 'rspec'
# good
gem 'rspec'
gem 'rubocop'
# good
gem 'rubocop'
gem 'rspec'
# good only if TreatCommentsAsGroupSeparators is true
# For code quality
gem 'rubocop'
# For tests
gem 'rspec'
Carriage return character detected. (https://github.com/bbatsov/ruby-style-guide#crlf) Open
Open
#
# Cookbook Name: hive
- Create a ticketCreate a ticket
- Exclude checks
Prefer $CHILD_STATUS
from the stdlib 'English' module (don't forget to require it) over $?
. (https://github.com/bbatsov/ruby-style-guide#no-cryptic-perlisms) Open
Open
exit $?.exitstatus
- Create a ticketCreate a ticket
- Exclude checks
Use __dir__
to get an absolute path to the current file's directory. Open
Open
require File.join(File.expand_path(File.dirname(__FILE__)), "barclamp_lib")
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
This cop checks for places where the #__dir__
method can replace more
complex constructs to retrieve a canonicalized absolute path to the
current file.
Example:
# bad
path = File.expand_path(File.dirname(__FILE__))
# bad
path = File.dirname(File.realpath(__FILE__))
# good
path = __dir__
Avoid using {...}
for multi-line blocks. (https://github.com/bbatsov/ruby-style-guide#single-line-blocks) Open
Open
edge_nodes.each { |x|
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Check for uses of braces or do/end around single line or multi-line blocks.
Example: EnforcedStyle: linecountbased (default)
# bad - single line block
items.each do |item| item / 5 end
# good - single line block
items.each { |item| item / 5 }
# bad - multi-line block
things.map { |thing|
something = thing.some_method
process(something)
}
# good - multi-line block
things.map do |thing|
something = thing.some_method
process(something)
end
Example: EnforcedStyle: semantic
# Prefer `do...end` over `{...}` for procedural blocks.
# return value is used/assigned
# bad
foo = map do |x|
x
end
puts (map do |x|
x
end)
# return value is not used out of scope
# good
map do |x|
x
end
# Prefer `{...}` over `do...end` for functional blocks.
# return value is not used out of scope
# bad
each { |x|
x
}
# return value is used/assigned
# good
foo = map { |x|
x
}
map { |x|
x
}.inspect
Example: EnforcedStyle: bracesforchaining
# bad
words.each do |word|
word.flip.flop
end.join("-")
# good
words.each { |word|
word.flip.flop
}.join("-")
Use self-assignment shorthand +=
. (https://github.com/bbatsov/ruby-style-guide#self-assignment) Open
Open
node_cnt = node_cnt +1
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
This cop enforces the use the shorthand for self-assignment.
Example:
# bad
x = x + 1
# good
x += 1
Line is too long. [154/100] (https://github.com/SUSE/style-guides/blob/master/Ruby.md#metricslinelength) Open
Open
headers["Content-Disposition"] = "attachment; filename=\"#{I18n.t('nodes.dell.nodes.filename', default: 'hadoop_infrastructure_inventory.txt')}\""
- Create a ticketCreate a ticket
- Exclude checks