rakelib/lint.rake
Use %i
or %I
for an array of symbols. Open
Open
task lint: [:standardjs, :flow, :rubocop] do
- Read upRead up
- Exclude checks
This cop can check for array literals made up of symbols that are not using the %i() syntax.
Alternatively, it checks for symbol arrays using the %i() syntax on projects which do not want to use that syntax.
Configuration option: MinSize
If set, arrays with fewer elements than this value will not trigger the
cop. For example, a MinSize of
3` will not enforce a style on an array
of 2 or fewer elements.
Example: EnforcedStyle: percent (default)
# good
%i[foo bar baz]
# bad
[:foo, :bar, :baz]
Example: EnforcedStyle: brackets
# good
[:foo, :bar, :baz]
# bad
%i[foo bar baz]
include
is used at the top level. Use inside class
or module
. Open
Open
include LooseLeaf::TaskHelpers
- Read upRead up
- Exclude checks
This cop checks that include
, extend
and prepend
exists at
the top level.
Using these at the top level affects the behavior of Object
.
There will not be using include
, extend
and prepend
at
the top level. Let's use it inside class
or module
.
Example:
# bad
include M
class C
end
# bad
extend M
class C
end
# bad
prepend M
class C
end
# good
class C
include M
end
# good
class C
extend M
end
# good
class C
prepend M
end