app/helpers/qr_code_helper.rb
Put a comma after the last item of a multiline hash. Open
Open
svg: 'image/svg+xml'
- Read upRead up
- Exclude checks
Checks for trailing comma in hash literals. The configuration options are:
-
consistent_comma
: Requires a comma after the last item of all non-empty, multiline hash literals. -
comma
: Requires a comma after the last item in a hash, but only when each item is on its own line. -
no_comma
: Does not require a comma after the last item in a hash
Example: EnforcedStyleForMultiline: consistent_comma
# bad
a = { foo: 1, bar: 2, }
# good
a = { foo: 1, bar: 2 }
# good
a = {
foo: 1, bar: 2,
qux: 3,
}
# good
a = {
foo: 1, bar: 2, qux: 3,
}
# good
a = {
foo: 1,
bar: 2,
}
Example: EnforcedStyleForMultiline: comma
# bad
a = { foo: 1, bar: 2, }
# good
a = { foo: 1, bar: 2 }
# bad
a = {
foo: 1, bar: 2,
qux: 3,
}
# good
a = {
foo: 1, bar: 2,
qux: 3
}
# bad
a = {
foo: 1, bar: 2, qux: 3,
}
# good
a = {
foo: 1, bar: 2, qux: 3
}
# good
a = {
foo: 1,
bar: 2,
}
Example: EnforcedStyleForMultiline: no_comma (default)
# bad
a = { foo: 1, bar: 2, }
# good
a = {
foo: 1,
bar: 2
}
Final newline missing. Open
Open
end
- Read upRead up
- Exclude checks
Looks for trailing blank lines and a final newline in the source code.
Example: EnforcedStyle: final_newline (default)
# `final_newline` looks for one newline at the end of files.
# bad
class Foo; end
# EOF
# bad
class Foo; end # EOF
# good
class Foo; end
# EOF
Example: EnforcedStyle: finalblankline
# `final_blank_line` looks for one blank line followed by a new line
# at the end of files.
# bad
class Foo; end
# EOF
# bad
class Foo; end # EOF
# good
class Foo; end
# EOF