Showing 19 of 19 total issues
Freeze mutable objects assigned to constants. Open
VERSION = '0.1.0'
- Read upRead up
- Exclude checks
This cop checks whether some constant value isn't a mutable literal (e.g. array or hash).
Example:
# bad
CONST = [1, 2, 3]
# good
CONST = [1, 2, 3].freeze
Final newline missing. Open
end
- Exclude checks
Final newline missing. Open
require File.join('omniauth', 'box_oauth2')
- Exclude checks
The name of this source file (omniauth-box-oauth2.rb
) should use snake_case. Open
require File.join('omniauth', 'box_oauth2')
- 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
Trailing whitespace detected. Open
private
- Exclude checks
Trailing whitespace detected. Open
end
- Exclude checks
Redundant curly braces around a hash parameter. Open
option :client_options, {
site: 'https://api.box.com/2.0/',
authorize_url: 'https://app.box.com/api/oauth2/authorize',
token_url: 'https://api.box.com/oauth2/token'
}
- Read upRead up
- Exclude checks
This cop checks for braces around the last parameter in a method call
if the last parameter is a hash.
It supports braces
, no_braces
and context_dependent
styles.
Example: EnforcedStyle: braces
# The `braces` style enforces braces around all method
# parameters that are hashes.
# bad
some_method(x, y, a: 1, b: 2)
# good
some_method(x, y, {a: 1, b: 2})
Example: EnforcedStyle: no_braces (default)
# The `no_braces` style checks that the last parameter doesn't
# have braces around it.
# bad
some_method(x, y, {a: 1, b: 2})
# good
some_method(x, y, a: 1, b: 2)
Example: EnforcedStyle: context_dependent
# The `context_dependent` style checks that the last parameter
# doesn't have braces around it, but requires braces if the
# second to last parameter is also a hash literal.
# bad
some_method(x, y, {a: 1, b: 2})
some_method(x, y, {a: 1, b: 2}, a: 1, b: 2)
# good
some_method(x, y, a: 1, b: 2)
some_method(x, y, {a: 1, b: 2}, {a: 1, b: 2})
Trailing whitespace detected. Open
group :test do
- Exclude checks
Final newline missing. Open
end
- Exclude checks
Final newline missing. Open
require File.join('omniauth', 'strategies', 'box_oauth2')
- Exclude checks
Add an empty line after magic comments. Open
lib = File.expand_path('../lib', __FILE__)
- Read upRead up
- Exclude checks
Checks for a newline after the final magic comment.
Example:
# good
# frozen_string_literal: true
# Some documentation for Person
class Person
# Some code
end
# bad
# frozen_string_literal: true
# Some documentation for Person
class Person
# Some code
end
%q
-literals should be delimited by (
and )
. Open
spec.summary = %q{A Box OAuth2 strategy for OmniAuth 1.x}
- Read upRead up
- Exclude checks
This cop enforces the consistent usage of %
-literal delimiters.
Specify the 'default' key to set all preferred delimiters at once. You can continue to specify individual preferred delimiters to override the default.
Example:
# Style/PercentLiteralDelimiters:
# PreferredDelimiters:
# default: '[]'
# '%i': '()'
# good
%w[alpha beta] + %i(gamma delta)
# bad
%W(alpha #{beta})
# bad
%I(alpha beta)
Missing top-level class documentation comment. Open
class BoxOauth2 < OmniAuth::Strategies::OAuth2
- 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
Trailing whitespace detected. Open
extra do
- Exclude checks
Use %q
only for strings that contain both single quotes and double quotes. Open
spec.summary = %q{A Box OAuth2 strategy for OmniAuth 1.x}
- Exclude checks
Use %q
only for strings that contain both single quotes and double quotes. Open
spec.description = %q{A Box OAuth2 strategy for OmniAuth 1.x}
- Exclude checks
%q
-literals should be delimited by (
and )
. Open
spec.description = %q{A Box OAuth2 strategy for OmniAuth 1.x}
- Read upRead up
- Exclude checks
This cop enforces the consistent usage of %
-literal delimiters.
Specify the 'default' key to set all preferred delimiters at once. You can continue to specify individual preferred delimiters to override the default.
Example:
# Style/PercentLiteralDelimiters:
# PreferredDelimiters:
# default: '[]'
# '%i': '()'
# good
%w[alpha beta] + %i(gamma delta)
# bad
%W(alpha #{beta})
# bad
%I(alpha beta)
Trailing whitespace detected. Open
end
- Exclude checks
Unnecessary utf-8 encoding comment. Open
# coding: utf-8
- Exclude checks