Showing 46 of 46 total issues
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
open(SOURCE_FILE, "rb") do |read_file|
- 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"
Line is too long. [110/80] Open
SPEC_FILE_FORMAT = 'https://raw.githubusercontent.com/multiformats/multibase/master/tests/test%<index>d.csv'
- Exclude checks
Unused block argument - t
. You can omit the argument if you don't care about it. Open
Rake::Task.define_task(:update) do |t|
- Read upRead up
- Exclude checks
This cop checks for unused block arguments.
Example:
# bad
do_something do |used, unused|
puts used
end
do_something do |bar|
puts :foo
end
define_method(:foo) do |bar|
puts :baz
end
Example:
#good
do_something do |used, _unused|
puts used
end
do_something do
puts :foo
end
define_method(:foo) do |_bar|
puts :baz
end
Dollar signs used before commands without showing output Open
$ gem install multibases
- Read upRead up
- Exclude checks
MD014 - Dollar signs used before commands without showing output
Tags: code
Aliases: commands-show-output
This rule is triggered when there are code blocks showing shell commands to be typed, and the shell commands are preceded by dollar signs ($):
$ ls
$ cat foo
$ less bar
The dollar signs are unnecessary in the above situation, and should not be included:
ls
cat foo
less bar
However, an exception is made when there is a need to distinguish between typed commands and command output, as in the following example:
$ ls
foo bar
$ cat foo
Hello world
$ cat bar
baz
Rationale: it is easier to copy and paste and less noisy if the dollar signs are omitted when they are not needed. See http://www.cirosantilli.com/markdown-styleguide/#dollar-signs-in-shell-code for more information.
Code block style Open
$ bundle
- Exclude checks
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
File.open(File.join(__dir__, 'lib', 'table.csv'), "wb") do |saved_file|
- 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"