Rubocop: Style/CaseIndentation enabled
This commit is contained in:
parent
da884aabc7
commit
368e9a0862
|
@ -96,7 +96,7 @@ Style/CaseEquality:
|
||||||
Style/CaseIndentation:
|
Style/CaseIndentation:
|
||||||
Description: 'Indentation of when in a case/when/[else/]end.'
|
Description: 'Indentation of when in a case/when/[else/]end.'
|
||||||
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#indent-when-to-case'
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#indent-when-to-case'
|
||||||
Enabled: false
|
Enabled: true
|
||||||
|
|
||||||
Style/CharacterLiteral:
|
Style/CharacterLiteral:
|
||||||
Description: 'Checks for uses of character literals.'
|
Description: 'Checks for uses of character literals.'
|
||||||
|
|
|
@ -7,7 +7,8 @@ class NotesFinder
|
||||||
# Default to 0 to remain compatible with old clients
|
# Default to 0 to remain compatible with old clients
|
||||||
last_fetched_at = Time.at(params.fetch(:last_fetched_at, 0).to_i)
|
last_fetched_at = Time.at(params.fetch(:last_fetched_at, 0).to_i)
|
||||||
|
|
||||||
notes = case target_type
|
notes =
|
||||||
|
case target_type
|
||||||
when "commit"
|
when "commit"
|
||||||
project.notes.for_commit_id(target_id).not_inline.fresh
|
project.notes.for_commit_id(target_id).not_inline.fresh
|
||||||
when "issue"
|
when "issue"
|
||||||
|
|
|
@ -47,16 +47,12 @@ module APIGuard
|
||||||
case validate_access_token(access_token, scopes)
|
case validate_access_token(access_token, scopes)
|
||||||
when Oauth2::AccessTokenValidationService::INSUFFICIENT_SCOPE
|
when Oauth2::AccessTokenValidationService::INSUFFICIENT_SCOPE
|
||||||
raise InsufficientScopeError.new(scopes)
|
raise InsufficientScopeError.new(scopes)
|
||||||
|
|
||||||
when Oauth2::AccessTokenValidationService::EXPIRED
|
when Oauth2::AccessTokenValidationService::EXPIRED
|
||||||
raise ExpiredError
|
raise ExpiredError
|
||||||
|
|
||||||
when Oauth2::AccessTokenValidationService::REVOKED
|
when Oauth2::AccessTokenValidationService::REVOKED
|
||||||
raise RevokedError
|
raise RevokedError
|
||||||
|
|
||||||
when Oauth2::AccessTokenValidationService::VALID
|
when Oauth2::AccessTokenValidationService::VALID
|
||||||
@current_user = User.find(access_token.resource_owner_id)
|
@current_user = User.find(access_token.resource_owner_id)
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -121,7 +117,8 @@ module APIGuard
|
||||||
|
|
||||||
def oauth2_bearer_token_error_handler
|
def oauth2_bearer_token_error_handler
|
||||||
Proc.new do |e|
|
Proc.new do |e|
|
||||||
response = case e
|
response =
|
||||||
|
case e
|
||||||
when MissingTokenError
|
when MissingTokenError
|
||||||
Rack::OAuth2::Server::Resource::Bearer::Unauthorized.new
|
Rack::OAuth2::Server::Resource::Bearer::Unauthorized.new
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue