Showing 1,441 of 1,441 total issues
Use normalcase for variable numbers. Open
file_path_1 = Rails.root.join('spec/fixtures/text/invalid1.bin')
- Read upRead up
- Exclude checks
This cop makes sure that all numbered variables use the configured style, snakecase, normalcase or noninteger, for their numbering.
Example: EnforcedStyle: snake_case
# bad
variable1 = 1
# good
variable_1 = 1
Example: EnforcedStyle: normalcase (default)
# bad
variable_1 = 1
# good
variable1 = 1
Example: EnforcedStyle: non_integer
# bad
variable1 = 1
variable_1 = 1
# good
variableone = 1
variable_one = 1
Redundant curly braces around a hash parameter. Open
{
success: ['valid1.md', 'valid2.md'],
error: []
}
- Read upRead up
- Exclude checks
This cop checks for braces around the last parameter in a method call
if the last parameter is a hash.
It supports braces
, no_braces
and context_dependent
styles.
Example: EnforcedStyle: braces
# The `braces` style enforces braces around all method
# parameters that are hashes.
# bad
some_method(x, y, a: 1, b: 2)
# good
some_method(x, y, {a: 1, b: 2})
Example: EnforcedStyle: no_braces (default)
# The `no_braces` style checks that the last parameter doesn't
# have braces around it.
# bad
some_method(x, y, {a: 1, b: 2})
# good
some_method(x, y, a: 1, b: 2)
Example: EnforcedStyle: context_dependent
# The `context_dependent` style checks that the last parameter
# doesn't have braces around it, but requires braces if the
# second to last parameter is also a hash literal.
# bad
some_method(x, y, {a: 1, b: 2})
some_method(x, y, {a: 1, b: 2}, a: 1, b: 2)
# good
some_method(x, y, a: 1, b: 2)
some_method(x, y, {a: 1, b: 2}, {a: 1, b: 2})
unexpected token tCOLON
(Using Ruby 2.1 parser; configure using TargetRubyVersion
parameter, under AllCops
) Open
'annotator_twitter_handles': ['@john']
- Exclude checks
Line is too long. [81/80] Open
expect(interface.compiled_java_script).to eq(@interface.compiled_java_script)
- Exclude checks
%w
-literals should be delimited by [
and ]
. Open
expect(interface.associated_problem_identifiers.sort).to eq(%w(ner super_ner).sort)
- 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)
Line is too long. [147/80] Open
'payload' => JSON.parse("{\"label\":\"anotherlabel\",\"options\":[\"option1\",\"option2\",\"option3\"],\"content\":\"othercontent\"}"),
- Exclude checks
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
RSpec.describe "WhoAreYou API", type: :request do
- Read upRead up
- Exclude checks
Checks if uses of quotes match the configured preference.
Example: EnforcedStyle: single_quotes (default)
# bad
"No special symbols"
"No string interpolation"
"Just text"
# good
'No special symbols'
'No string interpolation'
'Just text'
"Wait! What's #{this}!"
Example: EnforcedStyle: double_quotes
# bad
'Just some text'
'No special chars or interpolation'
# good
"Just some text"
"No special chars or interpolation"
"Every string in #{project} uses double_quotes"
Use normalcase for variable numbers. Open
statistic_2 = FactoryGirl.build(:statistic, key: 'precision', project: project)
- Read upRead up
- Exclude checks
This cop makes sure that all numbered variables use the configured style, snakecase, normalcase or noninteger, for their numbering.
Example: EnforcedStyle: snake_case
# bad
variable1 = 1
# good
variable_1 = 1
Example: EnforcedStyle: normalcase (default)
# bad
variable_1 = 1
# good
variable1 = 1
Example: EnforcedStyle: non_integer
# bad
variable1 = 1
variable_1 = 1
# good
variableone = 1
variable_one = 1
Indent )
the same as the start of the line where (
is. Open
)
- Read upRead up
- Exclude checks
This cops checks the indentation of hanging closing parentheses in
method calls, method definitions, and grouped expressions. A hanging
closing parenthesis means )
preceded by a line break.
Example:
# good: when x is on its own line, indent this way
func(
x,
y
)
# good: when x follows opening parenthesis, align parentheses
a = b * (x +
y
)
# bad
def func(
x,
y
)
end
Line is too long. [84/80] Open
compare_annotation_document_with_json_response(@annotation_document, json.first)
- Exclude checks
Line is too long. [84/80] Open
compare_annotation_document_with_json_response(@annotation_document, json.first)
- Exclude checks
Line is too long. [90/80] Open
compare_annotation_document_with_json_response(another_annotation_document, json.last)
- Exclude checks
Line is too long. [90/80] Open
compare_annotation_document_with_json_response(another_annotation_document, json.last)
- Exclude checks
Line is too long. [100/80] Open
expect(Paperclip.io_adapters.for(interface.template).read).to eq('<div class="test">test</div>')
- Exclude checks
Line is too long. [136/80] Open
'payload' => JSON.parse("{\"label\":\"testlabel\",\"options\":[\"option1\",\"option2\"],\"content\":\"testcontent\"}"),
- Exclude checks
Line is too long. [88/80] Open
delete api_v1_annotation_document_path(annotation_document, auth_token: @auth_token)
- Exclude checks
Redundant curly braces around a hash parameter. Open
{
success: ['äöüß.md'],
error: []
}
- Read upRead up
- Exclude checks
This cop checks for braces around the last parameter in a method call
if the last parameter is a hash.
It supports braces
, no_braces
and context_dependent
styles.
Example: EnforcedStyle: braces
# The `braces` style enforces braces around all method
# parameters that are hashes.
# bad
some_method(x, y, a: 1, b: 2)
# good
some_method(x, y, {a: 1, b: 2})
Example: EnforcedStyle: no_braces (default)
# The `no_braces` style checks that the last parameter doesn't
# have braces around it.
# bad
some_method(x, y, {a: 1, b: 2})
# good
some_method(x, y, a: 1, b: 2)
Example: EnforcedStyle: context_dependent
# The `context_dependent` style checks that the last parameter
# doesn't have braces around it, but requires braces if the
# second to last parameter is also a hash literal.
# bad
some_method(x, y, {a: 1, b: 2})
some_method(x, y, {a: 1, b: 2}, a: 1, b: 2)
# good
some_method(x, y, a: 1, b: 2)
some_method(x, y, {a: 1, b: 2}, {a: 1, b: 2})
Line is too long. [127/80] Open
'payload' => JSON.parse("{\"label\":\"testlabel\",\"options\":[\"option1\",\"option2\"],\"content\":\"testcontent\"}"),
- Exclude checks
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
'payload' => JSON.parse("{\"label\":\"testlabel\",\"options\":[\"option1\",\"option2\"],\"content\":\"testcontent\"}"),
- Read upRead up
- Exclude checks
Checks if uses of quotes match the configured preference.
Example: EnforcedStyle: single_quotes (default)
# bad
"No special symbols"
"No string interpolation"
"Just text"
# good
'No special symbols'
'No string interpolation'
'Just text'
"Wait! What's #{this}!"
Example: EnforcedStyle: double_quotes
# bad
'Just some text'
'No special chars or interpolation'
# good
"Just some text"
"No special chars or interpolation"
"Every string in #{project} uses double_quotes"
Use normalcase for variable numbers. Open
statistic_2 = FactoryGirl.build(:statistic, key: 'precision', project: project)
- Read upRead up
- Exclude checks
This cop makes sure that all numbered variables use the configured style, snakecase, normalcase or noninteger, for their numbering.
Example: EnforcedStyle: snake_case
# bad
variable1 = 1
# good
variable_1 = 1
Example: EnforcedStyle: normalcase (default)
# bad
variable_1 = 1
# good
variable1 = 1
Example: EnforcedStyle: non_integer
# bad
variable1 = 1
variable_1 = 1
# good
variableone = 1
variable_one = 1