Block has too many lines. [32/25] Open
Gem::Specification.new do |s|
s.name = 'dex-oracle'
s.version = DexOracle::VERSION.dup
s.date = '2018-12-13'
s.license = 'MIT'
- Read upRead up
- Exclude checks
This cop checks if the length of a block exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable. The cop can be configured to ignore blocks passed to certain methods.
Avoid comma after the last item of an array. Open
[:development, 'rspec-mocks', '~> 3.4', '>= 3.4.0'],
- Read upRead up
- Exclude checks
This cop checks for trailing comma in array and hash literals.
Example: EnforcedStyleForMultiline: consistent_comma
# bad
a = [1, 2,]
# good
a = [
1, 2,
3,
]
# good
a = [
1,
2,
]
Example: EnforcedStyleForMultiline: comma
# bad
a = [1, 2,]
# good
a = [
1,
2,
]
Example: EnforcedStyleForMultiline: no_comma (default)
# bad
a = [1, 2,]
# good
a = [
1,
2
]
Missing magic comment # frozen_string_literal: true
. Open
# -*- encoding: utf-8 -*-
- Read upRead up
- Exclude checks
This cop is designed to help upgrade to Ruby 3.0. It will add the
comment # frozen_string_literal: true
to the top of files to
enable frozen string literals. Frozen string literals may be default
in Ruby 3.0. The comment will be added below a shebang and encoding
comment. The frozen string literal comment is only valid in Ruby 2.3+.
Example: EnforcedStyle: when_needed (default)
# The `when_needed` style will add the frozen string literal comment
# to files only when the `TargetRubyVersion` is set to 2.3+.
# bad
module Foo
# ...
end
# good
# frozen_string_literal: true
module Foo
# ...
end
Example: EnforcedStyle: always
# The `always` style will always add the frozen string literal comment
# to a file, regardless of the Ruby version or if `freeze` or `<<` are
# called on a string literal.
# bad
module Bar
# ...
end
# good
# frozen_string_literal: true
module Bar
# ...
end
Example: EnforcedStyle: never
# The `never` will enforce that the frozen string literal comment does
# not exist in a file.
# bad
# frozen_string_literal: true
module Baz
# ...
end
# good
module Baz
# ...
end
%w
-literals should be delimited by [
and ]
. Open
exclude_files = Dir['driver/{build,bin}/**/*'] + Dir['sandbox/**/*'] + Dir['coverage/**/*'] + Dir['docker/**/*'] + %w(driver/build driver/bin sandbox coverage docker .dockerignore)
- 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)
Unnecessary utf-8 encoding comment. Open
# -*- encoding: utf-8 -*-
- Exclude checks
Add an empty line after magic comments. Open
$LOAD_PATH.push('lib')
- 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
%w
-literals should be delimited by [
and ]
. Open
s.require_paths = %w(lib res)
- 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 2 spaces for indentation in a heredoc by using <<~
instead of <<-
. Open
A pattern based Dalvik deobfuscator which uses limited execution to improve semantic analysis.
EOF
- Read upRead up
- Exclude checks
This cops checks the indentation of the here document bodies. The bodies
are indented one step.
In Ruby 2.3 or newer, squiggly heredocs (<<~
) should be used. If you
use the older rubies, you should introduce some library to your project
(e.g. ActiveSupport, Powerpack or Unindent).
Note: When Metrics/LineLength
's AllowHeredoc
is false(not default),
this cop does not add any offenses for long here documents to
avoid Metrics/LineLength
's offenses.
Example:
# bad
<<-RUBY
something
RUBY
# good
# When EnforcedStyle is squiggly, bad code is auto-corrected to the
# following code.
<<~RUBY
something
RUBY
# good
# When EnforcedStyle is active_support, bad code is auto-corrected to
# the following code.
<<-RUBY.strip_heredoc
something
RUBY
Use meaningful heredoc delimiters. Open
EOF
- Read upRead up
- Exclude checks
This cop checks that your heredocs are using meaningful delimiters.
By default it disallows END
and EO*
, and can be configured through
blacklisting additional delimiters.
Example:
# good
<<-SQL
SELECT * FROM foo
SQL
# bad
<<-END
SELECT * FROM foo
END
# bad
<<-EOS
SELECT * FROM foo
EOS