Showing 55 of 55 total issues
Gem beaker
requirements already given on line 55 of the Gemfile. Open
gem 'beaker', *location_for(ENV['BEAKER_VERSION'] || '~> 2')
- Read upRead up
- Exclude checks
A Gem's requirements should be listed only once in a Gemfile.
Example:
# bad
gem 'rubocop'
gem 'rubocop'
# bad
group :development do
gem 'rubocop'
end
group :test do
gem 'rubocop'
end
# good
group :development, :test do
gem 'rubocop'
end
# good
gem 'rubocop', groups: [:development, :test]
%w
-literals should be delimited by [
and ]
. Open
moddeps = %w(portsutil backports)
- 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)
Gems should be sorted in an alphabetical order within their section of the Gemfile. Gem puppetlabs_spec_helper
should appear before rake
. Open
gem 'puppetlabs_spec_helper', '< 2.0.0', :require => false
- Read upRead up
- 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'
%w
-literals should be delimited by [
and ]
. Open
prepare_options(ops, self.class::DEFAULT_UNINSTALL_OPTIONS, %w(delete))
- 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)
Avoid rescuing without specifying an error class. Open
rescue
- Read upRead up
- Exclude checks
This cop checks for rescuing StandardError
. There are two supported
styles implicit
and explicit
. This cop will not register an offense
if any error other than StandardError
is specified.
Example: EnforcedStyle: implicit
# `implicit` will enforce using `rescue` instead of
# `rescue StandardError`.
# bad
begin
foo
rescue StandardError
bar
end
# good
begin
foo
rescue
bar
end
# good
begin
foo
rescue OtherError
bar
end
# good
begin
foo
rescue StandardError, SecurityError
bar
end
Example: EnforcedStyle: explicit (default)
# `explicit` will enforce using `rescue StandardError`
# instead of `rescue`.
# bad
begin
foo
rescue
bar
end
# good
begin
foo
rescue StandardError
bar
end
# good
begin
foo
rescue OtherError
bar
end
# good
begin
foo
rescue StandardError, SecurityError
bar
end
Line is too long. [94/80] Open
gem 'rspec', '~> 2.0' if ver(RUBY_VERSION) >= ver('1.8.7') && ver(RUBY_VERSION) < ver('1.9')
- Exclude checks
Line is too long. [89/80] Open
versions = ['9.0', '9.1', '9.2', '9.3', '10.1', '10.2', '10.3', '11.0', '11.1', '12.0']
- Exclude checks
Empty line detected around arguments. Open
`install_options` are passed to `portupgrade` command when installing,
- Read upRead up
- Exclude checks
This cops checks if empty lines exist around the arguments of a method invocation.
Example:
# bad
do_something(
foo
)
process(bar,
baz: qux,
thud: fred)
some_method(
[1,2,3],
x: y
)
# good
do_something(
foo
)
process(bar,
baz: qux,
thud: fred)
some_method(
[1,2,3],
x: y
)
Empty line detected around arguments. Open
- Read upRead up
- Exclude checks
This cops checks if empty lines exist around the arguments of a method invocation.
Example:
# bad
do_something(
foo
)
process(bar,
baz: qux,
thud: fred)
some_method(
[1,2,3],
x: y
)
# good
do_something(
foo
)
process(bar,
baz: qux,
thud: fred)
some_method(
[1,2,3],
x: y
)
%w
-literals should be delimited by [
and ]
. Open
prepare_options(ops, self.class::DEFAULT_UPGRADE_OPTIONS, %w(), %w(-f -N))
- 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)
Empty line detected around arguments. Open
The options are written to `/var/db/ports/*/options.local` files (one file
- Read upRead up
- Exclude checks
This cops checks if empty lines exist around the arguments of a method invocation.
Example:
# bad
do_something(
foo
)
process(bar,
baz: qux,
thud: fred)
some_method(
[1,2,3],
x: y
)
# good
do_something(
foo
)
process(bar,
baz: qux,
thud: fred)
some_method(
[1,2,3],
x: y
)
Gem beaker
requirements already given on line 55 of the Gemfile. Open
gem 'beaker', *location_for(ENV['BEAKER_VERSION'] || '>= 3.2.0')
- Read upRead up
- Exclude checks
A Gem's requirements should be listed only once in a Gemfile.
Example:
# bad
gem 'rubocop'
gem 'rubocop'
# bad
group :development do
gem 'rubocop'
end
group :test do
gem 'rubocop'
end
# good
group :development, :test do
gem 'rubocop'
end
# good
gem 'rubocop', groups: [:development, :test]
Ternary operators must not be nested. Prefer if
or else
constructs instead. Open
(host['platform'] =~ /10\.[0-4]/ ? 'puppet4' : 'puppet5')
- Exclude checks
Avoid single-line method definitions. Open
def ver(s); Gem::Version.new(s.dup); end
- Read upRead up
- Exclude checks
This cop checks for single-line method definitions that contain a body. It will accept single-line methods with no body.
Example:
# bad
def some_method; body end
def link_to(url); {:name => url}; end
def @table.columns; super; end
# good
def no_op; end
def self.resource_class=(klass); end
def @table.columns; end
%w
-literals should be delimited by [
and ]
. Open
prepare_options(ops, self.class::DEFAULT_UPGRADE_OPTIONS, %w(), %w(-f -N))
- 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)
%w
-literals should be delimited by [
and ]
. Open
prepare_options(ops, self.class::DEFAULT_INSTALL_OPTIONS, %w(-N), %w(-R -f))
- 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)
Gem rspec-puppet
requirements already given on line 36 of the Gemfile. Open
gem 'rspec-puppet'
- Read upRead up
- Exclude checks
A Gem's requirements should be listed only once in a Gemfile.
Example:
# bad
gem 'rubocop'
gem 'rubocop'
# bad
group :development do
gem 'rubocop'
end
group :test do
gem 'rubocop'
end
# good
group :development, :test do
gem 'rubocop'
end
# good
gem 'rubocop', groups: [:development, :test]
Gem nokogiri
requirements already given on line 46 of the Gemfile. Open
gem 'nokogiri', '< 1.7', :require => false
- Read upRead up
- Exclude checks
A Gem's requirements should be listed only once in a Gemfile.
Example:
# bad
gem 'rubocop'
gem 'rubocop'
# bad
group :development do
gem 'rubocop'
end
group :test do
gem 'rubocop'
end
# good
group :development, :test do
gem 'rubocop'
end
# good
gem 'rubocop', groups: [:development, :test]
Gem beaker-rspec
requirements already given on line 54 of the Gemfile. Open
gem 'beaker-rspec', *location_for(ENV['BEAKER_RSPEC_VERSION'] || '>= 3.4')
- Read upRead up
- Exclude checks
A Gem's requirements should be listed only once in a Gemfile.
Example:
# bad
gem 'rubocop'
gem 'rubocop'
# bad
group :development do
gem 'rubocop'
end
group :test do
gem 'rubocop'
end
# good
group :development, :test do
gem 'rubocop'
end
# good
gem 'rubocop', groups: [:development, :test]
Gems should be sorted in an alphabetical order within their section of the Gemfile. Gem beaker
should appear before beaker-rspec
. Open
gem 'beaker', *location_for(ENV['BEAKER_VERSION'] || '~> 2')
- Read upRead up
- 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'