Showing 676 of 676 total issues
Re-enable Metrics/LineLength cop with # rubocop:enable
after disabling it. Open
# rubocop:disable LineLength, ClassLength
- Exclude checks
%w
-literals should be delimited by [
and ]
. Open
let(:relative_path) { File.join(%w(directory file1)) }
- 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
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
Rule doesn't have all its properties in alphabetical order. Open
.container{width:940px;margin-left:auto;margin-right:auto;zoom:1;}.container:before,.container:after{display:table;content:"";zoom:1;}
- Exclude checks
Unnecessary utf-8 encoding comment. Open
# -*- encoding : utf-8 -*-
- Exclude checks
Rule doesn't have all its properties in alphabetical order. Open
.container-fluid>.sidebar{position:absolute;top:0;left:20px;width:220px;}
- Exclude checks
Re-enable Metrics/ClassLength cop with # rubocop:enable
after disabling it. Open
# rubocop:disable ClassLength
- Exclude checks
Heading (h1) has already been defined. Open
h1,h2,h3,h4,h5,h6{font-weight:bold;color:#404040;}h1 small,h2 small,h3 small,h4 small,h5 small,h6 small{color:#bfbfbf;}
- Exclude checks
Using width with border can sometimes make elements larger than you expect. Open
input,textarea,select,.uneditable-input{display:inline-block;width:210px;height:18px;padding:4px;font-size:13px;line-height:18px;color:#808080;border:1px solid #ccc;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;}
- Exclude checks
Use result.zero?
instead of result == 0
. Open
return -1 if result == 0
- Read upRead up
- Exclude checks
This cop checks for usage of comparison operators (==
,
>
, <
) to test numbers as zero, positive, or negative.
These can be replaced by their respective predicate methods.
The cop can also be configured to do the reverse.
The cop disregards #nonzero?
as it its value is truthy or falsey,
but not true
and false
, and thus not always interchangeable with
!= 0
.
The cop ignores comparisons to global variables, since they are often
populated with objects which can be compared with integers, but are
not themselves Interger
polymorphic.
Example: EnforcedStyle: predicate (default)
# bad
foo == 0
0 > foo
bar.baz > 0
# good
foo.zero?
foo.negative?
bar.baz.positive?
Example: EnforcedStyle: comparison
# bad
foo.zero?
foo.negative?
bar.baz.positive?
# good
foo == 0
0 > foo
bar.baz > 0
Adjoining classes: form .clearfix.warning > label Open
form .clearfix.warning>label,form .clearfix.warning .help-block,form .clearfix.warning .help-inline{color:#c09853;}
- Exclude checks
Rule doesn't have all its properties in alphabetical order. Open
form .clearfix.success .input-prepend .add-on,form .clearfix.success .input-append .add-on{color:#468847;background-color:#bcddbc;border-color:#468847;}
- Exclude checks
Property with star prefix found. Open
audio,canvas,video{display:inline-block;*display:inline;*zoom:1;}
- Exclude checks
Adjoining classes: form .clearfix.success .input-prepend .add-on Open
form .clearfix.success .input-prepend .add-on,form .clearfix.success .input-append .add-on{color:#468847;background-color:#bcddbc;border-color:#468847;}
- Exclude checks
Rule doesn't have all its properties in alphabetical order. Open
button,input[type="button"],input[type="reset"],input[type="submit"]{cursor:pointer;-webkit-appearance:button;}
- Exclude checks
Rule doesn't have all its properties in alphabetical order. Open
.input-append .add-on{-webkit-border-radius:0 3px 3px 0;-moz-border-radius:0 3px 3px 0;border-radius:0 3px 3px 0;margin-right:0;margin-left:-1px;}
- Exclude checks
Rule doesn't have all its properties in alphabetical order. Open
.container{width:940px;margin-left:auto;margin-right:auto;zoom:1;}.container:before,.container:after{display:table;content:"";zoom:1;}
- Exclude checks
Adjoining classes: table .headerSortUp.blue Open
table .headerSortUp.blue,table .headerSortDown.blue{background-color:#ade6fe;}
- Exclude checks
Rule doesn't have all its properties in alphabetical order. Open
.row{zoom:1;margin-left:-20px;}.row:before,.row:after{display:table;content:"";zoom:1;}
- Exclude checks