Showing 6 of 8 total issues
Line is too long. [86/80] Open
Open
abort("The Rails environment is running in production mode!") if Rails.env.production?
- Exclude checks
Line is too long. [105/80] Open
Open
# start by truncating all the tables but then use the faster transaction strategy the rest of the time.
- Exclude checks
include
is used at the top level. Use inside class
or module
. Open
Open
include FileUtils
- Read upRead up
- Exclude checks
This cop checks that include
, extend
and prepend
exists at
the top level.
Using these at the top level affects the behavior of Object
.
There will not be using include
, extend
and prepend
at
the top level. Let's use it inside class
or module
.
Example:
# bad
include M
class C
end
# bad
extend M
class C
end
# bad
prepend M
class C
end
# good
class C
include M
end
# good
class C
extend M
end
# good
class C
prepend M
end
Missing top-level class documentation comment. Open
Open
class TestCase
- 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, or constant definitions.
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
# good
# Description/Explanation of Person class
class Person
# ...
end
Line is too long. [100/80] Open
Open
# configure shoulda matchers to use rspec as the test framework and full matcher libraries for rails
- Exclude checks
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
Open
abort("The Rails environment is running in production mode!") if Rails.env.production?
- 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"