Module has too many lines. [126/100] Open
module XlsShared
# Converts standard (ruby/C++/unix/...) strftime formatting to MS's formatting
#
# @param [String, nil] ms_nr_format (nil returns nil)
# @return [String, nil]
- Read upRead up
- Exclude checks
This cop checks if the length a module exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
You can set literals you want to fold with CountAsOne
.
Available are: 'array', 'hash', and 'heredoc'. Each literal
will be counted as one line regardless of its actual size.
Example: CountAsOne: ['array', 'heredoc']
module M
ARRAY = [ # +1
1,
2
]
HASH = { # +3
key: 'value'
}
MSG = <<~HEREDOC # +1
Heredoc
content.
HEREDOC
end # 5 points
Method has too many lines. [25/10] Open
def ms_formatting_to_strftime ms_nr_format
ms_nr_format = num_fmt_id_to_ms_formatting(ms_nr_format) if ms_nr_format.is_a? Integer
if ms_nr_format
ms_nr_format = ms_nr_format.to_s.downcase
return nil if (ms_nr_format == "general") || (ms_nr_format == "")
- Read upRead up
- Exclude checks
This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
You can set literals you want to fold with CountAsOne
.
Available are: 'array', 'hash', and 'heredoc'. Each literal
will be counted as one line regardless of its actual size.
NOTE: The ExcludedMethods
configuration is deprecated and only kept
for backwards compatibility. Please use IgnoredMethods
instead.
Example: CountAsOne: ['array', 'heredoc']
def m
array = [ # +1
1,
2
]
hash = { # +3
key: 'value'
}
<<~HEREDOC # +1
Heredoc
content.
HEREDOC
end # 5 points
Method has too many lines. [13/10] Open
def num_fmt_id_to_ms_formatting num_fmt_id
# from: https://stackoverflow.com/questions/4730152/what-indicates-an-office-open-xml-cell-contains-a-date-time-value
{"0" => nil, "1" => "0", "2" => "0.00", "3" => "#,##0", "4" => "#,##0.00",
"9" => "0%", "10" => "0.00%", "11" => "0.00E+00", "12" => "# ?/?",
"13" => "# ??/??", "14" => "mm-dd-yy", "15" => "d-mmm-yy", "16" => "d-mmm",
- Read upRead up
- Exclude checks
This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
You can set literals you want to fold with CountAsOne
.
Available are: 'array', 'hash', and 'heredoc'. Each literal
will be counted as one line regardless of its actual size.
NOTE: The ExcludedMethods
configuration is deprecated and only kept
for backwards compatibility. Please use IgnoredMethods
instead.
Example: CountAsOne: ['array', 'heredoc']
def m
array = [ # +1
1,
2
]
hash = { # +3
key: 'value'
}
<<~HEREDOC # +1
Heredoc
content.
HEREDOC
end # 5 points
Line is too long. [214/120] Open
numberformat.gsub("%Y", "yyyy").gsub("%A", "dddd").gsub("%B", "mmmm").gsub("%a", "ddd").gsub("%b", "mmm").gsub("%y", "yy").gsub("%d", "dd").gsub("%m", "mm").gsub("%y", "y").gsub("%y", "%%y").gsub("%e", "d")
- Read upRead up
- Exclude checks
This cop checks the length of lines in the source code.
The maximum length is configurable.
The tab size is configured in the IndentationWidth
of the Layout/IndentationStyle
cop.
It also ignores a shebang line by default.
This cop has some autocorrection capabilities. It can programmatically shorten certain long lines by inserting line breaks into expressions that can be safely split across lines. These include arrays, hashes, and method calls with argument lists.
If autocorrection is enabled, the following Layout cops are recommended to further format the broken lines. (Many of these are enabled by default.)
- ArgumentAlignment
- BlockAlignment
- BlockDelimiters
- BlockEndNewline
- ClosingParenthesisIndentation
- FirstArgumentIndentation
- FirstArrayElementIndentation
- FirstHashElementIndentation
- FirstParameterIndentation
- HashAlignment
- IndentationWidth
- MultilineArrayLineBreaks
- MultilineBlockLayout
- MultilineHashBraceLayout
- MultilineHashKeyLineBreaks
- MultilineMethodArgumentLineBreaks
- ParameterAlignment
Together, these cops will pretty print hashes, arrays, method calls, etc. For example, let's say the max columns is 25:
Example:
# bad
{foo: "0000000000", bar: "0000000000", baz: "0000000000"}
# good
{foo: "0000000000",
bar: "0000000000", baz: "0000000000"}
# good (with recommended cops enabled)
{
foo: "0000000000",
bar: "0000000000",
baz: "0000000000",
}
Use normalcase for symbol numbers. Open
xls_color_4: "#00FF00",
- Read upRead up
- Exclude checks
This cop makes sure that all numbered variables use the configured style, snakecase, normalcase, or noninteger, for their numbering.
Additionally, CheckMethodNames
and CheckSymbols
configuration options
can be used to specify whether method names and symbols should be checked.
Both are enabled by default.
Example: EnforcedStyle: snake_case
# bad
:some_sym1
variable1 = 1
def some_method1; end
def some_method_1(arg1); end
# good
:some_sym_1
variable_1 = 1
def some_method_1; end
def some_method_1(arg_1); end
Example: EnforcedStyle: normalcase (default)
# bad
:some_sym_1
variable_1 = 1
def some_method_1; end
def some_method1(arg_1); end
# good
:some_sym1
variable1 = 1
def some_method1; end
def some_method1(arg1); end
Example: EnforcedStyle: non_integer
# bad
:some_sym1
:some_sym_1
variable1 = 1
variable_1 = 1
def some_method1; end
def some_method_1; end
def some_methodone(arg1); end
def some_methodone(arg_1); end
# good
:some_symone
:some_sym_one
variableone = 1
variable_one = 1
def some_methodone; end
def some_method_one; end
def some_methodone(argone); end
def some_methodone(arg_one); end
# In the following examples, we assume `EnforcedStyle: normalcase` (default).
Example: CheckMethodNames: true (default)
# bad
def some_method_1; end
Example: CheckMethodNames: false
# good
def some_method_1; end
Example: CheckSymbols: true (default)
# bad
:some_sym_1
Example: CheckSymbols: false
# good
:some_sym_1
Example: AllowedIdentifiers: [capture3]
# good
expect(Open3).to receive(:capture3)
Use normalcase for symbol numbers. Open
xls_color_21: "#660066",
- Read upRead up
- Exclude checks
This cop makes sure that all numbered variables use the configured style, snakecase, normalcase, or noninteger, for their numbering.
Additionally, CheckMethodNames
and CheckSymbols
configuration options
can be used to specify whether method names and symbols should be checked.
Both are enabled by default.
Example: EnforcedStyle: snake_case
# bad
:some_sym1
variable1 = 1
def some_method1; end
def some_method_1(arg1); end
# good
:some_sym_1
variable_1 = 1
def some_method_1; end
def some_method_1(arg_1); end
Example: EnforcedStyle: normalcase (default)
# bad
:some_sym_1
variable_1 = 1
def some_method_1; end
def some_method1(arg_1); end
# good
:some_sym1
variable1 = 1
def some_method1; end
def some_method1(arg1); end
Example: EnforcedStyle: non_integer
# bad
:some_sym1
:some_sym_1
variable1 = 1
variable_1 = 1
def some_method1; end
def some_method_1; end
def some_methodone(arg1); end
def some_methodone(arg_1); end
# good
:some_symone
:some_sym_one
variableone = 1
variable_one = 1
def some_methodone; end
def some_method_one; end
def some_methodone(argone); end
def some_methodone(arg_one); end
# In the following examples, we assume `EnforcedStyle: normalcase` (default).
Example: CheckMethodNames: true (default)
# bad
def some_method_1; end
Example: CheckMethodNames: false
# good
def some_method_1; end
Example: CheckSymbols: true (default)
# bad
:some_sym_1
Example: CheckSymbols: false
# good
:some_sym_1
Example: AllowedIdentifiers: [capture3]
# good
expect(Open3).to receive(:capture3)
Use normalcase for symbol numbers. Open
xls_color_33: "#00CCFF",
- Read upRead up
- Exclude checks
This cop makes sure that all numbered variables use the configured style, snakecase, normalcase, or noninteger, for their numbering.
Additionally, CheckMethodNames
and CheckSymbols
configuration options
can be used to specify whether method names and symbols should be checked.
Both are enabled by default.
Example: EnforcedStyle: snake_case
# bad
:some_sym1
variable1 = 1
def some_method1; end
def some_method_1(arg1); end
# good
:some_sym_1
variable_1 = 1
def some_method_1; end
def some_method_1(arg_1); end
Example: EnforcedStyle: normalcase (default)
# bad
:some_sym_1
variable_1 = 1
def some_method_1; end
def some_method1(arg_1); end
# good
:some_sym1
variable1 = 1
def some_method1; end
def some_method1(arg1); end
Example: EnforcedStyle: non_integer
# bad
:some_sym1
:some_sym_1
variable1 = 1
variable_1 = 1
def some_method1; end
def some_method_1; end
def some_methodone(arg1); end
def some_methodone(arg_1); end
# good
:some_symone
:some_sym_one
variableone = 1
variable_one = 1
def some_methodone; end
def some_method_one; end
def some_methodone(argone); end
def some_methodone(arg_one); end
# In the following examples, we assume `EnforcedStyle: normalcase` (default).
Example: CheckMethodNames: true (default)
# bad
def some_method_1; end
Example: CheckMethodNames: false
# good
def some_method_1; end
Example: CheckSymbols: true (default)
# bad
:some_sym_1
Example: CheckSymbols: false
# good
:some_sym_1
Example: AllowedIdentifiers: [capture3]
# good
expect(Open3).to receive(:capture3)
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
"37" => "#,##0 ;(#,##0)", "38" => "#,##0 ;[Red](#,##0)",
- 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 symbol numbers. Open
xls_color_36: "#FFFF99",
- Read upRead up
- Exclude checks
This cop makes sure that all numbered variables use the configured style, snakecase, normalcase, or noninteger, for their numbering.
Additionally, CheckMethodNames
and CheckSymbols
configuration options
can be used to specify whether method names and symbols should be checked.
Both are enabled by default.
Example: EnforcedStyle: snake_case
# bad
:some_sym1
variable1 = 1
def some_method1; end
def some_method_1(arg1); end
# good
:some_sym_1
variable_1 = 1
def some_method_1; end
def some_method_1(arg_1); end
Example: EnforcedStyle: normalcase (default)
# bad
:some_sym_1
variable_1 = 1
def some_method_1; end
def some_method1(arg_1); end
# good
:some_sym1
variable1 = 1
def some_method1; end
def some_method1(arg1); end
Example: EnforcedStyle: non_integer
# bad
:some_sym1
:some_sym_1
variable1 = 1
variable_1 = 1
def some_method1; end
def some_method_1; end
def some_methodone(arg1); end
def some_methodone(arg_1); end
# good
:some_symone
:some_sym_one
variableone = 1
variable_one = 1
def some_methodone; end
def some_method_one; end
def some_methodone(argone); end
def some_methodone(arg_one); end
# In the following examples, we assume `EnforcedStyle: normalcase` (default).
Example: CheckMethodNames: true (default)
# bad
def some_method_1; end
Example: CheckMethodNames: false
# good
def some_method_1; end
Example: CheckSymbols: true (default)
# bad
:some_sym_1
Example: CheckSymbols: false
# good
:some_sym_1
Example: AllowedIdentifiers: [capture3]
# good
expect(Open3).to receive(:capture3)
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
return nil if (ms_nr_format == "general") || (ms_nr_format == "")
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
return nil if (ms_nr_format == "general") || (ms_nr_format == "")
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
"13" => "# ??/??", "14" => "mm-dd-yy", "15" => "d-mmm-yy", "16" => "d-mmm",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
"17" => "mmm-yy", "18" => "h:mm AM/PM", "19" => "h:mm:ss AM/PM",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
"20" => "h:mm", "21" => "h:mm:ss", "22" => "m/d/yy h:mm",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
"50" => "[$-404]e/m/d", "57" => "[$-404]e/m/d", "59" => "t0", "60" => "t0.00",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
"69" => "t# ?/?", "70" => "t# ??/??"}[num_fmt_id.to_s]
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
numberformat.gsub("%Y", "yyyy").gsub("%A", "dddd").gsub("%B", "mmmm").gsub("%a", "ddd").gsub("%b", "mmm").gsub("%y", "yy").gsub("%d", "dd").gsub("%m", "mm").gsub("%y", "y").gsub("%y", "%%y").gsub("%e", "d")
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
xls_color_6: "#FFFF00",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
xls_color_20: "#CCFFFF",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
xls_color_37: "#99CCFF",
- 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 symbol numbers. Open
xls_color_26: "#FF00FF",
- Read upRead up
- Exclude checks
This cop makes sure that all numbered variables use the configured style, snakecase, normalcase, or noninteger, for their numbering.
Additionally, CheckMethodNames
and CheckSymbols
configuration options
can be used to specify whether method names and symbols should be checked.
Both are enabled by default.
Example: EnforcedStyle: snake_case
# bad
:some_sym1
variable1 = 1
def some_method1; end
def some_method_1(arg1); end
# good
:some_sym_1
variable_1 = 1
def some_method_1; end
def some_method_1(arg_1); end
Example: EnforcedStyle: normalcase (default)
# bad
:some_sym_1
variable_1 = 1
def some_method_1; end
def some_method1(arg_1); end
# good
:some_sym1
variable1 = 1
def some_method1; end
def some_method1(arg1); end
Example: EnforcedStyle: non_integer
# bad
:some_sym1
:some_sym_1
variable1 = 1
variable_1 = 1
def some_method1; end
def some_method_1; end
def some_methodone(arg1); end
def some_methodone(arg_1); end
# good
:some_symone
:some_sym_one
variableone = 1
variable_one = 1
def some_methodone; end
def some_method_one; end
def some_methodone(argone); end
def some_methodone(arg_one); end
# In the following examples, we assume `EnforcedStyle: normalcase` (default).
Example: CheckMethodNames: true (default)
# bad
def some_method_1; end
Example: CheckMethodNames: false
# good
def some_method_1; end
Example: CheckSymbols: true (default)
# bad
:some_sym_1
Example: CheckSymbols: false
# good
:some_sym_1
Example: AllowedIdentifiers: [capture3]
# good
expect(Open3).to receive(:capture3)
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
"ddd" => "%a",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
{"0" => nil, "1" => "0", "2" => "0.00", "3" => "#,##0", "4" => "#,##0.00",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
"13" => "# ??/??", "14" => "mm-dd-yy", "15" => "d-mmm-yy", "16" => "d-mmm",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
"39" => "#,##0.00;(#,##0.00)", "40" => "#,##0.00;[Red](#,##0.00)",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
"50" => "[$-404]e/m/d", "57" => "[$-404]e/m/d", "59" => "t0", "60" => "t0.00",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
numberformat.gsub("%Y", "yyyy").gsub("%A", "dddd").gsub("%B", "mmmm").gsub("%a", "ddd").gsub("%b", "mmm").gsub("%y", "yy").gsub("%d", "dd").gsub("%m", "mm").gsub("%y", "y").gsub("%y", "%%y").gsub("%e", "d")
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
numberformat.gsub("%Y", "yyyy").gsub("%A", "dddd").gsub("%B", "mmmm").gsub("%a", "ddd").gsub("%b", "mmm").gsub("%y", "yy").gsub("%d", "dd").gsub("%m", "mm").gsub("%y", "y").gsub("%y", "%%y").gsub("%e", "d")
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
numberformat.gsub("%Y", "yyyy").gsub("%A", "dddd").gsub("%B", "mmmm").gsub("%a", "ddd").gsub("%b", "mmm").gsub("%y", "yy").gsub("%d", "dd").gsub("%m", "mm").gsub("%y", "y").gsub("%y", "%%y").gsub("%e", "d")
- 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 symbol numbers. Open
xls_color_18: "#993366",
- Read upRead up
- Exclude checks
This cop makes sure that all numbered variables use the configured style, snakecase, normalcase, or noninteger, for their numbering.
Additionally, CheckMethodNames
and CheckSymbols
configuration options
can be used to specify whether method names and symbols should be checked.
Both are enabled by default.
Example: EnforcedStyle: snake_case
# bad
:some_sym1
variable1 = 1
def some_method1; end
def some_method_1(arg1); end
# good
:some_sym_1
variable_1 = 1
def some_method_1; end
def some_method_1(arg_1); end
Example: EnforcedStyle: normalcase (default)
# bad
:some_sym_1
variable_1 = 1
def some_method_1; end
def some_method1(arg_1); end
# good
:some_sym1
variable1 = 1
def some_method1; end
def some_method1(arg1); end
Example: EnforcedStyle: non_integer
# bad
:some_sym1
:some_sym_1
variable1 = 1
variable_1 = 1
def some_method1; end
def some_method_1; end
def some_methodone(arg1); end
def some_methodone(arg_1); end
# good
:some_symone
:some_sym_one
variableone = 1
variable_one = 1
def some_methodone; end
def some_method_one; end
def some_methodone(argone); end
def some_methodone(arg_one); end
# In the following examples, we assume `EnforcedStyle: normalcase` (default).
Example: CheckMethodNames: true (default)
# bad
def some_method_1; end
Example: CheckMethodNames: false
# good
def some_method_1; end
Example: CheckSymbols: true (default)
# bad
:some_sym_1
Example: CheckSymbols: false
# good
:some_sym_1
Example: AllowedIdentifiers: [capture3]
# good
expect(Open3).to receive(:capture3)
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
"%%e" => "%d",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
"\\" => ""
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
{"0" => nil, "1" => "0", "2" => "0.00", "3" => "#,##0", "4" => "#,##0.00",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
"9" => "0%", "10" => "0.00%", "11" => "0.00E+00", "12" => "# ?/?",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
"9" => "0%", "10" => "0.00%", "11" => "0.00E+00", "12" => "# ?/?",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
"17" => "mmm-yy", "18" => "h:mm AM/PM", "19" => "h:mm:ss AM/PM",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
"17" => "mmm-yy", "18" => "h:mm AM/PM", "19" => "h:mm:ss AM/PM",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
"20" => "h:mm", "21" => "h:mm:ss", "22" => "m/d/yy h:mm",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
"20" => "h:mm", "21" => "h:mm:ss", "22" => "m/d/yy h:mm",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
xls_color_11: "#000080",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
xls_color_19: "#FFFFCC",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
xls_color_48: "#969696",
- 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 symbol numbers. Open
xls_color_24: "#CCCCFF",
- Read upRead up
- Exclude checks
This cop makes sure that all numbered variables use the configured style, snakecase, normalcase, or noninteger, for their numbering.
Additionally, CheckMethodNames
and CheckSymbols
configuration options
can be used to specify whether method names and symbols should be checked.
Both are enabled by default.
Example: EnforcedStyle: snake_case
# bad
:some_sym1
variable1 = 1
def some_method1; end
def some_method_1(arg1); end
# good
:some_sym_1
variable_1 = 1
def some_method_1; end
def some_method_1(arg_1); end
Example: EnforcedStyle: normalcase (default)
# bad
:some_sym_1
variable_1 = 1
def some_method_1; end
def some_method1(arg_1); end
# good
:some_sym1
variable1 = 1
def some_method1; end
def some_method1(arg1); end
Example: EnforcedStyle: non_integer
# bad
:some_sym1
:some_sym_1
variable1 = 1
variable_1 = 1
def some_method1; end
def some_method_1; end
def some_methodone(arg1); end
def some_methodone(arg_1); end
# good
:some_symone
:some_sym_one
variableone = 1
variable_one = 1
def some_methodone; end
def some_method_one; end
def some_methodone(argone); end
def some_methodone(arg_one); end
# In the following examples, we assume `EnforcedStyle: normalcase` (default).
Example: CheckMethodNames: true (default)
# bad
def some_method_1; end
Example: CheckMethodNames: false
# good
def some_method_1; end
Example: CheckSymbols: true (default)
# bad
:some_sym_1
Example: CheckSymbols: false
# good
:some_sym_1
Example: AllowedIdentifiers: [capture3]
# good
expect(Open3).to receive(:capture3)
Use normalcase for symbol numbers. Open
xls_color_25: "#000080",
- Read upRead up
- Exclude checks
This cop makes sure that all numbered variables use the configured style, snakecase, normalcase, or noninteger, for their numbering.
Additionally, CheckMethodNames
and CheckSymbols
configuration options
can be used to specify whether method names and symbols should be checked.
Both are enabled by default.
Example: EnforcedStyle: snake_case
# bad
:some_sym1
variable1 = 1
def some_method1; end
def some_method_1(arg1); end
# good
:some_sym_1
variable_1 = 1
def some_method_1; end
def some_method_1(arg_1); end
Example: EnforcedStyle: normalcase (default)
# bad
:some_sym_1
variable_1 = 1
def some_method_1; end
def some_method1(arg_1); end
# good
:some_sym1
variable1 = 1
def some_method1; end
def some_method1(arg1); end
Example: EnforcedStyle: non_integer
# bad
:some_sym1
:some_sym_1
variable1 = 1
variable_1 = 1
def some_method1; end
def some_method_1; end
def some_methodone(arg1); end
def some_methodone(arg_1); end
# good
:some_symone
:some_sym_one
variableone = 1
variable_one = 1
def some_methodone; end
def some_method_one; end
def some_methodone(argone); end
def some_methodone(arg_one); end
# In the following examples, we assume `EnforcedStyle: normalcase` (default).
Example: CheckMethodNames: true (default)
# bad
def some_method_1; end
Example: CheckMethodNames: false
# good
def some_method_1; end
Example: CheckSymbols: true (default)
# bad
:some_sym_1
Example: CheckSymbols: false
# good
:some_sym_1
Example: AllowedIdentifiers: [capture3]
# good
expect(Open3).to receive(:capture3)
Use normalcase for symbol numbers. Open
xls_color_27: "#FFFF00",
- Read upRead up
- Exclude checks
This cop makes sure that all numbered variables use the configured style, snakecase, normalcase, or noninteger, for their numbering.
Additionally, CheckMethodNames
and CheckSymbols
configuration options
can be used to specify whether method names and symbols should be checked.
Both are enabled by default.
Example: EnforcedStyle: snake_case
# bad
:some_sym1
variable1 = 1
def some_method1; end
def some_method_1(arg1); end
# good
:some_sym_1
variable_1 = 1
def some_method_1; end
def some_method_1(arg_1); end
Example: EnforcedStyle: normalcase (default)
# bad
:some_sym_1
variable_1 = 1
def some_method_1; end
def some_method1(arg_1); end
# good
:some_sym1
variable1 = 1
def some_method1; end
def some_method1(arg1); end
Example: EnforcedStyle: non_integer
# bad
:some_sym1
:some_sym_1
variable1 = 1
variable_1 = 1
def some_method1; end
def some_method_1; end
def some_methodone(arg1); end
def some_methodone(arg_1); end
# good
:some_symone
:some_sym_one
variableone = 1
variable_one = 1
def some_methodone; end
def some_method_one; end
def some_methodone(argone); end
def some_methodone(arg_one); end
# In the following examples, we assume `EnforcedStyle: normalcase` (default).
Example: CheckMethodNames: true (default)
# bad
def some_method_1; end
Example: CheckMethodNames: false
# good
def some_method_1; end
Example: CheckSymbols: true (default)
# bad
:some_sym_1
Example: CheckSymbols: false
# good
:some_sym_1
Example: AllowedIdentifiers: [capture3]
# good
expect(Open3).to receive(:capture3)
Use normalcase for symbol numbers. Open
xls_color_51: "#003300",
- Read upRead up
- Exclude checks
This cop makes sure that all numbered variables use the configured style, snakecase, normalcase, or noninteger, for their numbering.
Additionally, CheckMethodNames
and CheckSymbols
configuration options
can be used to specify whether method names and symbols should be checked.
Both are enabled by default.
Example: EnforcedStyle: snake_case
# bad
:some_sym1
variable1 = 1
def some_method1; end
def some_method_1(arg1); end
# good
:some_sym_1
variable_1 = 1
def some_method_1; end
def some_method_1(arg_1); end
Example: EnforcedStyle: normalcase (default)
# bad
:some_sym_1
variable_1 = 1
def some_method_1; end
def some_method1(arg_1); end
# good
:some_sym1
variable1 = 1
def some_method1; end
def some_method1(arg1); end
Example: EnforcedStyle: non_integer
# bad
:some_sym1
:some_sym_1
variable1 = 1
variable_1 = 1
def some_method1; end
def some_method_1; end
def some_methodone(arg1); end
def some_methodone(arg_1); end
# good
:some_symone
:some_sym_one
variableone = 1
variable_one = 1
def some_methodone; end
def some_method_one; end
def some_methodone(argone); end
def some_methodone(arg_one); end
# In the following examples, we assume `EnforcedStyle: normalcase` (default).
Example: CheckMethodNames: true (default)
# bad
def some_method_1; end
Example: CheckMethodNames: false
# good
def some_method_1; end
Example: CheckSymbols: true (default)
# bad
:some_sym_1
Example: CheckSymbols: false
# good
:some_sym_1
Example: AllowedIdentifiers: [capture3]
# good
expect(Open3).to receive(:capture3)
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
"yyyy" => "%Y",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
"%%y" => "%y",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
"%%e" => "%d",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
"%%m" => "%m",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
"17" => "mmm-yy", "18" => "h:mm AM/PM", "19" => "h:mm:ss AM/PM",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
"17" => "mmm-yy", "18" => "h:mm AM/PM", "19" => "h:mm:ss AM/PM",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
"37" => "#,##0 ;(#,##0)", "38" => "#,##0 ;[Red](#,##0)",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
"49" => "@", "27" => "[$-404]e/m/d", "30" => "m/d/yy", "36" => "[$-404]e/m/d",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
"50" => "[$-404]e/m/d", "57" => "[$-404]e/m/d", "59" => "t0", "60" => "t0.00",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
"61" => "t#,##0", "62" => "t#,##0.00", "67" => "t0%", "68" => "t0.00%",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
"61" => "t#,##0", "62" => "t#,##0.00", "67" => "t0%", "68" => "t0.00%",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
"69" => "t# ?/?", "70" => "t# ??/??"}[num_fmt_id.to_s]
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
xls_color_12: "#808000",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
xls_color_14: "#008080",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
xls_color_51: "#003300",
- 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 symbol numbers. Open
xls_color_3: "#FF0000",
- Read upRead up
- Exclude checks
This cop makes sure that all numbered variables use the configured style, snakecase, normalcase, or noninteger, for their numbering.
Additionally, CheckMethodNames
and CheckSymbols
configuration options
can be used to specify whether method names and symbols should be checked.
Both are enabled by default.
Example: EnforcedStyle: snake_case
# bad
:some_sym1
variable1 = 1
def some_method1; end
def some_method_1(arg1); end
# good
:some_sym_1
variable_1 = 1
def some_method_1; end
def some_method_1(arg_1); end
Example: EnforcedStyle: normalcase (default)
# bad
:some_sym_1
variable_1 = 1
def some_method_1; end
def some_method1(arg_1); end
# good
:some_sym1
variable1 = 1
def some_method1; end
def some_method1(arg1); end
Example: EnforcedStyle: non_integer
# bad
:some_sym1
:some_sym_1
variable1 = 1
variable_1 = 1
def some_method1; end
def some_method_1; end
def some_methodone(arg1); end
def some_methodone(arg_1); end
# good
:some_symone
:some_sym_one
variableone = 1
variable_one = 1
def some_methodone; end
def some_method_one; end
def some_methodone(argone); end
def some_methodone(arg_one); end
# In the following examples, we assume `EnforcedStyle: normalcase` (default).
Example: CheckMethodNames: true (default)
# bad
def some_method_1; end
Example: CheckMethodNames: false
# good
def some_method_1; end
Example: CheckSymbols: true (default)
# bad
:some_sym_1
Example: CheckSymbols: false
# good
:some_sym_1
Example: AllowedIdentifiers: [capture3]
# good
expect(Open3).to receive(:capture3)
Use normalcase for symbol numbers. Open
xls_color_9: "#800000",
- Read upRead up
- Exclude checks
This cop makes sure that all numbered variables use the configured style, snakecase, normalcase, or noninteger, for their numbering.
Additionally, CheckMethodNames
and CheckSymbols
configuration options
can be used to specify whether method names and symbols should be checked.
Both are enabled by default.
Example: EnforcedStyle: snake_case
# bad
:some_sym1
variable1 = 1
def some_method1; end
def some_method_1(arg1); end
# good
:some_sym_1
variable_1 = 1
def some_method_1; end
def some_method_1(arg_1); end
Example: EnforcedStyle: normalcase (default)
# bad
:some_sym_1
variable_1 = 1
def some_method_1; end
def some_method1(arg_1); end
# good
:some_sym1
variable1 = 1
def some_method1; end
def some_method1(arg1); end
Example: EnforcedStyle: non_integer
# bad
:some_sym1
:some_sym_1
variable1 = 1
variable_1 = 1
def some_method1; end
def some_method_1; end
def some_methodone(arg1); end
def some_methodone(arg_1); end
# good
:some_symone
:some_sym_one
variableone = 1
variable_one = 1
def some_methodone; end
def some_method_one; end
def some_methodone(argone); end
def some_methodone(arg_one); end
# In the following examples, we assume `EnforcedStyle: normalcase` (default).
Example: CheckMethodNames: true (default)
# bad
def some_method_1; end
Example: CheckMethodNames: false
# good
def some_method_1; end
Example: CheckSymbols: true (default)
# bad
:some_sym_1
Example: CheckSymbols: false
# good
:some_sym_1
Example: AllowedIdentifiers: [capture3]
# good
expect(Open3).to receive(:capture3)
Use normalcase for symbol numbers. Open
xls_color_15: "#C0C0C0",
- Read upRead up
- Exclude checks
This cop makes sure that all numbered variables use the configured style, snakecase, normalcase, or noninteger, for their numbering.
Additionally, CheckMethodNames
and CheckSymbols
configuration options
can be used to specify whether method names and symbols should be checked.
Both are enabled by default.
Example: EnforcedStyle: snake_case
# bad
:some_sym1
variable1 = 1
def some_method1; end
def some_method_1(arg1); end
# good
:some_sym_1
variable_1 = 1
def some_method_1; end
def some_method_1(arg_1); end
Example: EnforcedStyle: normalcase (default)
# bad
:some_sym_1
variable_1 = 1
def some_method_1; end
def some_method1(arg_1); end
# good
:some_sym1
variable1 = 1
def some_method1; end
def some_method1(arg1); end
Example: EnforcedStyle: non_integer
# bad
:some_sym1
:some_sym_1
variable1 = 1
variable_1 = 1
def some_method1; end
def some_method_1; end
def some_methodone(arg1); end
def some_methodone(arg_1); end
# good
:some_symone
:some_sym_one
variableone = 1
variable_one = 1
def some_methodone; end
def some_method_one; end
def some_methodone(argone); end
def some_methodone(arg_one); end
# In the following examples, we assume `EnforcedStyle: normalcase` (default).
Example: CheckMethodNames: true (default)
# bad
def some_method_1; end
Example: CheckMethodNames: false
# good
def some_method_1; end
Example: CheckSymbols: true (default)
# bad
:some_sym_1
Example: CheckSymbols: false
# good
:some_sym_1
Example: AllowedIdentifiers: [capture3]
# good
expect(Open3).to receive(:capture3)
Use normalcase for symbol numbers. Open
xls_color_35: "#CCFFCC",
- Read upRead up
- Exclude checks
This cop makes sure that all numbered variables use the configured style, snakecase, normalcase, or noninteger, for their numbering.
Additionally, CheckMethodNames
and CheckSymbols
configuration options
can be used to specify whether method names and symbols should be checked.
Both are enabled by default.
Example: EnforcedStyle: snake_case
# bad
:some_sym1
variable1 = 1
def some_method1; end
def some_method_1(arg1); end
# good
:some_sym_1
variable_1 = 1
def some_method_1; end
def some_method_1(arg_1); end
Example: EnforcedStyle: normalcase (default)
# bad
:some_sym_1
variable_1 = 1
def some_method_1; end
def some_method1(arg_1); end
# good
:some_sym1
variable1 = 1
def some_method1; end
def some_method1(arg1); end
Example: EnforcedStyle: non_integer
# bad
:some_sym1
:some_sym_1
variable1 = 1
variable_1 = 1
def some_method1; end
def some_method_1; end
def some_methodone(arg1); end
def some_methodone(arg_1); end
# good
:some_symone
:some_sym_one
variableone = 1
variable_one = 1
def some_methodone; end
def some_method_one; end
def some_methodone(argone); end
def some_methodone(arg_one); end
# In the following examples, we assume `EnforcedStyle: normalcase` (default).
Example: CheckMethodNames: true (default)
# bad
def some_method_1; end
Example: CheckMethodNames: false
# good
def some_method_1; end
Example: CheckSymbols: true (default)
# bad
:some_sym_1
Example: CheckSymbols: false
# good
:some_sym_1
Example: AllowedIdentifiers: [capture3]
# good
expect(Open3).to receive(:capture3)
Use normalcase for symbol numbers. Open
xls_color_43: "#99CC00",
- Read upRead up
- Exclude checks
This cop makes sure that all numbered variables use the configured style, snakecase, normalcase, or noninteger, for their numbering.
Additionally, CheckMethodNames
and CheckSymbols
configuration options
can be used to specify whether method names and symbols should be checked.
Both are enabled by default.
Example: EnforcedStyle: snake_case
# bad
:some_sym1
variable1 = 1
def some_method1; end
def some_method_1(arg1); end
# good
:some_sym_1
variable_1 = 1
def some_method_1; end
def some_method_1(arg_1); end
Example: EnforcedStyle: normalcase (default)
# bad
:some_sym_1
variable_1 = 1
def some_method_1; end
def some_method1(arg_1); end
# good
:some_sym1
variable1 = 1
def some_method1; end
def some_method1(arg1); end
Example: EnforcedStyle: non_integer
# bad
:some_sym1
:some_sym_1
variable1 = 1
variable_1 = 1
def some_method1; end
def some_method_1; end
def some_methodone(arg1); end
def some_methodone(arg_1); end
# good
:some_symone
:some_sym_one
variableone = 1
variable_one = 1
def some_methodone; end
def some_method_one; end
def some_methodone(argone); end
def some_methodone(arg_one); end
# In the following examples, we assume `EnforcedStyle: normalcase` (default).
Example: CheckMethodNames: true (default)
# bad
def some_method_1; end
Example: CheckMethodNames: false
# good
def some_method_1; end
Example: CheckSymbols: true (default)
# bad
:some_sym_1
Example: CheckSymbols: false
# good
:some_sym_1
Example: AllowedIdentifiers: [capture3]
# good
expect(Open3).to receive(:capture3)
Use normalcase for symbol numbers. Open
xls_color_44: "#FFCC00",
- Read upRead up
- Exclude checks
This cop makes sure that all numbered variables use the configured style, snakecase, normalcase, or noninteger, for their numbering.
Additionally, CheckMethodNames
and CheckSymbols
configuration options
can be used to specify whether method names and symbols should be checked.
Both are enabled by default.
Example: EnforcedStyle: snake_case
# bad
:some_sym1
variable1 = 1
def some_method1; end
def some_method_1(arg1); end
# good
:some_sym_1
variable_1 = 1
def some_method_1; end
def some_method_1(arg_1); end
Example: EnforcedStyle: normalcase (default)
# bad
:some_sym_1
variable_1 = 1
def some_method_1; end
def some_method1(arg_1); end
# good
:some_sym1
variable1 = 1
def some_method1; end
def some_method1(arg1); end
Example: EnforcedStyle: non_integer
# bad
:some_sym1
:some_sym_1
variable1 = 1
variable_1 = 1
def some_method1; end
def some_method_1; end
def some_methodone(arg1); end
def some_methodone(arg_1); end
# good
:some_symone
:some_sym_one
variableone = 1
variable_one = 1
def some_methodone; end
def some_method_one; end
def some_methodone(argone); end
def some_methodone(arg_one); end
# In the following examples, we assume `EnforcedStyle: normalcase` (default).
Example: CheckMethodNames: true (default)
# bad
def some_method_1; end
Example: CheckMethodNames: false
# good
def some_method_1; end
Example: CheckSymbols: true (default)
# bad
:some_sym_1
Example: CheckSymbols: false
# good
:some_sym_1
Example: AllowedIdentifiers: [capture3]
# good
expect(Open3).to receive(:capture3)
Use normalcase for symbol numbers. Open
xls_color_47: "#666699",
- Read upRead up
- Exclude checks
This cop makes sure that all numbered variables use the configured style, snakecase, normalcase, or noninteger, for their numbering.
Additionally, CheckMethodNames
and CheckSymbols
configuration options
can be used to specify whether method names and symbols should be checked.
Both are enabled by default.
Example: EnforcedStyle: snake_case
# bad
:some_sym1
variable1 = 1
def some_method1; end
def some_method_1(arg1); end
# good
:some_sym_1
variable_1 = 1
def some_method_1; end
def some_method_1(arg_1); end
Example: EnforcedStyle: normalcase (default)
# bad
:some_sym_1
variable_1 = 1
def some_method_1; end
def some_method1(arg_1); end
# good
:some_sym1
variable1 = 1
def some_method1; end
def some_method1(arg1); end
Example: EnforcedStyle: non_integer
# bad
:some_sym1
:some_sym_1
variable1 = 1
variable_1 = 1
def some_method1; end
def some_method_1; end
def some_methodone(arg1); end
def some_methodone(arg_1); end
# good
:some_symone
:some_sym_one
variableone = 1
variable_one = 1
def some_methodone; end
def some_method_one; end
def some_methodone(argone); end
def some_methodone(arg_one); end
# In the following examples, we assume `EnforcedStyle: normalcase` (default).
Example: CheckMethodNames: true (default)
# bad
def some_method_1; end
Example: CheckMethodNames: false
# good
def some_method_1; end
Example: CheckSymbols: true (default)
# bad
:some_sym_1
Example: CheckSymbols: false
# good
:some_sym_1
Example: AllowedIdentifiers: [capture3]
# good
expect(Open3).to receive(:capture3)
Use normalcase for symbol numbers. Open
xls_color_56: "#333333",
- Read upRead up
- Exclude checks
This cop makes sure that all numbered variables use the configured style, snakecase, normalcase, or noninteger, for their numbering.
Additionally, CheckMethodNames
and CheckSymbols
configuration options
can be used to specify whether method names and symbols should be checked.
Both are enabled by default.
Example: EnforcedStyle: snake_case
# bad
:some_sym1
variable1 = 1
def some_method1; end
def some_method_1(arg1); end
# good
:some_sym_1
variable_1 = 1
def some_method_1; end
def some_method_1(arg_1); end
Example: EnforcedStyle: normalcase (default)
# bad
:some_sym_1
variable_1 = 1
def some_method_1; end
def some_method1(arg_1); end
# good
:some_sym1
variable1 = 1
def some_method1; end
def some_method1(arg1); end
Example: EnforcedStyle: non_integer
# bad
:some_sym1
:some_sym_1
variable1 = 1
variable_1 = 1
def some_method1; end
def some_method_1; end
def some_methodone(arg1); end
def some_methodone(arg_1); end
# good
:some_symone
:some_sym_one
variableone = 1
variable_one = 1
def some_methodone; end
def some_method_one; end
def some_methodone(argone); end
def some_methodone(arg_one); end
# In the following examples, we assume `EnforcedStyle: normalcase` (default).
Example: CheckMethodNames: true (default)
# bad
def some_method_1; end
Example: CheckMethodNames: false
# good
def some_method_1; end
Example: CheckSymbols: true (default)
# bad
:some_sym_1
Example: CheckSymbols: false
# good
:some_sym_1
Example: AllowedIdentifiers: [capture3]
# good
expect(Open3).to receive(:capture3)
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
"mm" => "%m",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
"%%y" => "%y",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
{"0" => nil, "1" => "0", "2" => "0.00", "3" => "#,##0", "4" => "#,##0.00",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
"13" => "# ??/??", "14" => "mm-dd-yy", "15" => "d-mmm-yy", "16" => "d-mmm",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
"13" => "# ??/??", "14" => "mm-dd-yy", "15" => "d-mmm-yy", "16" => "d-mmm",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
"20" => "h:mm", "21" => "h:mm:ss", "22" => "m/d/yy h:mm",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
"39" => "#,##0.00;(#,##0.00)", "40" => "#,##0.00;[Red](#,##0.00)",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
"45" => "mm:ss", "46" => "[h]:mm:ss", "47" => "mmss.0", "48" => "##0.0E+0",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
"45" => "mm:ss", "46" => "[h]:mm:ss", "47" => "mmss.0", "48" => "##0.0E+0",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
"61" => "t#,##0", "62" => "t#,##0.00", "67" => "t0%", "68" => "t0.00%",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
numberformat.gsub("%Y", "yyyy").gsub("%A", "dddd").gsub("%B", "mmmm").gsub("%a", "ddd").gsub("%b", "mmm").gsub("%y", "yy").gsub("%d", "dd").gsub("%m", "mm").gsub("%y", "y").gsub("%y", "%%y").gsub("%e", "d")
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
numberformat.gsub("%Y", "yyyy").gsub("%A", "dddd").gsub("%B", "mmmm").gsub("%a", "ddd").gsub("%b", "mmm").gsub("%y", "yy").gsub("%d", "dd").gsub("%m", "mm").gsub("%y", "y").gsub("%y", "%%y").gsub("%e", "d")
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
xls_color_13: "#800080",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
xls_color_22: "#FF8080",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
xls_color_27: "#FFFF00",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
xls_color_36: "#FFFF99",
- 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"
Add empty line after guard clause. Open
return nil if (ms_nr_format == "general") || (ms_nr_format == "")
- Read upRead up
- Exclude checks
This cop enforces empty line after guard clause
Example:
# bad
def foo
return if need_return?
bar
end
# good
def foo
return if need_return?
bar
end
# good
def foo
return if something?
return if something_different?
bar
end
# also good
def foo
if something?
do_something
return if need_return?
end
end
Use normalcase for symbol numbers. Open
xls_color_6: "#FFFF00",
- Read upRead up
- Exclude checks
This cop makes sure that all numbered variables use the configured style, snakecase, normalcase, or noninteger, for their numbering.
Additionally, CheckMethodNames
and CheckSymbols
configuration options
can be used to specify whether method names and symbols should be checked.
Both are enabled by default.
Example: EnforcedStyle: snake_case
# bad
:some_sym1
variable1 = 1
def some_method1; end
def some_method_1(arg1); end
# good
:some_sym_1
variable_1 = 1
def some_method_1; end
def some_method_1(arg_1); end
Example: EnforcedStyle: normalcase (default)
# bad
:some_sym_1
variable_1 = 1
def some_method_1; end
def some_method1(arg_1); end
# good
:some_sym1
variable1 = 1
def some_method1; end
def some_method1(arg1); end
Example: EnforcedStyle: non_integer
# bad
:some_sym1
:some_sym_1
variable1 = 1
variable_1 = 1
def some_method1; end
def some_method_1; end
def some_methodone(arg1); end
def some_methodone(arg_1); end
# good
:some_symone
:some_sym_one
variableone = 1
variable_one = 1
def some_methodone; end
def some_method_one; end
def some_methodone(argone); end
def some_methodone(arg_one); end
# In the following examples, we assume `EnforcedStyle: normalcase` (default).
Example: CheckMethodNames: true (default)
# bad
def some_method_1; end
Example: CheckMethodNames: false
# good
def some_method_1; end
Example: CheckSymbols: true (default)
# bad
:some_sym_1
Example: CheckSymbols: false
# good
:some_sym_1
Example: AllowedIdentifiers: [capture3]
# good
expect(Open3).to receive(:capture3)
Use normalcase for symbol numbers. Open
xls_color_12: "#808000",
- Read upRead up
- Exclude checks
This cop makes sure that all numbered variables use the configured style, snakecase, normalcase, or noninteger, for their numbering.
Additionally, CheckMethodNames
and CheckSymbols
configuration options
can be used to specify whether method names and symbols should be checked.
Both are enabled by default.
Example: EnforcedStyle: snake_case
# bad
:some_sym1
variable1 = 1
def some_method1; end
def some_method_1(arg1); end
# good
:some_sym_1
variable_1 = 1
def some_method_1; end
def some_method_1(arg_1); end
Example: EnforcedStyle: normalcase (default)
# bad
:some_sym_1
variable_1 = 1
def some_method_1; end
def some_method1(arg_1); end
# good
:some_sym1
variable1 = 1
def some_method1; end
def some_method1(arg1); end
Example: EnforcedStyle: non_integer
# bad
:some_sym1
:some_sym_1
variable1 = 1
variable_1 = 1
def some_method1; end
def some_method_1; end
def some_methodone(arg1); end
def some_methodone(arg_1); end
# good
:some_symone
:some_sym_one
variableone = 1
variable_one = 1
def some_methodone; end
def some_method_one; end
def some_methodone(argone); end
def some_methodone(arg_one); end
# In the following examples, we assume `EnforcedStyle: normalcase` (default).
Example: CheckMethodNames: true (default)
# bad
def some_method_1; end
Example: CheckMethodNames: false
# good
def some_method_1; end
Example: CheckSymbols: true (default)
# bad
:some_sym_1
Example: CheckSymbols: false
# good
:some_sym_1
Example: AllowedIdentifiers: [capture3]
# good
expect(Open3).to receive(:capture3)
Use normalcase for symbol numbers. Open
xls_color_28: "#00FFFF",
- Read upRead up
- Exclude checks
This cop makes sure that all numbered variables use the configured style, snakecase, normalcase, or noninteger, for their numbering.
Additionally, CheckMethodNames
and CheckSymbols
configuration options
can be used to specify whether method names and symbols should be checked.
Both are enabled by default.
Example: EnforcedStyle: snake_case
# bad
:some_sym1
variable1 = 1
def some_method1; end
def some_method_1(arg1); end
# good
:some_sym_1
variable_1 = 1
def some_method_1; end
def some_method_1(arg_1); end
Example: EnforcedStyle: normalcase (default)
# bad
:some_sym_1
variable_1 = 1
def some_method_1; end
def some_method1(arg_1); end
# good
:some_sym1
variable1 = 1
def some_method1; end
def some_method1(arg1); end
Example: EnforcedStyle: non_integer
# bad
:some_sym1
:some_sym_1
variable1 = 1
variable_1 = 1
def some_method1; end
def some_method_1; end
def some_methodone(arg1); end
def some_methodone(arg_1); end
# good
:some_symone
:some_sym_one
variableone = 1
variable_one = 1
def some_methodone; end
def some_method_one; end
def some_methodone(argone); end
def some_methodone(arg_one); end
# In the following examples, we assume `EnforcedStyle: normalcase` (default).
Example: CheckMethodNames: true (default)
# bad
def some_method_1; end
Example: CheckMethodNames: false
# good
def some_method_1; end
Example: CheckSymbols: true (default)
# bad
:some_sym_1
Example: CheckSymbols: false
# good
:some_sym_1
Example: AllowedIdentifiers: [capture3]
# good
expect(Open3).to receive(:capture3)
Use normalcase for symbol numbers. Open
xls_color_38: "#FF99CC",
- Read upRead up
- Exclude checks
This cop makes sure that all numbered variables use the configured style, snakecase, normalcase, or noninteger, for their numbering.
Additionally, CheckMethodNames
and CheckSymbols
configuration options
can be used to specify whether method names and symbols should be checked.
Both are enabled by default.
Example: EnforcedStyle: snake_case
# bad
:some_sym1
variable1 = 1
def some_method1; end
def some_method_1(arg1); end
# good
:some_sym_1
variable_1 = 1
def some_method_1; end
def some_method_1(arg_1); end
Example: EnforcedStyle: normalcase (default)
# bad
:some_sym_1
variable_1 = 1
def some_method_1; end
def some_method1(arg_1); end
# good
:some_sym1
variable1 = 1
def some_method1; end
def some_method1(arg1); end
Example: EnforcedStyle: non_integer
# bad
:some_sym1
:some_sym_1
variable1 = 1
variable_1 = 1
def some_method1; end
def some_method_1; end
def some_methodone(arg1); end
def some_methodone(arg_1); end
# good
:some_symone
:some_sym_one
variableone = 1
variable_one = 1
def some_methodone; end
def some_method_one; end
def some_methodone(argone); end
def some_methodone(arg_one); end
# In the following examples, we assume `EnforcedStyle: normalcase` (default).
Example: CheckMethodNames: true (default)
# bad
def some_method_1; end
Example: CheckMethodNames: false
# good
def some_method_1; end
Example: CheckSymbols: true (default)
# bad
:some_sym_1
Example: CheckSymbols: false
# good
:some_sym_1
Example: AllowedIdentifiers: [capture3]
# good
expect(Open3).to receive(:capture3)
Use normalcase for symbol numbers. Open
xls_color_54: "#993366",
- Read upRead up
- Exclude checks
This cop makes sure that all numbered variables use the configured style, snakecase, normalcase, or noninteger, for their numbering.
Additionally, CheckMethodNames
and CheckSymbols
configuration options
can be used to specify whether method names and symbols should be checked.
Both are enabled by default.
Example: EnforcedStyle: snake_case
# bad
:some_sym1
variable1 = 1
def some_method1; end
def some_method_1(arg1); end
# good
:some_sym_1
variable_1 = 1
def some_method_1; end
def some_method_1(arg_1); end
Example: EnforcedStyle: normalcase (default)
# bad
:some_sym_1
variable_1 = 1
def some_method_1; end
def some_method1(arg_1); end
# good
:some_sym1
variable1 = 1
def some_method1; end
def some_method1(arg1); end
Example: EnforcedStyle: non_integer
# bad
:some_sym1
:some_sym_1
variable1 = 1
variable_1 = 1
def some_method1; end
def some_method_1; end
def some_methodone(arg1); end
def some_methodone(arg_1); end
# good
:some_symone
:some_sym_one
variableone = 1
variable_one = 1
def some_methodone; end
def some_method_one; end
def some_methodone(argone); end
def some_methodone(arg_one); end
# In the following examples, we assume `EnforcedStyle: normalcase` (default).
Example: CheckMethodNames: true (default)
# bad
def some_method_1; end
Example: CheckMethodNames: false
# good
def some_method_1; end
Example: CheckSymbols: true (default)
# bad
:some_sym_1
Example: CheckSymbols: false
# good
:some_sym_1
Example: AllowedIdentifiers: [capture3]
# good
expect(Open3).to receive(:capture3)
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
{"0" => nil, "1" => "0", "2" => "0.00", "3" => "#,##0", "4" => "#,##0.00",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
"9" => "0%", "10" => "0.00%", "11" => "0.00E+00", "12" => "# ?/?",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
"13" => "# ??/??", "14" => "mm-dd-yy", "15" => "d-mmm-yy", "16" => "d-mmm",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
"17" => "mmm-yy", "18" => "h:mm AM/PM", "19" => "h:mm:ss AM/PM",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
"20" => "h:mm", "21" => "h:mm:ss", "22" => "m/d/yy h:mm",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
"37" => "#,##0 ;(#,##0)", "38" => "#,##0 ;[Red](#,##0)",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
"49" => "@", "27" => "[$-404]e/m/d", "30" => "m/d/yy", "36" => "[$-404]e/m/d",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
"49" => "@", "27" => "[$-404]e/m/d", "30" => "m/d/yy", "36" => "[$-404]e/m/d",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
"50" => "[$-404]e/m/d", "57" => "[$-404]e/m/d", "59" => "t0", "60" => "t0.00",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
numberformat.gsub("%Y", "yyyy").gsub("%A", "dddd").gsub("%B", "mmmm").gsub("%a", "ddd").gsub("%b", "mmm").gsub("%y", "yy").gsub("%d", "dd").gsub("%m", "mm").gsub("%y", "y").gsub("%y", "%%y").gsub("%e", "d")
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
xls_color_21: "#660066",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
xls_color_25: "#000080",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
xls_color_35: "#CCFFCC",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
xls_color_40: "#FFCC99",
- 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 symbol numbers. Open
xls_color_5: "#0000FF",
- Read upRead up
- Exclude checks
This cop makes sure that all numbered variables use the configured style, snakecase, normalcase, or noninteger, for their numbering.
Additionally, CheckMethodNames
and CheckSymbols
configuration options
can be used to specify whether method names and symbols should be checked.
Both are enabled by default.
Example: EnforcedStyle: snake_case
# bad
:some_sym1
variable1 = 1
def some_method1; end
def some_method_1(arg1); end
# good
:some_sym_1
variable_1 = 1
def some_method_1; end
def some_method_1(arg_1); end
Example: EnforcedStyle: normalcase (default)
# bad
:some_sym_1
variable_1 = 1
def some_method_1; end
def some_method1(arg_1); end
# good
:some_sym1
variable1 = 1
def some_method1; end
def some_method1(arg1); end
Example: EnforcedStyle: non_integer
# bad
:some_sym1
:some_sym_1
variable1 = 1
variable_1 = 1
def some_method1; end
def some_method_1; end
def some_methodone(arg1); end
def some_methodone(arg_1); end
# good
:some_symone
:some_sym_one
variableone = 1
variable_one = 1
def some_methodone; end
def some_method_one; end
def some_methodone(argone); end
def some_methodone(arg_one); end
# In the following examples, we assume `EnforcedStyle: normalcase` (default).
Example: CheckMethodNames: true (default)
# bad
def some_method_1; end
Example: CheckMethodNames: false
# good
def some_method_1; end
Example: CheckSymbols: true (default)
# bad
:some_sym_1
Example: CheckSymbols: false
# good
:some_sym_1
Example: AllowedIdentifiers: [capture3]
# good
expect(Open3).to receive(:capture3)
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
xls_color_44: "#FFCC00",
- 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 symbol numbers. Open
xls_color_14: "#008080",
- Read upRead up
- Exclude checks
This cop makes sure that all numbered variables use the configured style, snakecase, normalcase, or noninteger, for their numbering.
Additionally, CheckMethodNames
and CheckSymbols
configuration options
can be used to specify whether method names and symbols should be checked.
Both are enabled by default.
Example: EnforcedStyle: snake_case
# bad
:some_sym1
variable1 = 1
def some_method1; end
def some_method_1(arg1); end
# good
:some_sym_1
variable_1 = 1
def some_method_1; end
def some_method_1(arg_1); end
Example: EnforcedStyle: normalcase (default)
# bad
:some_sym_1
variable_1 = 1
def some_method_1; end
def some_method1(arg_1); end
# good
:some_sym1
variable1 = 1
def some_method1; end
def some_method1(arg1); end
Example: EnforcedStyle: non_integer
# bad
:some_sym1
:some_sym_1
variable1 = 1
variable_1 = 1
def some_method1; end
def some_method_1; end
def some_methodone(arg1); end
def some_methodone(arg_1); end
# good
:some_symone
:some_sym_one
variableone = 1
variable_one = 1
def some_methodone; end
def some_method_one; end
def some_methodone(argone); end
def some_methodone(arg_one); end
# In the following examples, we assume `EnforcedStyle: normalcase` (default).
Example: CheckMethodNames: true (default)
# bad
def some_method_1; end
Example: CheckMethodNames: false
# good
def some_method_1; end
Example: CheckSymbols: true (default)
# bad
:some_sym_1
Example: CheckSymbols: false
# good
:some_sym_1
Example: AllowedIdentifiers: [capture3]
# good
expect(Open3).to receive(:capture3)
Use normalcase for symbol numbers. Open
xls_color_29: "#800080",
- Read upRead up
- Exclude checks
This cop makes sure that all numbered variables use the configured style, snakecase, normalcase, or noninteger, for their numbering.
Additionally, CheckMethodNames
and CheckSymbols
configuration options
can be used to specify whether method names and symbols should be checked.
Both are enabled by default.
Example: EnforcedStyle: snake_case
# bad
:some_sym1
variable1 = 1
def some_method1; end
def some_method_1(arg1); end
# good
:some_sym_1
variable_1 = 1
def some_method_1; end
def some_method_1(arg_1); end
Example: EnforcedStyle: normalcase (default)
# bad
:some_sym_1
variable_1 = 1
def some_method_1; end
def some_method1(arg_1); end
# good
:some_sym1
variable1 = 1
def some_method1; end
def some_method1(arg1); end
Example: EnforcedStyle: non_integer
# bad
:some_sym1
:some_sym_1
variable1 = 1
variable_1 = 1
def some_method1; end
def some_method_1; end
def some_methodone(arg1); end
def some_methodone(arg_1); end
# good
:some_symone
:some_sym_one
variableone = 1
variable_one = 1
def some_methodone; end
def some_method_one; end
def some_methodone(argone); end
def some_methodone(arg_one); end
# In the following examples, we assume `EnforcedStyle: normalcase` (default).
Example: CheckMethodNames: true (default)
# bad
def some_method_1; end
Example: CheckMethodNames: false
# good
def some_method_1; end
Example: CheckSymbols: true (default)
# bad
:some_sym_1
Example: CheckSymbols: false
# good
:some_sym_1
Example: AllowedIdentifiers: [capture3]
# good
expect(Open3).to receive(:capture3)
Use normalcase for symbol numbers. Open
xls_color_37: "#99CCFF",
- Read upRead up
- Exclude checks
This cop makes sure that all numbered variables use the configured style, snakecase, normalcase, or noninteger, for their numbering.
Additionally, CheckMethodNames
and CheckSymbols
configuration options
can be used to specify whether method names and symbols should be checked.
Both are enabled by default.
Example: EnforcedStyle: snake_case
# bad
:some_sym1
variable1 = 1
def some_method1; end
def some_method_1(arg1); end
# good
:some_sym_1
variable_1 = 1
def some_method_1; end
def some_method_1(arg_1); end
Example: EnforcedStyle: normalcase (default)
# bad
:some_sym_1
variable_1 = 1
def some_method_1; end
def some_method1(arg_1); end
# good
:some_sym1
variable1 = 1
def some_method1; end
def some_method1(arg1); end
Example: EnforcedStyle: non_integer
# bad
:some_sym1
:some_sym_1
variable1 = 1
variable_1 = 1
def some_method1; end
def some_method_1; end
def some_methodone(arg1); end
def some_methodone(arg_1); end
# good
:some_symone
:some_sym_one
variableone = 1
variable_one = 1
def some_methodone; end
def some_method_one; end
def some_methodone(argone); end
def some_methodone(arg_one); end
# In the following examples, we assume `EnforcedStyle: normalcase` (default).
Example: CheckMethodNames: true (default)
# bad
def some_method_1; end
Example: CheckMethodNames: false
# good
def some_method_1; end
Example: CheckSymbols: true (default)
# bad
:some_sym_1
Example: CheckSymbols: false
# good
:some_sym_1
Example: AllowedIdentifiers: [capture3]
# good
expect(Open3).to receive(:capture3)
Use def with parentheses when there are parameters. Open
def xls_number_to_time number, base_date = DateTime.new(1899, 12, 30)
- Read upRead up
- Exclude checks
This cop checks for parentheses around the arguments in method definitions. Both instance and class/singleton methods are checked.
This cop does not consider endless methods, since parentheses are always required for them.
Example: EnforcedStyle: require_parentheses (default)
# The `require_parentheses` style requires method definitions
# to always use parentheses
# bad
def bar num1, num2
num1 + num2
end
def foo descriptive_var_name,
another_descriptive_var_name,
last_descriptive_var_name
do_something
end
# good
def bar(num1, num2)
num1 + num2
end
def foo(descriptive_var_name,
another_descriptive_var_name,
last_descriptive_var_name)
do_something
end
Example: EnforcedStyle: requirenoparentheses
# The `require_no_parentheses` style requires method definitions
# to never use parentheses
# bad
def bar(num1, num2)
num1 + num2
end
def foo(descriptive_var_name,
another_descriptive_var_name,
last_descriptive_var_name)
do_something
end
# good
def bar num1, num2
num1 + num2
end
def foo descriptive_var_name,
another_descriptive_var_name,
last_descriptive_var_name
do_something
end
Example: EnforcedStyle: requirenoparenthesesexceptmultiline
# The `require_no_parentheses_except_multiline` style prefers no
# parentheses when method definition arguments fit on single line,
# but prefers parentheses when arguments span multiple lines.
# bad
def bar(num1, num2)
num1 + num2
end
def foo descriptive_var_name,
another_descriptive_var_name,
last_descriptive_var_name
do_something
end
# good
def bar num1, num2
num1 + num2
end
def foo(descriptive_var_name,
another_descriptive_var_name,
last_descriptive_var_name)
do_something
end
Use def with parentheses when there are parameters. Open
def xls_number_to_date number, base_date = Date.new(1899, 12, 30)
- Read upRead up
- Exclude checks
This cop checks for parentheses around the arguments in method definitions. Both instance and class/singleton methods are checked.
This cop does not consider endless methods, since parentheses are always required for them.
Example: EnforcedStyle: require_parentheses (default)
# The `require_parentheses` style requires method definitions
# to always use parentheses
# bad
def bar num1, num2
num1 + num2
end
def foo descriptive_var_name,
another_descriptive_var_name,
last_descriptive_var_name
do_something
end
# good
def bar(num1, num2)
num1 + num2
end
def foo(descriptive_var_name,
another_descriptive_var_name,
last_descriptive_var_name)
do_something
end
Example: EnforcedStyle: requirenoparentheses
# The `require_no_parentheses` style requires method definitions
# to never use parentheses
# bad
def bar(num1, num2)
num1 + num2
end
def foo(descriptive_var_name,
another_descriptive_var_name,
last_descriptive_var_name)
do_something
end
# good
def bar num1, num2
num1 + num2
end
def foo descriptive_var_name,
another_descriptive_var_name,
last_descriptive_var_name
do_something
end
Example: EnforcedStyle: requirenoparenthesesexceptmultiline
# The `require_no_parentheses_except_multiline` style prefers no
# parentheses when method definition arguments fit on single line,
# but prefers parentheses when arguments span multiple lines.
# bad
def bar(num1, num2)
num1 + num2
end
def foo descriptive_var_name,
another_descriptive_var_name,
last_descriptive_var_name
do_something
end
# good
def bar num1, num2
num1 + num2
end
def foo(descriptive_var_name,
another_descriptive_var_name,
last_descriptive_var_name)
do_something
end
Add empty line after guard clause. Open
return nil if numberformat.nil?
- Read upRead up
- Exclude checks
This cop enforces empty line after guard clause
Example:
# bad
def foo
return if need_return?
bar
end
# good
def foo
return if need_return?
bar
end
# good
def foo
return if something?
return if something_different?
bar
end
# also good
def foo
if something?
do_something
return if need_return?
end
end
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
"dd" => "%d",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
"dd" => "%d",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
";@" => "",
- 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 symbol numbers. Open
xls_color_8: "#00FFFF",
- Read upRead up
- Exclude checks
This cop makes sure that all numbered variables use the configured style, snakecase, normalcase, or noninteger, for their numbering.
Additionally, CheckMethodNames
and CheckSymbols
configuration options
can be used to specify whether method names and symbols should be checked.
Both are enabled by default.
Example: EnforcedStyle: snake_case
# bad
:some_sym1
variable1 = 1
def some_method1; end
def some_method_1(arg1); end
# good
:some_sym_1
variable_1 = 1
def some_method_1; end
def some_method_1(arg_1); end
Example: EnforcedStyle: normalcase (default)
# bad
:some_sym_1
variable_1 = 1
def some_method_1; end
def some_method1(arg_1); end
# good
:some_sym1
variable1 = 1
def some_method1; end
def some_method1(arg1); end
Example: EnforcedStyle: non_integer
# bad
:some_sym1
:some_sym_1
variable1 = 1
variable_1 = 1
def some_method1; end
def some_method_1; end
def some_methodone(arg1); end
def some_methodone(arg_1); end
# good
:some_symone
:some_sym_one
variableone = 1
variable_one = 1
def some_methodone; end
def some_method_one; end
def some_methodone(argone); end
def some_methodone(arg_one); end
# In the following examples, we assume `EnforcedStyle: normalcase` (default).
Example: CheckMethodNames: true (default)
# bad
def some_method_1; end
Example: CheckMethodNames: false
# good
def some_method_1; end
Example: CheckSymbols: true (default)
# bad
:some_sym_1
Example: CheckSymbols: false
# good
:some_sym_1
Example: AllowedIdentifiers: [capture3]
# good
expect(Open3).to receive(:capture3)
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
{"0" => nil, "1" => "0", "2" => "0.00", "3" => "#,##0", "4" => "#,##0.00",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
"9" => "0%", "10" => "0.00%", "11" => "0.00E+00", "12" => "# ?/?",
- 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 symbol numbers. Open
xls_color_40: "#FFCC99",
- Read upRead up
- Exclude checks
This cop makes sure that all numbered variables use the configured style, snakecase, normalcase, or noninteger, for their numbering.
Additionally, CheckMethodNames
and CheckSymbols
configuration options
can be used to specify whether method names and symbols should be checked.
Both are enabled by default.
Example: EnforcedStyle: snake_case
# bad
:some_sym1
variable1 = 1
def some_method1; end
def some_method_1(arg1); end
# good
:some_sym_1
variable_1 = 1
def some_method_1; end
def some_method_1(arg_1); end
Example: EnforcedStyle: normalcase (default)
# bad
:some_sym_1
variable_1 = 1
def some_method_1; end
def some_method1(arg_1); end
# good
:some_sym1
variable1 = 1
def some_method1; end
def some_method1(arg1); end
Example: EnforcedStyle: non_integer
# bad
:some_sym1
:some_sym_1
variable1 = 1
variable_1 = 1
def some_method1; end
def some_method_1; end
def some_methodone(arg1); end
def some_methodone(arg_1); end
# good
:some_symone
:some_sym_one
variableone = 1
variable_one = 1
def some_methodone; end
def some_method_one; end
def some_methodone(argone); end
def some_methodone(arg_one); end
# In the following examples, we assume `EnforcedStyle: normalcase` (default).
Example: CheckMethodNames: true (default)
# bad
def some_method_1; end
Example: CheckMethodNames: false
# good
def some_method_1; end
Example: CheckSymbols: true (default)
# bad
:some_sym_1
Example: CheckSymbols: false
# good
:some_sym_1
Example: AllowedIdentifiers: [capture3]
# good
expect(Open3).to receive(:capture3)
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
"39" => "#,##0.00;(#,##0.00)", "40" => "#,##0.00;[Red](#,##0.00)",
- 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 symbol numbers. Open
xls_color_41: "#3366FF",
- Read upRead up
- Exclude checks
This cop makes sure that all numbered variables use the configured style, snakecase, normalcase, or noninteger, for their numbering.
Additionally, CheckMethodNames
and CheckSymbols
configuration options
can be used to specify whether method names and symbols should be checked.
Both are enabled by default.
Example: EnforcedStyle: snake_case
# bad
:some_sym1
variable1 = 1
def some_method1; end
def some_method_1(arg1); end
# good
:some_sym_1
variable_1 = 1
def some_method_1; end
def some_method_1(arg_1); end
Example: EnforcedStyle: normalcase (default)
# bad
:some_sym_1
variable_1 = 1
def some_method_1; end
def some_method1(arg_1); end
# good
:some_sym1
variable1 = 1
def some_method1; end
def some_method1(arg1); end
Example: EnforcedStyle: non_integer
# bad
:some_sym1
:some_sym_1
variable1 = 1
variable_1 = 1
def some_method1; end
def some_method_1; end
def some_methodone(arg1); end
def some_methodone(arg_1); end
# good
:some_symone
:some_sym_one
variableone = 1
variable_one = 1
def some_methodone; end
def some_method_one; end
def some_methodone(argone); end
def some_methodone(arg_one); end
# In the following examples, we assume `EnforcedStyle: normalcase` (default).
Example: CheckMethodNames: true (default)
# bad
def some_method_1; end
Example: CheckMethodNames: false
# good
def some_method_1; end
Example: CheckSymbols: true (default)
# bad
:some_sym_1
Example: CheckSymbols: false
# good
:some_sym_1
Example: AllowedIdentifiers: [capture3]
# good
expect(Open3).to receive(:capture3)
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
"44" => '_("$"* #,##0.00_);_("$"* \(#,##0.00\);_("$"* "-"??_);_(@_)',
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
"50" => "[$-404]e/m/d", "57" => "[$-404]e/m/d", "59" => "t0", "60" => "t0.00",
- 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 symbol numbers. Open
xls_color_53: "#993300",
- Read upRead up
- Exclude checks
This cop makes sure that all numbered variables use the configured style, snakecase, normalcase, or noninteger, for their numbering.
Additionally, CheckMethodNames
and CheckSymbols
configuration options
can be used to specify whether method names and symbols should be checked.
Both are enabled by default.
Example: EnforcedStyle: snake_case
# bad
:some_sym1
variable1 = 1
def some_method1; end
def some_method_1(arg1); end
# good
:some_sym_1
variable_1 = 1
def some_method_1; end
def some_method_1(arg_1); end
Example: EnforcedStyle: normalcase (default)
# bad
:some_sym_1
variable_1 = 1
def some_method_1; end
def some_method1(arg_1); end
# good
:some_sym1
variable1 = 1
def some_method1; end
def some_method1(arg1); end
Example: EnforcedStyle: non_integer
# bad
:some_sym1
:some_sym_1
variable1 = 1
variable_1 = 1
def some_method1; end
def some_method_1; end
def some_methodone(arg1); end
def some_methodone(arg_1); end
# good
:some_symone
:some_sym_one
variableone = 1
variable_one = 1
def some_methodone; end
def some_method_one; end
def some_methodone(argone); end
def some_methodone(arg_one); end
# In the following examples, we assume `EnforcedStyle: normalcase` (default).
Example: CheckMethodNames: true (default)
# bad
def some_method_1; end
Example: CheckMethodNames: false
# good
def some_method_1; end
Example: CheckSymbols: true (default)
# bad
:some_sym_1
Example: CheckSymbols: false
# good
:some_sym_1
Example: AllowedIdentifiers: [capture3]
# good
expect(Open3).to receive(:capture3)
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
numberformat.gsub("%Y", "yyyy").gsub("%A", "dddd").gsub("%B", "mmmm").gsub("%a", "ddd").gsub("%b", "mmm").gsub("%y", "yy").gsub("%d", "dd").gsub("%m", "mm").gsub("%y", "y").gsub("%y", "%%y").gsub("%e", "d")
- 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 a guard clause (return unless ms_nr_format
) instead of wrapping the code inside a conditional expression. Open
if ms_nr_format
- Read upRead up
- Exclude checks
Use a guard clause instead of wrapping the code inside a conditional expression
Example:
# bad
def test
if something
work
end
end
# good
def test
return unless something
work
end
# also good
def test
work if something
end
# bad
if something
raise 'exception'
else
ok
end
# good
raise 'exception' if something
ok
# bad
if something
foo || raise('exception')
else
ok
end
# good
foo || raise('exception') if something
ok
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
xls_color_9: "#800000",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
xls_color_15: "#C0C0C0",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
"mm" => "%m",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
xls_color_24: "#CCCCFF",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
{"0" => nil, "1" => "0", "2" => "0.00", "3" => "#,##0", "4" => "#,##0.00",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
xls_color_34: "#CCFFFF",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
{"0" => nil, "1" => "0", "2" => "0.00", "3" => "#,##0", "4" => "#,##0.00",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
xls_color_43: "#99CC00",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
"13" => "# ??/??", "14" => "mm-dd-yy", "15" => "d-mmm-yy", "16" => "d-mmm",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
"13" => "# ??/??", "14" => "mm-dd-yy", "15" => "d-mmm-yy", "16" => "d-mmm",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
numberformat.gsub("%Y", "yyyy").gsub("%A", "dddd").gsub("%B", "mmmm").gsub("%a", "ddd").gsub("%b", "mmm").gsub("%y", "yy").gsub("%d", "dd").gsub("%m", "mm").gsub("%y", "y").gsub("%y", "%%y").gsub("%e", "d")
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
xls_color_8: "#00FFFF",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
xls_color_38: "#FF99CC",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
xls_color_39: "#CC99FF",
- 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"
Space inside } missing. Open
lime: "#00f94c"}
- Read upRead up
- Exclude checks
Checks that braces used for hash literals have or don't have surrounding space depending on configuration.
Example: EnforcedStyle: space (default)
# The `space` style enforces that hash literals have
# surrounding space.
# bad
h = {a: 1, b: 2}
# good
h = { a: 1, b: 2 }
Example: EnforcedStyle: no_space
# The `no_space` style enforces that hash literals have
# no surrounding space.
# bad
h = { a: 1, b: 2 }
# good
h = {a: 1, b: 2}
Example: EnforcedStyle: compact
# The `compact` style normally requires a space inside
# hash braces, with the exception that successive left
# braces or right braces are collapsed together in nested hashes.
# bad
h = { a: { b: 2 } }
foo = { { a: 1 } => { b: { c: 2 } } }
# good
h = { a: { b: 2 }}
foo = {{ a: 1 } => { b: { c: 2 }}}
Example: EnforcedStyleForEmptyBraces: no_space (default)
# The `no_space` EnforcedStyleForEmptyBraces style enforces that
# empty hash braces do not contain spaces.
# bad
foo = { }
bar = { }
# good
foo = {}
bar = {}
Example: EnforcedStyleForEmptyBraces: space
# The `space` EnforcedStyleForEmptyBraces style enforces that
# empty hash braces contain space.
# bad
foo = {}
# good
foo = { }
foo = { }
foo = { }
Use def with parentheses when there are parameters. Open
def num_fmt_id_to_ms_formatting num_fmt_id
- Read upRead up
- Exclude checks
This cop checks for parentheses around the arguments in method definitions. Both instance and class/singleton methods are checked.
This cop does not consider endless methods, since parentheses are always required for them.
Example: EnforcedStyle: require_parentheses (default)
# The `require_parentheses` style requires method definitions
# to always use parentheses
# bad
def bar num1, num2
num1 + num2
end
def foo descriptive_var_name,
another_descriptive_var_name,
last_descriptive_var_name
do_something
end
# good
def bar(num1, num2)
num1 + num2
end
def foo(descriptive_var_name,
another_descriptive_var_name,
last_descriptive_var_name)
do_something
end
Example: EnforcedStyle: requirenoparentheses
# The `require_no_parentheses` style requires method definitions
# to never use parentheses
# bad
def bar(num1, num2)
num1 + num2
end
def foo(descriptive_var_name,
another_descriptive_var_name,
last_descriptive_var_name)
do_something
end
# good
def bar num1, num2
num1 + num2
end
def foo descriptive_var_name,
another_descriptive_var_name,
last_descriptive_var_name
do_something
end
Example: EnforcedStyle: requirenoparenthesesexceptmultiline
# The `require_no_parentheses_except_multiline` style prefers no
# parentheses when method definition arguments fit on single line,
# but prefers parentheses when arguments span multiple lines.
# bad
def bar(num1, num2)
num1 + num2
end
def foo descriptive_var_name,
another_descriptive_var_name,
last_descriptive_var_name
do_something
end
# good
def bar num1, num2
num1 + num2
end
def foo(descriptive_var_name,
another_descriptive_var_name,
last_descriptive_var_name)
do_something
end
Freeze mutable objects assigned to constants. Open
XLS_COLORS = {xls_color_1: "#000000",
xls_color_2: "#FFFFFF",
xls_color_3: "#FF0000",
xls_color_4: "#00FF00",
xls_color_5: "#0000FF",
- Read upRead up
- Exclude checks
This cop checks whether some constant value isn't a mutable literal (e.g. array or hash).
Strict mode can be used to freeze all constants, rather than just literals. Strict mode is considered an experimental feature. It has not been updated with an exhaustive list of all methods that will produce frozen objects so there is a decent chance of getting some false positives. Luckily, there is no harm in freezing an already frozen object.
From Ruby 3.0, this cop honours the magic comment 'shareableconstantvalue'. When this magic comment is set to any acceptable value other than none, it will suppress the offenses raised by this cop. It enforces frozen state.
NOTE: Regexp and Range literals are frozen objects since Ruby 3.0.
NOTE: From Ruby 3.0, interpolated strings are not frozen when
# frozen-string-literal: true
is used, so this cop enforces explicit
freezing for such strings.
NOTE: From Ruby 3.0, this cop allows explicit freezing of constants when
the shareable_constant_value
directive is used.
Safety:
This cop's autocorrection is unsafe since any mutations on objects that
are made frozen will change from being accepted to raising FrozenError
,
and will need to be manually refactored.
Example: EnforcedStyle: literals (default)
# bad
CONST = [1, 2, 3]
# good
CONST = [1, 2, 3].freeze
# good
CONST = <<~TESTING.freeze
This is a heredoc
TESTING
# good
CONST = Something.new
Example: EnforcedStyle: strict
# bad
CONST = Something.new
# bad
CONST = Struct.new do
def foo
puts 1
end
end
# good
CONST = Something.new.freeze
# good
CONST = Struct.new do
def foo
puts 1
end
end.freeze
Example:
# Magic comment - shareable_constant_value: literal
# bad
CONST = [1, 2, 3]
# good
# shareable_constant_value: literal
CONST = [1, 2, 3]
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
"dddd" => "%A",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
"13" => "# ??/??", "14" => "mm-dd-yy", "15" => "d-mmm-yy", "16" => "d-mmm",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
"45" => "mm:ss", "46" => "[h]:mm:ss", "47" => "mmss.0", "48" => "##0.0E+0",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
"69" => "t# ?/?", "70" => "t# ??/??"}[num_fmt_id.to_s]
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
numberformat.gsub("%Y", "yyyy").gsub("%A", "dddd").gsub("%B", "mmmm").gsub("%a", "ddd").gsub("%b", "mmm").gsub("%y", "yy").gsub("%d", "dd").gsub("%m", "mm").gsub("%y", "y").gsub("%y", "%%y").gsub("%e", "d")
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
numberformat.gsub("%Y", "yyyy").gsub("%A", "dddd").gsub("%B", "mmmm").gsub("%a", "ddd").gsub("%b", "mmm").gsub("%y", "yy").gsub("%d", "dd").gsub("%m", "mm").gsub("%y", "y").gsub("%y", "%%y").gsub("%e", "d")
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
XLS_COLORS = {xls_color_1: "#000000",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
xls_color_10: "#008000",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
xls_color_16: "#808080",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
xls_color_28: "#00FFFF",
- 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"
Space inside } missing. Open
"69" => "t# ?/?", "70" => "t# ??/??"}[num_fmt_id.to_s]
- Read upRead up
- Exclude checks
Checks that braces used for hash literals have or don't have surrounding space depending on configuration.
Example: EnforcedStyle: space (default)
# The `space` style enforces that hash literals have
# surrounding space.
# bad
h = {a: 1, b: 2}
# good
h = { a: 1, b: 2 }
Example: EnforcedStyle: no_space
# The `no_space` style enforces that hash literals have
# no surrounding space.
# bad
h = { a: 1, b: 2 }
# good
h = {a: 1, b: 2}
Example: EnforcedStyle: compact
# The `compact` style normally requires a space inside
# hash braces, with the exception that successive left
# braces or right braces are collapsed together in nested hashes.
# bad
h = { a: { b: 2 } }
foo = { { a: 1 } => { b: { c: 2 } } }
# good
h = { a: { b: 2 }}
foo = {{ a: 1 } => { b: { c: 2 }}}
Example: EnforcedStyleForEmptyBraces: no_space (default)
# The `no_space` EnforcedStyleForEmptyBraces style enforces that
# empty hash braces do not contain spaces.
# bad
foo = { }
bar = { }
# good
foo = {}
bar = {}
Example: EnforcedStyleForEmptyBraces: space
# The `space` EnforcedStyleForEmptyBraces style enforces that
# empty hash braces contain space.
# bad
foo = {}
# good
foo = { }
foo = { }
foo = { }
Use normalcase for symbol numbers. Open
xls_color_34: "#CCFFFF",
- Read upRead up
- Exclude checks
This cop makes sure that all numbered variables use the configured style, snakecase, normalcase, or noninteger, for their numbering.
Additionally, CheckMethodNames
and CheckSymbols
configuration options
can be used to specify whether method names and symbols should be checked.
Both are enabled by default.
Example: EnforcedStyle: snake_case
# bad
:some_sym1
variable1 = 1
def some_method1; end
def some_method_1(arg1); end
# good
:some_sym_1
variable_1 = 1
def some_method_1; end
def some_method_1(arg_1); end
Example: EnforcedStyle: normalcase (default)
# bad
:some_sym_1
variable_1 = 1
def some_method_1; end
def some_method1(arg_1); end
# good
:some_sym1
variable1 = 1
def some_method1; end
def some_method1(arg1); end
Example: EnforcedStyle: non_integer
# bad
:some_sym1
:some_sym_1
variable1 = 1
variable_1 = 1
def some_method1; end
def some_method_1; end
def some_methodone(arg1); end
def some_methodone(arg_1); end
# good
:some_symone
:some_sym_one
variableone = 1
variable_one = 1
def some_methodone; end
def some_method_one; end
def some_methodone(argone); end
def some_methodone(arg_one); end
# In the following examples, we assume `EnforcedStyle: normalcase` (default).
Example: CheckMethodNames: true (default)
# bad
def some_method_1; end
Example: CheckMethodNames: false
# good
def some_method_1; end
Example: CheckSymbols: true (default)
# bad
:some_sym_1
Example: CheckSymbols: false
# good
:some_sym_1
Example: AllowedIdentifiers: [capture3]
# good
expect(Open3).to receive(:capture3)
Use normalcase for symbol numbers. Open
xls_color_50: "#339966",
- Read upRead up
- Exclude checks
This cop makes sure that all numbered variables use the configured style, snakecase, normalcase, or noninteger, for their numbering.
Additionally, CheckMethodNames
and CheckSymbols
configuration options
can be used to specify whether method names and symbols should be checked.
Both are enabled by default.
Example: EnforcedStyle: snake_case
# bad
:some_sym1
variable1 = 1
def some_method1; end
def some_method_1(arg1); end
# good
:some_sym_1
variable_1 = 1
def some_method_1; end
def some_method_1(arg_1); end
Example: EnforcedStyle: normalcase (default)
# bad
:some_sym_1
variable_1 = 1
def some_method_1; end
def some_method1(arg_1); end
# good
:some_sym1
variable1 = 1
def some_method1; end
def some_method1(arg1); end
Example: EnforcedStyle: non_integer
# bad
:some_sym1
:some_sym_1
variable1 = 1
variable_1 = 1
def some_method1; end
def some_method_1; end
def some_methodone(arg1); end
def some_methodone(arg_1); end
# good
:some_symone
:some_sym_one
variableone = 1
variable_one = 1
def some_methodone; end
def some_method_one; end
def some_methodone(argone); end
def some_methodone(arg_one); end
# In the following examples, we assume `EnforcedStyle: normalcase` (default).
Example: CheckMethodNames: true (default)
# bad
def some_method_1; end
Example: CheckMethodNames: false
# good
def some_method_1; end
Example: CheckSymbols: true (default)
# bad
:some_sym_1
Example: CheckSymbols: false
# good
:some_sym_1
Example: AllowedIdentifiers: [capture3]
# good
expect(Open3).to receive(:capture3)
Use normalcase for symbol numbers. Open
xls_color_52: "#333300",
- Read upRead up
- Exclude checks
This cop makes sure that all numbered variables use the configured style, snakecase, normalcase, or noninteger, for their numbering.
Additionally, CheckMethodNames
and CheckSymbols
configuration options
can be used to specify whether method names and symbols should be checked.
Both are enabled by default.
Example: EnforcedStyle: snake_case
# bad
:some_sym1
variable1 = 1
def some_method1; end
def some_method_1(arg1); end
# good
:some_sym_1
variable_1 = 1
def some_method_1; end
def some_method_1(arg_1); end
Example: EnforcedStyle: normalcase (default)
# bad
:some_sym_1
variable_1 = 1
def some_method_1; end
def some_method1(arg_1); end
# good
:some_sym1
variable1 = 1
def some_method1; end
def some_method1(arg1); end
Example: EnforcedStyle: non_integer
# bad
:some_sym1
:some_sym_1
variable1 = 1
variable_1 = 1
def some_method1; end
def some_method_1; end
def some_methodone(arg1); end
def some_methodone(arg_1); end
# good
:some_symone
:some_sym_one
variableone = 1
variable_one = 1
def some_methodone; end
def some_method_one; end
def some_methodone(argone); end
def some_methodone(arg_one); end
# In the following examples, we assume `EnforcedStyle: normalcase` (default).
Example: CheckMethodNames: true (default)
# bad
def some_method_1; end
Example: CheckMethodNames: false
# good
def some_method_1; end
Example: CheckSymbols: true (default)
# bad
:some_sym_1
Example: CheckSymbols: false
# good
:some_sym_1
Example: AllowedIdentifiers: [capture3]
# good
expect(Open3).to receive(:capture3)
Missing top-level documentation comment for module Workbook::Readers::XlsShared
. Open
module XlsShared
- Read upRead up
- Exclude checks
This cop checks for missing top-level documentation of classes and modules. Classes with no body are exempt from the check and so are namespace modules - modules that have nothing in their bodies except classes, other modules, constant definitions or constant visibility declarations.
The documentation requirement is annulled if the class or module has a "#:nodoc:" comment next to it. Likewise, "#:nodoc: all" does the same for all its children.
Example:
# bad
class Person
# ...
end
module Math
end
# good
# Description/Explanation of Person class
class Person
# ...
end
# allowed
# Class without body
class Person
end
# Namespace - A namespace can be a class or a module
# Containing a class
module Namespace
# Description/Explanation of Person class
class Person
# ...
end
end
# Containing constant visibility declaration
module Namespace
class Private
end
private_constant :Private
end
# Containing constant definition
module Namespace
Public = Class.new
end
# Macro calls
module Namespace
extend Foo
end
Example: AllowedConstants: ['ClassMethods']
# good
module A
module ClassMethods
# ...
end
end
Use def with parentheses when there are parameters. Open
def html_color_to_xls_color hex
- Read upRead up
- Exclude checks
This cop checks for parentheses around the arguments in method definitions. Both instance and class/singleton methods are checked.
This cop does not consider endless methods, since parentheses are always required for them.
Example: EnforcedStyle: require_parentheses (default)
# The `require_parentheses` style requires method definitions
# to always use parentheses
# bad
def bar num1, num2
num1 + num2
end
def foo descriptive_var_name,
another_descriptive_var_name,
last_descriptive_var_name
do_something
end
# good
def bar(num1, num2)
num1 + num2
end
def foo(descriptive_var_name,
another_descriptive_var_name,
last_descriptive_var_name)
do_something
end
Example: EnforcedStyle: requirenoparentheses
# The `require_no_parentheses` style requires method definitions
# to never use parentheses
# bad
def bar(num1, num2)
num1 + num2
end
def foo(descriptive_var_name,
another_descriptive_var_name,
last_descriptive_var_name)
do_something
end
# good
def bar num1, num2
num1 + num2
end
def foo descriptive_var_name,
another_descriptive_var_name,
last_descriptive_var_name
do_something
end
Example: EnforcedStyle: requirenoparenthesesexceptmultiline
# The `require_no_parentheses_except_multiline` style prefers no
# parentheses when method definition arguments fit on single line,
# but prefers parentheses when arguments span multiple lines.
# bad
def bar(num1, num2)
num1 + num2
end
def foo descriptive_var_name,
another_descriptive_var_name,
last_descriptive_var_name
do_something
end
# good
def bar num1, num2
num1 + num2
end
def foo(descriptive_var_name,
another_descriptive_var_name,
last_descriptive_var_name)
do_something
end
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
"yy" => "%y",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
"d" => "%e",
- 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"
Space inside { missing. Open
XLS_COLORS = {xls_color_1: "#000000",
- Read upRead up
- Exclude checks
Checks that braces used for hash literals have or don't have surrounding space depending on configuration.
Example: EnforcedStyle: space (default)
# The `space` style enforces that hash literals have
# surrounding space.
# bad
h = {a: 1, b: 2}
# good
h = { a: 1, b: 2 }
Example: EnforcedStyle: no_space
# The `no_space` style enforces that hash literals have
# no surrounding space.
# bad
h = { a: 1, b: 2 }
# good
h = {a: 1, b: 2}
Example: EnforcedStyle: compact
# The `compact` style normally requires a space inside
# hash braces, with the exception that successive left
# braces or right braces are collapsed together in nested hashes.
# bad
h = { a: { b: 2 } }
foo = { { a: 1 } => { b: { c: 2 } } }
# good
h = { a: { b: 2 }}
foo = {{ a: 1 } => { b: { c: 2 }}}
Example: EnforcedStyleForEmptyBraces: no_space (default)
# The `no_space` EnforcedStyleForEmptyBraces style enforces that
# empty hash braces do not contain spaces.
# bad
foo = { }
bar = { }
# good
foo = {}
bar = {}
Example: EnforcedStyleForEmptyBraces: space
# The `space` EnforcedStyleForEmptyBraces style enforces that
# empty hash braces contain space.
# bad
foo = {}
# good
foo = { }
foo = { }
foo = { }
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
"%%m" => "%m",
- 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 symbol numbers. Open
xls_color_30: "#800000",
- Read upRead up
- Exclude checks
This cop makes sure that all numbered variables use the configured style, snakecase, normalcase, or noninteger, for their numbering.
Additionally, CheckMethodNames
and CheckSymbols
configuration options
can be used to specify whether method names and symbols should be checked.
Both are enabled by default.
Example: EnforcedStyle: snake_case
# bad
:some_sym1
variable1 = 1
def some_method1; end
def some_method_1(arg1); end
# good
:some_sym_1
variable_1 = 1
def some_method_1; end
def some_method_1(arg_1); end
Example: EnforcedStyle: normalcase (default)
# bad
:some_sym_1
variable_1 = 1
def some_method_1; end
def some_method1(arg_1); end
# good
:some_sym1
variable1 = 1
def some_method1; end
def some_method1(arg1); end
Example: EnforcedStyle: non_integer
# bad
:some_sym1
:some_sym_1
variable1 = 1
variable_1 = 1
def some_method1; end
def some_method_1; end
def some_methodone(arg1); end
def some_methodone(arg_1); end
# good
:some_symone
:some_sym_one
variableone = 1
variable_one = 1
def some_methodone; end
def some_method_one; end
def some_methodone(argone); end
def some_methodone(arg_one); end
# In the following examples, we assume `EnforcedStyle: normalcase` (default).
Example: CheckMethodNames: true (default)
# bad
def some_method_1; end
Example: CheckMethodNames: false
# good
def some_method_1; end
Example: CheckSymbols: true (default)
# bad
:some_sym_1
Example: CheckSymbols: false
# good
:some_sym_1
Example: AllowedIdentifiers: [capture3]
# good
expect(Open3).to receive(:capture3)
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
";@" => "",
- 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 symbol numbers. Open
xls_color_32: "#0000FF",
- Read upRead up
- Exclude checks
This cop makes sure that all numbered variables use the configured style, snakecase, normalcase, or noninteger, for their numbering.
Additionally, CheckMethodNames
and CheckSymbols
configuration options
can be used to specify whether method names and symbols should be checked.
Both are enabled by default.
Example: EnforcedStyle: snake_case
# bad
:some_sym1
variable1 = 1
def some_method1; end
def some_method_1(arg1); end
# good
:some_sym_1
variable_1 = 1
def some_method_1; end
def some_method_1(arg_1); end
Example: EnforcedStyle: normalcase (default)
# bad
:some_sym_1
variable_1 = 1
def some_method_1; end
def some_method1(arg_1); end
# good
:some_sym1
variable1 = 1
def some_method1; end
def some_method1(arg1); end
Example: EnforcedStyle: non_integer
# bad
:some_sym1
:some_sym_1
variable1 = 1
variable_1 = 1
def some_method1; end
def some_method_1; end
def some_methodone(arg1); end
def some_methodone(arg_1); end
# good
:some_symone
:some_sym_one
variableone = 1
variable_one = 1
def some_methodone; end
def some_method_one; end
def some_methodone(argone); end
def some_methodone(arg_one); end
# In the following examples, we assume `EnforcedStyle: normalcase` (default).
Example: CheckMethodNames: true (default)
# bad
def some_method_1; end
Example: CheckMethodNames: false
# good
def some_method_1; end
Example: CheckSymbols: true (default)
# bad
:some_sym_1
Example: CheckSymbols: false
# good
:some_sym_1
Example: AllowedIdentifiers: [capture3]
# good
expect(Open3).to receive(:capture3)
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
"\\" => ""
- 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 def with parentheses when there are parameters. Open
def strftime_to_ms_format numberformat
- Read upRead up
- Exclude checks
This cop checks for parentheses around the arguments in method definitions. Both instance and class/singleton methods are checked.
This cop does not consider endless methods, since parentheses are always required for them.
Example: EnforcedStyle: require_parentheses (default)
# The `require_parentheses` style requires method definitions
# to always use parentheses
# bad
def bar num1, num2
num1 + num2
end
def foo descriptive_var_name,
another_descriptive_var_name,
last_descriptive_var_name
do_something
end
# good
def bar(num1, num2)
num1 + num2
end
def foo(descriptive_var_name,
another_descriptive_var_name,
last_descriptive_var_name)
do_something
end
Example: EnforcedStyle: requirenoparentheses
# The `require_no_parentheses` style requires method definitions
# to never use parentheses
# bad
def bar(num1, num2)
num1 + num2
end
def foo(descriptive_var_name,
another_descriptive_var_name,
last_descriptive_var_name)
do_something
end
# good
def bar num1, num2
num1 + num2
end
def foo descriptive_var_name,
another_descriptive_var_name,
last_descriptive_var_name
do_something
end
Example: EnforcedStyle: requirenoparenthesesexceptmultiline
# The `require_no_parentheses_except_multiline` style prefers no
# parentheses when method definition arguments fit on single line,
# but prefers parentheses when arguments span multiple lines.
# bad
def bar(num1, num2)
num1 + num2
end
def foo descriptive_var_name,
another_descriptive_var_name,
last_descriptive_var_name
do_something
end
# good
def bar num1, num2
num1 + num2
end
def foo(descriptive_var_name,
another_descriptive_var_name,
last_descriptive_var_name)
do_something
end
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
"yy" => "%y",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
"9" => "0%", "10" => "0.00%", "11" => "0.00E+00", "12" => "# ?/?",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
numberformat.gsub("%Y", "yyyy").gsub("%A", "dddd").gsub("%B", "mmmm").gsub("%a", "ddd").gsub("%b", "mmm").gsub("%y", "yy").gsub("%d", "dd").gsub("%m", "mm").gsub("%y", "y").gsub("%y", "%%y").gsub("%e", "d")
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
"m" => "%m",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
numberformat.gsub("%Y", "yyyy").gsub("%A", "dddd").gsub("%B", "mmmm").gsub("%a", "ddd").gsub("%b", "mmm").gsub("%y", "yy").gsub("%d", "dd").gsub("%m", "mm").gsub("%y", "y").gsub("%y", "%%y").gsub("%e", "d")
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
{"0" => nil, "1" => "0", "2" => "0.00", "3" => "#,##0", "4" => "#,##0.00",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
xls_color_18: "#993366",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
"9" => "0%", "10" => "0.00%", "11" => "0.00E+00", "12" => "# ?/?",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
xls_color_26: "#FF00FF",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
"39" => "#,##0.00;(#,##0.00)", "40" => "#,##0.00;[Red](#,##0.00)",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
xls_color_42: "#33CCCC",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
"50" => "[$-404]e/m/d", "57" => "[$-404]e/m/d", "59" => "t0", "60" => "t0.00",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
numberformat.gsub("%Y", "yyyy").gsub("%A", "dddd").gsub("%B", "mmmm").gsub("%a", "ddd").gsub("%b", "mmm").gsub("%y", "yy").gsub("%d", "dd").gsub("%m", "mm").gsub("%y", "y").gsub("%y", "%%y").gsub("%e", "d")
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
numberformat.gsub("%Y", "yyyy").gsub("%A", "dddd").gsub("%B", "mmmm").gsub("%a", "ddd").gsub("%b", "mmm").gsub("%y", "yy").gsub("%d", "dd").gsub("%m", "mm").gsub("%y", "y").gsub("%y", "%%y").gsub("%e", "d")
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
xls_color_47: "#666699",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
xls_color_50: "#339966",
- 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 symbol numbers. Open
xls_color_7: "#FF00FF",
- Read upRead up
- Exclude checks
This cop makes sure that all numbered variables use the configured style, snakecase, normalcase, or noninteger, for their numbering.
Additionally, CheckMethodNames
and CheckSymbols
configuration options
can be used to specify whether method names and symbols should be checked.
Both are enabled by default.
Example: EnforcedStyle: snake_case
# bad
:some_sym1
variable1 = 1
def some_method1; end
def some_method_1(arg1); end
# good
:some_sym_1
variable_1 = 1
def some_method_1; end
def some_method_1(arg_1); end
Example: EnforcedStyle: normalcase (default)
# bad
:some_sym_1
variable_1 = 1
def some_method_1; end
def some_method1(arg_1); end
# good
:some_sym1
variable1 = 1
def some_method1; end
def some_method1(arg1); end
Example: EnforcedStyle: non_integer
# bad
:some_sym1
:some_sym_1
variable1 = 1
variable_1 = 1
def some_method1; end
def some_method_1; end
def some_methodone(arg1); end
def some_methodone(arg_1); end
# good
:some_symone
:some_sym_one
variableone = 1
variable_one = 1
def some_methodone; end
def some_method_one; end
def some_methodone(argone); end
def some_methodone(arg_one); end
# In the following examples, we assume `EnforcedStyle: normalcase` (default).
Example: CheckMethodNames: true (default)
# bad
def some_method_1; end
Example: CheckMethodNames: false
# good
def some_method_1; end
Example: CheckSymbols: true (default)
# bad
:some_sym_1
Example: CheckSymbols: false
# good
:some_sym_1
Example: AllowedIdentifiers: [capture3]
# good
expect(Open3).to receive(:capture3)
Use normalcase for symbol numbers. Open
xls_color_13: "#800080",
- Read upRead up
- Exclude checks
This cop makes sure that all numbered variables use the configured style, snakecase, normalcase, or noninteger, for their numbering.
Additionally, CheckMethodNames
and CheckSymbols
configuration options
can be used to specify whether method names and symbols should be checked.
Both are enabled by default.
Example: EnforcedStyle: snake_case
# bad
:some_sym1
variable1 = 1
def some_method1; end
def some_method_1(arg1); end
# good
:some_sym_1
variable_1 = 1
def some_method_1; end
def some_method_1(arg_1); end
Example: EnforcedStyle: normalcase (default)
# bad
:some_sym_1
variable_1 = 1
def some_method_1; end
def some_method1(arg_1); end
# good
:some_sym1
variable1 = 1
def some_method1; end
def some_method1(arg1); end
Example: EnforcedStyle: non_integer
# bad
:some_sym1
:some_sym_1
variable1 = 1
variable_1 = 1
def some_method1; end
def some_method_1; end
def some_methodone(arg1); end
def some_methodone(arg_1); end
# good
:some_symone
:some_sym_one
variableone = 1
variable_one = 1
def some_methodone; end
def some_method_one; end
def some_methodone(argone); end
def some_methodone(arg_one); end
# In the following examples, we assume `EnforcedStyle: normalcase` (default).
Example: CheckMethodNames: true (default)
# bad
def some_method_1; end
Example: CheckMethodNames: false
# good
def some_method_1; end
Example: CheckSymbols: true (default)
# bad
:some_sym_1
Example: CheckSymbols: false
# good
:some_sym_1
Example: AllowedIdentifiers: [capture3]
# good
expect(Open3).to receive(:capture3)
Use normalcase for symbol numbers. Open
xls_color_23: "#0066CC",
- Read upRead up
- Exclude checks
This cop makes sure that all numbered variables use the configured style, snakecase, normalcase, or noninteger, for their numbering.
Additionally, CheckMethodNames
and CheckSymbols
configuration options
can be used to specify whether method names and symbols should be checked.
Both are enabled by default.
Example: EnforcedStyle: snake_case
# bad
:some_sym1
variable1 = 1
def some_method1; end
def some_method_1(arg1); end
# good
:some_sym_1
variable_1 = 1
def some_method_1; end
def some_method_1(arg_1); end
Example: EnforcedStyle: normalcase (default)
# bad
:some_sym_1
variable_1 = 1
def some_method_1; end
def some_method1(arg_1); end
# good
:some_sym1
variable1 = 1
def some_method1; end
def some_method1(arg1); end
Example: EnforcedStyle: non_integer
# bad
:some_sym1
:some_sym_1
variable1 = 1
variable_1 = 1
def some_method1; end
def some_method_1; end
def some_methodone(arg1); end
def some_methodone(arg_1); end
# good
:some_symone
:some_sym_one
variableone = 1
variable_one = 1
def some_methodone; end
def some_method_one; end
def some_methodone(argone); end
def some_methodone(arg_one); end
# In the following examples, we assume `EnforcedStyle: normalcase` (default).
Example: CheckMethodNames: true (default)
# bad
def some_method_1; end
Example: CheckMethodNames: false
# good
def some_method_1; end
Example: CheckSymbols: true (default)
# bad
:some_sym_1
Example: CheckSymbols: false
# good
:some_sym_1
Example: AllowedIdentifiers: [capture3]
# good
expect(Open3).to receive(:capture3)
Use normalcase for symbol numbers. Open
xls_color_42: "#33CCCC",
- Read upRead up
- Exclude checks
This cop makes sure that all numbered variables use the configured style, snakecase, normalcase, or noninteger, for their numbering.
Additionally, CheckMethodNames
and CheckSymbols
configuration options
can be used to specify whether method names and symbols should be checked.
Both are enabled by default.
Example: EnforcedStyle: snake_case
# bad
:some_sym1
variable1 = 1
def some_method1; end
def some_method_1(arg1); end
# good
:some_sym_1
variable_1 = 1
def some_method_1; end
def some_method_1(arg_1); end
Example: EnforcedStyle: normalcase (default)
# bad
:some_sym_1
variable_1 = 1
def some_method_1; end
def some_method1(arg_1); end
# good
:some_sym1
variable1 = 1
def some_method1; end
def some_method1(arg1); end
Example: EnforcedStyle: non_integer
# bad
:some_sym1
:some_sym_1
variable1 = 1
variable_1 = 1
def some_method1; end
def some_method_1; end
def some_methodone(arg1); end
def some_methodone(arg_1); end
# good
:some_symone
:some_sym_one
variableone = 1
variable_one = 1
def some_methodone; end
def some_method_one; end
def some_methodone(argone); end
def some_methodone(arg_one); end
# In the following examples, we assume `EnforcedStyle: normalcase` (default).
Example: CheckMethodNames: true (default)
# bad
def some_method_1; end
Example: CheckMethodNames: false
# good
def some_method_1; end
Example: CheckSymbols: true (default)
# bad
:some_sym_1
Example: CheckSymbols: false
# good
:some_sym_1
Example: AllowedIdentifiers: [capture3]
# good
expect(Open3).to receive(:capture3)
Use normalcase for symbol numbers. Open
xls_color_48: "#969696",
- Read upRead up
- Exclude checks
This cop makes sure that all numbered variables use the configured style, snakecase, normalcase, or noninteger, for their numbering.
Additionally, CheckMethodNames
and CheckSymbols
configuration options
can be used to specify whether method names and symbols should be checked.
Both are enabled by default.
Example: EnforcedStyle: snake_case
# bad
:some_sym1
variable1 = 1
def some_method1; end
def some_method_1(arg1); end
# good
:some_sym_1
variable_1 = 1
def some_method_1; end
def some_method_1(arg_1); end
Example: EnforcedStyle: normalcase (default)
# bad
:some_sym_1
variable_1 = 1
def some_method_1; end
def some_method1(arg_1); end
# good
:some_sym1
variable1 = 1
def some_method1; end
def some_method1(arg1); end
Example: EnforcedStyle: non_integer
# bad
:some_sym1
:some_sym_1
variable1 = 1
variable_1 = 1
def some_method1; end
def some_method_1; end
def some_methodone(arg1); end
def some_methodone(arg_1); end
# good
:some_symone
:some_sym_one
variableone = 1
variable_one = 1
def some_methodone; end
def some_method_one; end
def some_methodone(argone); end
def some_methodone(arg_one); end
# In the following examples, we assume `EnforcedStyle: normalcase` (default).
Example: CheckMethodNames: true (default)
# bad
def some_method_1; end
Example: CheckMethodNames: false
# good
def some_method_1; end
Example: CheckSymbols: true (default)
# bad
:some_sym_1
Example: CheckSymbols: false
# good
:some_sym_1
Example: AllowedIdentifiers: [capture3]
# good
expect(Open3).to receive(:capture3)
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
require "date"
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
"m" => "%m",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
"9" => "0%", "10" => "0.00%", "11" => "0.00E+00", "12" => "# ?/?",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
"45" => "mm:ss", "46" => "[h]:mm:ss", "47" => "mmss.0", "48" => "##0.0E+0",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
"45" => "mm:ss", "46" => "[h]:mm:ss", "47" => "mmss.0", "48" => "##0.0E+0",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
"49" => "@", "27" => "[$-404]e/m/d", "30" => "m/d/yy", "36" => "[$-404]e/m/d",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
"61" => "t#,##0", "62" => "t#,##0.00", "67" => "t0%", "68" => "t0.00%",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
"61" => "t#,##0", "62" => "t#,##0.00", "67" => "t0%", "68" => "t0.00%",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
numberformat.gsub("%Y", "yyyy").gsub("%A", "dddd").gsub("%B", "mmmm").gsub("%a", "ddd").gsub("%b", "mmm").gsub("%y", "yy").gsub("%d", "dd").gsub("%m", "mm").gsub("%y", "y").gsub("%y", "%%y").gsub("%e", "d")
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
xls_color_4: "#00FF00",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
xls_color_5: "#0000FF",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
xls_color_17: "#9999FF",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
xls_color_41: "#3366FF",
- 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 symbol numbers. Open
xls_color_11: "#000080",
- Read upRead up
- Exclude checks
This cop makes sure that all numbered variables use the configured style, snakecase, normalcase, or noninteger, for their numbering.
Additionally, CheckMethodNames
and CheckSymbols
configuration options
can be used to specify whether method names and symbols should be checked.
Both are enabled by default.
Example: EnforcedStyle: snake_case
# bad
:some_sym1
variable1 = 1
def some_method1; end
def some_method_1(arg1); end
# good
:some_sym_1
variable_1 = 1
def some_method_1; end
def some_method_1(arg_1); end
Example: EnforcedStyle: normalcase (default)
# bad
:some_sym_1
variable_1 = 1
def some_method_1; end
def some_method1(arg_1); end
# good
:some_sym1
variable1 = 1
def some_method1; end
def some_method1(arg1); end
Example: EnforcedStyle: non_integer
# bad
:some_sym1
:some_sym_1
variable1 = 1
variable_1 = 1
def some_method1; end
def some_method_1; end
def some_methodone(arg1); end
def some_methodone(arg_1); end
# good
:some_symone
:some_sym_one
variableone = 1
variable_one = 1
def some_methodone; end
def some_method_one; end
def some_methodone(argone); end
def some_methodone(arg_one); end
# In the following examples, we assume `EnforcedStyle: normalcase` (default).
Example: CheckMethodNames: true (default)
# bad
def some_method_1; end
Example: CheckMethodNames: false
# good
def some_method_1; end
Example: CheckSymbols: true (default)
# bad
:some_sym_1
Example: CheckSymbols: false
# good
:some_sym_1
Example: AllowedIdentifiers: [capture3]
# good
expect(Open3).to receive(:capture3)
Use normalcase for symbol numbers. Open
xls_color_19: "#FFFFCC",
- Read upRead up
- Exclude checks
This cop makes sure that all numbered variables use the configured style, snakecase, normalcase, or noninteger, for their numbering.
Additionally, CheckMethodNames
and CheckSymbols
configuration options
can be used to specify whether method names and symbols should be checked.
Both are enabled by default.
Example: EnforcedStyle: snake_case
# bad
:some_sym1
variable1 = 1
def some_method1; end
def some_method_1(arg1); end
# good
:some_sym_1
variable_1 = 1
def some_method_1; end
def some_method_1(arg_1); end
Example: EnforcedStyle: normalcase (default)
# bad
:some_sym_1
variable_1 = 1
def some_method_1; end
def some_method1(arg_1); end
# good
:some_sym1
variable1 = 1
def some_method1; end
def some_method1(arg1); end
Example: EnforcedStyle: non_integer
# bad
:some_sym1
:some_sym_1
variable1 = 1
variable_1 = 1
def some_method1; end
def some_method_1; end
def some_methodone(arg1); end
def some_methodone(arg_1); end
# good
:some_symone
:some_sym_one
variableone = 1
variable_one = 1
def some_methodone; end
def some_method_one; end
def some_methodone(argone); end
def some_methodone(arg_one); end
# In the following examples, we assume `EnforcedStyle: normalcase` (default).
Example: CheckMethodNames: true (default)
# bad
def some_method_1; end
Example: CheckMethodNames: false
# good
def some_method_1; end
Example: CheckSymbols: true (default)
# bad
:some_sym_1
Example: CheckSymbols: false
# good
:some_sym_1
Example: AllowedIdentifiers: [capture3]
# good
expect(Open3).to receive(:capture3)
Use normalcase for symbol numbers. Open
xls_color_20: "#CCFFFF",
- Read upRead up
- Exclude checks
This cop makes sure that all numbered variables use the configured style, snakecase, normalcase, or noninteger, for their numbering.
Additionally, CheckMethodNames
and CheckSymbols
configuration options
can be used to specify whether method names and symbols should be checked.
Both are enabled by default.
Example: EnforcedStyle: snake_case
# bad
:some_sym1
variable1 = 1
def some_method1; end
def some_method_1(arg1); end
# good
:some_sym_1
variable_1 = 1
def some_method_1; end
def some_method_1(arg_1); end
Example: EnforcedStyle: normalcase (default)
# bad
:some_sym_1
variable_1 = 1
def some_method_1; end
def some_method1(arg_1); end
# good
:some_sym1
variable1 = 1
def some_method1; end
def some_method1(arg1); end
Example: EnforcedStyle: non_integer
# bad
:some_sym1
:some_sym_1
variable1 = 1
variable_1 = 1
def some_method1; end
def some_method_1; end
def some_methodone(arg1); end
def some_methodone(arg_1); end
# good
:some_symone
:some_sym_one
variableone = 1
variable_one = 1
def some_methodone; end
def some_method_one; end
def some_methodone(argone); end
def some_methodone(arg_one); end
# In the following examples, we assume `EnforcedStyle: normalcase` (default).
Example: CheckMethodNames: true (default)
# bad
def some_method_1; end
Example: CheckMethodNames: false
# good
def some_method_1; end
Example: CheckSymbols: true (default)
# bad
:some_sym_1
Example: CheckSymbols: false
# good
:some_sym_1
Example: AllowedIdentifiers: [capture3]
# good
expect(Open3).to receive(:capture3)
Use normalcase for symbol numbers. Open
xls_color_39: "#CC99FF",
- Read upRead up
- Exclude checks
This cop makes sure that all numbered variables use the configured style, snakecase, normalcase, or noninteger, for their numbering.
Additionally, CheckMethodNames
and CheckSymbols
configuration options
can be used to specify whether method names and symbols should be checked.
Both are enabled by default.
Example: EnforcedStyle: snake_case
# bad
:some_sym1
variable1 = 1
def some_method1; end
def some_method_1(arg1); end
# good
:some_sym_1
variable_1 = 1
def some_method_1; end
def some_method_1(arg_1); end
Example: EnforcedStyle: normalcase (default)
# bad
:some_sym_1
variable_1 = 1
def some_method_1; end
def some_method1(arg_1); end
# good
:some_sym1
variable1 = 1
def some_method1; end
def some_method1(arg1); end
Example: EnforcedStyle: non_integer
# bad
:some_sym1
:some_sym_1
variable1 = 1
variable_1 = 1
def some_method1; end
def some_method_1; end
def some_methodone(arg1); end
def some_methodone(arg_1); end
# good
:some_symone
:some_sym_one
variableone = 1
variable_one = 1
def some_methodone; end
def some_method_one; end
def some_methodone(argone); end
def some_methodone(arg_one); end
# In the following examples, we assume `EnforcedStyle: normalcase` (default).
Example: CheckMethodNames: true (default)
# bad
def some_method_1; end
Example: CheckMethodNames: false
# good
def some_method_1; end
Example: CheckSymbols: true (default)
# bad
:some_sym_1
Example: CheckSymbols: false
# good
:some_sym_1
Example: AllowedIdentifiers: [capture3]
# good
expect(Open3).to receive(:capture3)
Use normalcase for symbol numbers. Open
xls_color_46: "#FF6600",
- Read upRead up
- Exclude checks
This cop makes sure that all numbered variables use the configured style, snakecase, normalcase, or noninteger, for their numbering.
Additionally, CheckMethodNames
and CheckSymbols
configuration options
can be used to specify whether method names and symbols should be checked.
Both are enabled by default.
Example: EnforcedStyle: snake_case
# bad
:some_sym1
variable1 = 1
def some_method1; end
def some_method_1(arg1); end
# good
:some_sym_1
variable_1 = 1
def some_method_1; end
def some_method_1(arg_1); end
Example: EnforcedStyle: normalcase (default)
# bad
:some_sym_1
variable_1 = 1
def some_method_1; end
def some_method1(arg_1); end
# good
:some_sym1
variable1 = 1
def some_method1; end
def some_method1(arg1); end
Example: EnforcedStyle: non_integer
# bad
:some_sym1
:some_sym_1
variable1 = 1
variable_1 = 1
def some_method1; end
def some_method_1; end
def some_methodone(arg1); end
def some_methodone(arg_1); end
# good
:some_symone
:some_sym_one
variableone = 1
variable_one = 1
def some_methodone; end
def some_method_one; end
def some_methodone(argone); end
def some_methodone(arg_one); end
# In the following examples, we assume `EnforcedStyle: normalcase` (default).
Example: CheckMethodNames: true (default)
# bad
def some_method_1; end
Example: CheckMethodNames: false
# good
def some_method_1; end
Example: CheckSymbols: true (default)
# bad
:some_sym_1
Example: CheckSymbols: false
# good
:some_sym_1
Example: AllowedIdentifiers: [capture3]
# good
expect(Open3).to receive(:capture3)
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
"mmmm" => "%B",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
"mmm" => "%b",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
"y" => "%y",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
"y" => "%y",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
{"0" => nil, "1" => "0", "2" => "0.00", "3" => "#,##0", "4" => "#,##0.00",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
"9" => "0%", "10" => "0.00%", "11" => "0.00E+00", "12" => "# ?/?",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
"20" => "h:mm", "21" => "h:mm:ss", "22" => "m/d/yy h:mm",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
"45" => "mm:ss", "46" => "[h]:mm:ss", "47" => "mmss.0", "48" => "##0.0E+0",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
numberformat.gsub("%Y", "yyyy").gsub("%A", "dddd").gsub("%B", "mmmm").gsub("%a", "ddd").gsub("%b", "mmm").gsub("%y", "yy").gsub("%d", "dd").gsub("%m", "mm").gsub("%y", "y").gsub("%y", "%%y").gsub("%e", "d")
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
xls_color_2: "#FFFFFF",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
xls_color_23: "#0066CC",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
xls_color_33: "#00CCFF",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
xls_color_49: "#003366",
- 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"
Space inside { missing. Open
{"0" => nil, "1" => "0", "2" => "0.00", "3" => "#,##0", "4" => "#,##0.00",
- Read upRead up
- Exclude checks
Checks that braces used for hash literals have or don't have surrounding space depending on configuration.
Example: EnforcedStyle: space (default)
# The `space` style enforces that hash literals have
# surrounding space.
# bad
h = {a: 1, b: 2}
# good
h = { a: 1, b: 2 }
Example: EnforcedStyle: no_space
# The `no_space` style enforces that hash literals have
# no surrounding space.
# bad
h = { a: 1, b: 2 }
# good
h = {a: 1, b: 2}
Example: EnforcedStyle: compact
# The `compact` style normally requires a space inside
# hash braces, with the exception that successive left
# braces or right braces are collapsed together in nested hashes.
# bad
h = { a: { b: 2 } }
foo = { { a: 1 } => { b: { c: 2 } } }
# good
h = { a: { b: 2 }}
foo = {{ a: 1 } => { b: { c: 2 }}}
Example: EnforcedStyleForEmptyBraces: no_space (default)
# The `no_space` EnforcedStyleForEmptyBraces style enforces that
# empty hash braces do not contain spaces.
# bad
foo = { }
bar = { }
# good
foo = {}
bar = {}
Example: EnforcedStyleForEmptyBraces: space
# The `space` EnforcedStyleForEmptyBraces style enforces that
# empty hash braces contain space.
# bad
foo = {}
# good
foo = { }
foo = { }
foo = { }
Use normalcase for symbol numbers. Open
xls_color_17: "#9999FF",
- Read upRead up
- Exclude checks
This cop makes sure that all numbered variables use the configured style, snakecase, normalcase, or noninteger, for their numbering.
Additionally, CheckMethodNames
and CheckSymbols
configuration options
can be used to specify whether method names and symbols should be checked.
Both are enabled by default.
Example: EnforcedStyle: snake_case
# bad
:some_sym1
variable1 = 1
def some_method1; end
def some_method_1(arg1); end
# good
:some_sym_1
variable_1 = 1
def some_method_1; end
def some_method_1(arg_1); end
Example: EnforcedStyle: normalcase (default)
# bad
:some_sym_1
variable_1 = 1
def some_method_1; end
def some_method1(arg_1); end
# good
:some_sym1
variable1 = 1
def some_method1; end
def some_method1(arg1); end
Example: EnforcedStyle: non_integer
# bad
:some_sym1
:some_sym_1
variable1 = 1
variable_1 = 1
def some_method1; end
def some_method_1; end
def some_methodone(arg1); end
def some_methodone(arg_1); end
# good
:some_symone
:some_sym_one
variableone = 1
variable_one = 1
def some_methodone; end
def some_method_one; end
def some_methodone(argone); end
def some_methodone(arg_one); end
# In the following examples, we assume `EnforcedStyle: normalcase` (default).
Example: CheckMethodNames: true (default)
# bad
def some_method_1; end
Example: CheckMethodNames: false
# good
def some_method_1; end
Example: CheckSymbols: true (default)
# bad
:some_sym_1
Example: CheckSymbols: false
# good
:some_sym_1
Example: AllowedIdentifiers: [capture3]
# good
expect(Open3).to receive(:capture3)
Use normalcase for symbol numbers. Open
xls_color_22: "#FF8080",
- Read upRead up
- Exclude checks
This cop makes sure that all numbered variables use the configured style, snakecase, normalcase, or noninteger, for their numbering.
Additionally, CheckMethodNames
and CheckSymbols
configuration options
can be used to specify whether method names and symbols should be checked.
Both are enabled by default.
Example: EnforcedStyle: snake_case
# bad
:some_sym1
variable1 = 1
def some_method1; end
def some_method_1(arg1); end
# good
:some_sym_1
variable_1 = 1
def some_method_1; end
def some_method_1(arg_1); end
Example: EnforcedStyle: normalcase (default)
# bad
:some_sym_1
variable_1 = 1
def some_method_1; end
def some_method1(arg_1); end
# good
:some_sym1
variable1 = 1
def some_method1; end
def some_method1(arg1); end
Example: EnforcedStyle: non_integer
# bad
:some_sym1
:some_sym_1
variable1 = 1
variable_1 = 1
def some_method1; end
def some_method_1; end
def some_methodone(arg1); end
def some_methodone(arg_1); end
# good
:some_symone
:some_sym_one
variableone = 1
variable_one = 1
def some_methodone; end
def some_method_one; end
def some_methodone(argone); end
def some_methodone(arg_one); end
# In the following examples, we assume `EnforcedStyle: normalcase` (default).
Example: CheckMethodNames: true (default)
# bad
def some_method_1; end
Example: CheckMethodNames: false
# good
def some_method_1; end
Example: CheckSymbols: true (default)
# bad
:some_sym_1
Example: CheckSymbols: false
# good
:some_sym_1
Example: AllowedIdentifiers: [capture3]
# good
expect(Open3).to receive(:capture3)
Use normalcase for symbol numbers. Open
xls_color_45: "#FF9900",
- Read upRead up
- Exclude checks
This cop makes sure that all numbered variables use the configured style, snakecase, normalcase, or noninteger, for their numbering.
Additionally, CheckMethodNames
and CheckSymbols
configuration options
can be used to specify whether method names and symbols should be checked.
Both are enabled by default.
Example: EnforcedStyle: snake_case
# bad
:some_sym1
variable1 = 1
def some_method1; end
def some_method_1(arg1); end
# good
:some_sym_1
variable_1 = 1
def some_method_1; end
def some_method_1(arg_1); end
Example: EnforcedStyle: normalcase (default)
# bad
:some_sym_1
variable_1 = 1
def some_method_1; end
def some_method1(arg_1); end
# good
:some_sym1
variable1 = 1
def some_method1; end
def some_method1(arg1); end
Example: EnforcedStyle: non_integer
# bad
:some_sym1
:some_sym_1
variable1 = 1
variable_1 = 1
def some_method1; end
def some_method_1; end
def some_methodone(arg1); end
def some_methodone(arg_1); end
# good
:some_symone
:some_sym_one
variableone = 1
variable_one = 1
def some_methodone; end
def some_method_one; end
def some_methodone(argone); end
def some_methodone(arg_one); end
# In the following examples, we assume `EnforcedStyle: normalcase` (default).
Example: CheckMethodNames: true (default)
# bad
def some_method_1; end
Example: CheckMethodNames: false
# good
def some_method_1; end
Example: CheckSymbols: true (default)
# bad
:some_sym_1
Example: CheckSymbols: false
# good
:some_sym_1
Example: AllowedIdentifiers: [capture3]
# good
expect(Open3).to receive(:capture3)
Use normalcase for symbol numbers. Open
xls_color_49: "#003366",
- Read upRead up
- Exclude checks
This cop makes sure that all numbered variables use the configured style, snakecase, normalcase, or noninteger, for their numbering.
Additionally, CheckMethodNames
and CheckSymbols
configuration options
can be used to specify whether method names and symbols should be checked.
Both are enabled by default.
Example: EnforcedStyle: snake_case
# bad
:some_sym1
variable1 = 1
def some_method1; end
def some_method_1(arg1); end
# good
:some_sym_1
variable_1 = 1
def some_method_1; end
def some_method_1(arg_1); end
Example: EnforcedStyle: normalcase (default)
# bad
:some_sym_1
variable_1 = 1
def some_method_1; end
def some_method1(arg_1); end
# good
:some_sym1
variable1 = 1
def some_method1; end
def some_method1(arg1); end
Example: EnforcedStyle: non_integer
# bad
:some_sym1
:some_sym_1
variable1 = 1
variable_1 = 1
def some_method1; end
def some_method_1; end
def some_methodone(arg1); end
def some_methodone(arg_1); end
# good
:some_symone
:some_sym_one
variableone = 1
variable_one = 1
def some_methodone; end
def some_method_one; end
def some_methodone(argone); end
def some_methodone(arg_one); end
# In the following examples, we assume `EnforcedStyle: normalcase` (default).
Example: CheckMethodNames: true (default)
# bad
def some_method_1; end
Example: CheckMethodNames: false
# good
def some_method_1; end
Example: CheckSymbols: true (default)
# bad
:some_sym_1
Example: CheckSymbols: false
# good
:some_sym_1
Example: AllowedIdentifiers: [capture3]
# good
expect(Open3).to receive(:capture3)
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
"mmmm" => "%B",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
"d" => "%e",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
"45" => "mm:ss", "46" => "[h]:mm:ss", "47" => "mmss.0", "48" => "##0.0E+0",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
"49" => "@", "27" => "[$-404]e/m/d", "30" => "m/d/yy", "36" => "[$-404]e/m/d",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
"49" => "@", "27" => "[$-404]e/m/d", "30" => "m/d/yy", "36" => "[$-404]e/m/d",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
xls_color_7: "#FF00FF",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
xls_color_31: "#008080",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
xls_color_45: "#FF9900",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
xls_color_46: "#FF6600",
- 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 symbol numbers. Open
XLS_COLORS = {xls_color_1: "#000000",
- Read upRead up
- Exclude checks
This cop makes sure that all numbered variables use the configured style, snakecase, normalcase, or noninteger, for their numbering.
Additionally, CheckMethodNames
and CheckSymbols
configuration options
can be used to specify whether method names and symbols should be checked.
Both are enabled by default.
Example: EnforcedStyle: snake_case
# bad
:some_sym1
variable1 = 1
def some_method1; end
def some_method_1(arg1); end
# good
:some_sym_1
variable_1 = 1
def some_method_1; end
def some_method_1(arg_1); end
Example: EnforcedStyle: normalcase (default)
# bad
:some_sym_1
variable_1 = 1
def some_method_1; end
def some_method1(arg_1); end
# good
:some_sym1
variable1 = 1
def some_method1; end
def some_method1(arg1); end
Example: EnforcedStyle: non_integer
# bad
:some_sym1
:some_sym_1
variable1 = 1
variable_1 = 1
def some_method1; end
def some_method_1; end
def some_methodone(arg1); end
def some_methodone(arg_1); end
# good
:some_symone
:some_sym_one
variableone = 1
variable_one = 1
def some_methodone; end
def some_method_one; end
def some_methodone(argone); end
def some_methodone(arg_one); end
# In the following examples, we assume `EnforcedStyle: normalcase` (default).
Example: CheckMethodNames: true (default)
# bad
def some_method_1; end
Example: CheckMethodNames: false
# good
def some_method_1; end
Example: CheckSymbols: true (default)
# bad
:some_sym_1
Example: CheckSymbols: false
# good
:some_sym_1
Example: AllowedIdentifiers: [capture3]
# good
expect(Open3).to receive(:capture3)
Use normalcase for symbol numbers. Open
xls_color_2: "#FFFFFF",
- Read upRead up
- Exclude checks
This cop makes sure that all numbered variables use the configured style, snakecase, normalcase, or noninteger, for their numbering.
Additionally, CheckMethodNames
and CheckSymbols
configuration options
can be used to specify whether method names and symbols should be checked.
Both are enabled by default.
Example: EnforcedStyle: snake_case
# bad
:some_sym1
variable1 = 1
def some_method1; end
def some_method_1(arg1); end
# good
:some_sym_1
variable_1 = 1
def some_method_1; end
def some_method_1(arg_1); end
Example: EnforcedStyle: normalcase (default)
# bad
:some_sym_1
variable_1 = 1
def some_method_1; end
def some_method1(arg_1); end
# good
:some_sym1
variable1 = 1
def some_method1; end
def some_method1(arg1); end
Example: EnforcedStyle: non_integer
# bad
:some_sym1
:some_sym_1
variable1 = 1
variable_1 = 1
def some_method1; end
def some_method_1; end
def some_methodone(arg1); end
def some_methodone(arg_1); end
# good
:some_symone
:some_sym_one
variableone = 1
variable_one = 1
def some_methodone; end
def some_method_one; end
def some_methodone(argone); end
def some_methodone(arg_one); end
# In the following examples, we assume `EnforcedStyle: normalcase` (default).
Example: CheckMethodNames: true (default)
# bad
def some_method_1; end
Example: CheckMethodNames: false
# good
def some_method_1; end
Example: CheckSymbols: true (default)
# bad
:some_sym_1
Example: CheckSymbols: false
# good
:some_sym_1
Example: AllowedIdentifiers: [capture3]
# good
expect(Open3).to receive(:capture3)
Use normalcase for symbol numbers. Open
xls_color_10: "#008000",
- Read upRead up
- Exclude checks
This cop makes sure that all numbered variables use the configured style, snakecase, normalcase, or noninteger, for their numbering.
Additionally, CheckMethodNames
and CheckSymbols
configuration options
can be used to specify whether method names and symbols should be checked.
Both are enabled by default.
Example: EnforcedStyle: snake_case
# bad
:some_sym1
variable1 = 1
def some_method1; end
def some_method_1(arg1); end
# good
:some_sym_1
variable_1 = 1
def some_method_1; end
def some_method_1(arg_1); end
Example: EnforcedStyle: normalcase (default)
# bad
:some_sym_1
variable_1 = 1
def some_method_1; end
def some_method1(arg_1); end
# good
:some_sym1
variable1 = 1
def some_method1; end
def some_method1(arg1); end
Example: EnforcedStyle: non_integer
# bad
:some_sym1
:some_sym_1
variable1 = 1
variable_1 = 1
def some_method1; end
def some_method_1; end
def some_methodone(arg1); end
def some_methodone(arg_1); end
# good
:some_symone
:some_sym_one
variableone = 1
variable_one = 1
def some_methodone; end
def some_method_one; end
def some_methodone(argone); end
def some_methodone(arg_one); end
# In the following examples, we assume `EnforcedStyle: normalcase` (default).
Example: CheckMethodNames: true (default)
# bad
def some_method_1; end
Example: CheckMethodNames: false
# good
def some_method_1; end
Example: CheckSymbols: true (default)
# bad
:some_sym_1
Example: CheckSymbols: false
# good
:some_sym_1
Example: AllowedIdentifiers: [capture3]
# good
expect(Open3).to receive(:capture3)
Use normalcase for symbol numbers. Open
xls_color_16: "#808080",
- Read upRead up
- Exclude checks
This cop makes sure that all numbered variables use the configured style, snakecase, normalcase, or noninteger, for their numbering.
Additionally, CheckMethodNames
and CheckSymbols
configuration options
can be used to specify whether method names and symbols should be checked.
Both are enabled by default.
Example: EnforcedStyle: snake_case
# bad
:some_sym1
variable1 = 1
def some_method1; end
def some_method_1(arg1); end
# good
:some_sym_1
variable_1 = 1
def some_method_1; end
def some_method_1(arg_1); end
Example: EnforcedStyle: normalcase (default)
# bad
:some_sym_1
variable_1 = 1
def some_method_1; end
def some_method1(arg_1); end
# good
:some_sym1
variable1 = 1
def some_method1; end
def some_method1(arg1); end
Example: EnforcedStyle: non_integer
# bad
:some_sym1
:some_sym_1
variable1 = 1
variable_1 = 1
def some_method1; end
def some_method_1; end
def some_methodone(arg1); end
def some_methodone(arg_1); end
# good
:some_symone
:some_sym_one
variableone = 1
variable_one = 1
def some_methodone; end
def some_method_one; end
def some_methodone(argone); end
def some_methodone(arg_one); end
# In the following examples, we assume `EnforcedStyle: normalcase` (default).
Example: CheckMethodNames: true (default)
# bad
def some_method_1; end
Example: CheckMethodNames: false
# good
def some_method_1; end
Example: CheckSymbols: true (default)
# bad
:some_sym_1
Example: CheckSymbols: false
# good
:some_sym_1
Example: AllowedIdentifiers: [capture3]
# good
expect(Open3).to receive(:capture3)
Use normalcase for symbol numbers. Open
xls_color_31: "#008080",
- Read upRead up
- Exclude checks
This cop makes sure that all numbered variables use the configured style, snakecase, normalcase, or noninteger, for their numbering.
Additionally, CheckMethodNames
and CheckSymbols
configuration options
can be used to specify whether method names and symbols should be checked.
Both are enabled by default.
Example: EnforcedStyle: snake_case
# bad
:some_sym1
variable1 = 1
def some_method1; end
def some_method_1(arg1); end
# good
:some_sym_1
variable_1 = 1
def some_method_1; end
def some_method_1(arg_1); end
Example: EnforcedStyle: normalcase (default)
# bad
:some_sym_1
variable_1 = 1
def some_method_1; end
def some_method1(arg_1); end
# good
:some_sym1
variable1 = 1
def some_method1; end
def some_method1(arg1); end
Example: EnforcedStyle: non_integer
# bad
:some_sym1
:some_sym_1
variable1 = 1
variable_1 = 1
def some_method1; end
def some_method_1; end
def some_methodone(arg1); end
def some_methodone(arg_1); end
# good
:some_symone
:some_sym_one
variableone = 1
variable_one = 1
def some_methodone; end
def some_method_one; end
def some_methodone(argone); end
def some_methodone(arg_one); end
# In the following examples, we assume `EnforcedStyle: normalcase` (default).
Example: CheckMethodNames: true (default)
# bad
def some_method_1; end
Example: CheckMethodNames: false
# good
def some_method_1; end
Example: CheckSymbols: true (default)
# bad
:some_sym_1
Example: CheckSymbols: false
# good
:some_sym_1
Example: AllowedIdentifiers: [capture3]
# good
expect(Open3).to receive(:capture3)
Use normalcase for symbol numbers. Open
xls_color_55: "#333399",
- Read upRead up
- Exclude checks
This cop makes sure that all numbered variables use the configured style, snakecase, normalcase, or noninteger, for their numbering.
Additionally, CheckMethodNames
and CheckSymbols
configuration options
can be used to specify whether method names and symbols should be checked.
Both are enabled by default.
Example: EnforcedStyle: snake_case
# bad
:some_sym1
variable1 = 1
def some_method1; end
def some_method_1(arg1); end
# good
:some_sym_1
variable_1 = 1
def some_method_1; end
def some_method_1(arg_1); end
Example: EnforcedStyle: normalcase (default)
# bad
:some_sym_1
variable_1 = 1
def some_method_1; end
def some_method1(arg_1); end
# good
:some_sym1
variable1 = 1
def some_method1; end
def some_method1(arg1); end
Example: EnforcedStyle: non_integer
# bad
:some_sym1
:some_sym_1
variable1 = 1
variable_1 = 1
def some_method1; end
def some_method_1; end
def some_methodone(arg1); end
def some_methodone(arg_1); end
# good
:some_symone
:some_sym_one
variableone = 1
variable_one = 1
def some_methodone; end
def some_method_one; end
def some_methodone(argone); end
def some_methodone(arg_one); end
# In the following examples, we assume `EnforcedStyle: normalcase` (default).
Example: CheckMethodNames: true (default)
# bad
def some_method_1; end
Example: CheckMethodNames: false
# good
def some_method_1; end
Example: CheckSymbols: true (default)
# bad
:some_sym_1
Example: CheckSymbols: false
# good
:some_sym_1
Example: AllowedIdentifiers: [capture3]
# good
expect(Open3).to receive(:capture3)
Use def with parentheses when there are parameters. Open
def ms_formatting_to_strftime ms_nr_format
- Read upRead up
- Exclude checks
This cop checks for parentheses around the arguments in method definitions. Both instance and class/singleton methods are checked.
This cop does not consider endless methods, since parentheses are always required for them.
Example: EnforcedStyle: require_parentheses (default)
# The `require_parentheses` style requires method definitions
# to always use parentheses
# bad
def bar num1, num2
num1 + num2
end
def foo descriptive_var_name,
another_descriptive_var_name,
last_descriptive_var_name
do_something
end
# good
def bar(num1, num2)
num1 + num2
end
def foo(descriptive_var_name,
another_descriptive_var_name,
last_descriptive_var_name)
do_something
end
Example: EnforcedStyle: requirenoparentheses
# The `require_no_parentheses` style requires method definitions
# to never use parentheses
# bad
def bar(num1, num2)
num1 + num2
end
def foo(descriptive_var_name,
another_descriptive_var_name,
last_descriptive_var_name)
do_something
end
# good
def bar num1, num2
num1 + num2
end
def foo descriptive_var_name,
another_descriptive_var_name,
last_descriptive_var_name
do_something
end
Example: EnforcedStyle: requirenoparenthesesexceptmultiline
# The `require_no_parentheses_except_multiline` style prefers no
# parentheses when method definition arguments fit on single line,
# but prefers parentheses when arguments span multiple lines.
# bad
def bar(num1, num2)
num1 + num2
end
def foo descriptive_var_name,
another_descriptive_var_name,
last_descriptive_var_name
do_something
end
# good
def bar num1, num2
num1 + num2
end
def foo(descriptive_var_name,
another_descriptive_var_name,
last_descriptive_var_name)
do_something
end
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
"yyyy" => "%Y",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
"dddd" => "%A",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
"ddd" => "%a",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
"mmm" => "%b",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
"37" => "#,##0 ;(#,##0)", "38" => "#,##0 ;[Red](#,##0)",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
"45" => "mm:ss", "46" => "[h]:mm:ss", "47" => "mmss.0", "48" => "##0.0E+0",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
"50" => "[$-404]e/m/d", "57" => "[$-404]e/m/d", "59" => "t0", "60" => "t0.00",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
"61" => "t#,##0", "62" => "t#,##0.00", "67" => "t0%", "68" => "t0.00%",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
return k if (v == hex) || (hex && (hex != "") && (k == hex.to_sym))
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
numberformat.gsub("%Y", "yyyy").gsub("%A", "dddd").gsub("%B", "mmmm").gsub("%a", "ddd").gsub("%b", "mmm").gsub("%y", "yy").gsub("%d", "dd").gsub("%m", "mm").gsub("%y", "y").gsub("%y", "%%y").gsub("%e", "d")
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
xls_color_3: "#FF0000",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
xls_color_29: "#800080",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
xls_color_32: "#0000FF",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
xls_color_56: "#333333",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
text: "#000000",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
"49" => "@", "27" => "[$-404]e/m/d", "30" => "m/d/yy", "36" => "[$-404]e/m/d",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
"49" => "@", "27" => "[$-404]e/m/d", "30" => "m/d/yy", "36" => "[$-404]e/m/d",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
"50" => "[$-404]e/m/d", "57" => "[$-404]e/m/d", "59" => "t0", "60" => "t0.00",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
"61" => "t#,##0", "62" => "t#,##0.00", "67" => "t0%", "68" => "t0.00%",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
"61" => "t#,##0", "62" => "t#,##0.00", "67" => "t0%", "68" => "t0.00%",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
"69" => "t# ?/?", "70" => "t# ??/??"}[num_fmt_id.to_s]
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
numberformat.gsub("%Y", "yyyy").gsub("%A", "dddd").gsub("%B", "mmmm").gsub("%a", "ddd").gsub("%b", "mmm").gsub("%y", "yy").gsub("%d", "dd").gsub("%m", "mm").gsub("%y", "y").gsub("%y", "%%y").gsub("%e", "d")
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
numberformat.gsub("%Y", "yyyy").gsub("%A", "dddd").gsub("%B", "mmmm").gsub("%a", "ddd").gsub("%b", "mmm").gsub("%y", "yy").gsub("%d", "dd").gsub("%m", "mm").gsub("%y", "y").gsub("%y", "%%y").gsub("%e", "d")
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
numberformat.gsub("%Y", "yyyy").gsub("%A", "dddd").gsub("%B", "mmmm").gsub("%a", "ddd").gsub("%b", "mmm").gsub("%y", "yy").gsub("%d", "dd").gsub("%m", "mm").gsub("%y", "y").gsub("%y", "%%y").gsub("%e", "d")
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
numberformat.gsub("%Y", "yyyy").gsub("%A", "dddd").gsub("%B", "mmmm").gsub("%a", "ddd").gsub("%b", "mmm").gsub("%y", "yy").gsub("%d", "dd").gsub("%m", "mm").gsub("%y", "y").gsub("%y", "%%y").gsub("%e", "d")
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
xls_color_30: "#800000",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
xls_color_52: "#333300",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
green: "#00FF00",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
black: "#000000",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
cyan: "#00FFFF",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
lime: "#00f94c"}
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
red: "#FF0000",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
border: "#FFFFFF",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
blue: "#0000FF",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
yellow: "#FFFF00",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
xls_color_55: "#333399",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
xls_color_53: "#993300",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
xls_color_54: "#993366",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
white: "#FFFFFF",
- 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"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
magenta: "#FF00FF",
- 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"