Showing 22 of 22 total issues
The name of this source file (rack-attack.rb
) should use snake_case. Open
Open
# be sure to restart your server when you modify this file.
- Read upRead up
- Exclude checks
This cop makes sure that Ruby source files have snake_case names. Ruby scripts (i.e. source files with a shebang in the first line) are ignored.
Example:
# bad
lib/layoutManager.rb
anything/usingCamelCase
# good
lib/layout_manager.rb
anything/using_snake_case.rake
Use a guard clause instead of wrapping the code inside a conditional expression. Open
Open
if !Rails.env.test? && !file.tempfile.is_a?(StringIO)
- 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