Skip to content

Commit 0906a9b

Browse files
author
Ignacio Jonas
committed
Configure rubocop
1 parent c3622d6 commit 0906a9b

File tree

5 files changed

+85
-11
lines changed

5 files changed

+85
-11
lines changed

.rubocop.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
inherit_from: .rubocop_todo.yml
2+
3+
AllCops:
4+
RunRailsCops: true
5+
Exclude:
6+
- bin/**/*
7+
- vendor/**/*
8+
9+
Style/DoubleNegation:
10+
Enabled: false
11+
12+
Style/SpaceInsideBrackets:
13+
Enabled: false
14+
15+
Style/Documentation:
16+
Enabled: false
17+
18+
Rails/ActionFilter:
19+
Enabled: false
20+
21+
Rails/Delegate:
22+
Enabled: false
23+
24+
Lint/UnderscorePrefixedVariableName:
25+
Enabled: false
26+
27+
Lint/Loop:
28+
Enabled: false
29+
30+
Lint/HandleExceptions:
31+
Enabled: false
32+
33+
Style/EachWithObject:
34+
Enabled: false

.rubocop_todo.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# This configuration was generated by
2+
# `rubocop --auto-gen-config`
3+
# on 2015-11-30 16:33:07 -0300 using RuboCop version 0.35.0.
4+
# The point is for the user to remove these configuration records
5+
# one by one as the offenses are removed from the code base.
6+
# Note that changes in the inspected code, or installation of new
7+
# versions of RuboCop, may require this file to be generated again.
8+
9+
# Offense count: 1
10+
Metrics/AbcSize:
11+
Max: 30
12+
13+
# Offense count: 254
14+
# Configuration parameters: AllowURI, URISchemes.
15+
Metrics/LineLength:
16+
Max: 626
17+
18+
# Offense count: 3
19+
# Configuration parameters: CountComments.
20+
Metrics/MethodLength:
21+
Max: 20
22+
23+
# Offense count: 1
24+
# Configuration parameters: CountComments.
25+
Metrics/ModuleLength:
26+
Max: 110
27+
28+
# Offense count: 9
29+
# Cop supports --auto-correct.
30+
# Configuration parameters: EnforcedStyle, SupportedStyles.
31+
Style/BracesAroundHashParameters:
32+
Enabled: false
33+
# Offense count: 13
34+
# Configuration parameters: EnforcedStyle, SupportedStyles.
35+
Style/ClassAndModuleChildren:
36+
Enabled: false
37+
38+
# Offense count: 1
39+
Style/StructInheritance:
40+
Enabled: false

lib/auth0/api/v2/users.rb

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ module V2
44
# https://auth0.com/docs/apiv2#!/users
55
module Users
66
# https://auth0.com/docs/apiv2#!/users/get_users
7-
def users(per_page: nil, page: nil, include_totals: nil, sort: nil, connection: nil, fields: nil, q: nil)
7+
def users(options = {})
88
request_params = {
9-
per_page: per_page,
10-
page: page,
11-
include_totals: include_totals,
12-
sort: sort,
13-
connection: connection,
14-
fields: fields,
15-
q: q
9+
per_page: options.fetch(:per_page, nil),
10+
page: options.fetch(:page, nil),
11+
include_totals: options.fetch(:include_totals, nil),
12+
sort: options.fetch(:sort, nil),
13+
connection: options.fetch(:connection, nil),
14+
fields: options.fetch(:fields, nil),
15+
q: options.fetch(:q, nil)
1616
}
1717

1818
request_params[:search_engine] = :v2 if request_params[:q]

lib/auth0/mixins/initializer.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,13 @@ def initialize_v1(options)
6060
end
6161

6262
def api_v2?(options)
63-
options[:protocols].to_s.include?('v2') || options[:api_version] === 2
63+
options[:protocols].to_s.include?('v2') || options[:api_version] == 2
6464
end
6565

6666
def api_v1?(options)
6767
version = options[:api_version] || 1
6868
protocol = options[:protocols].to_s
69-
!protocol.include?('v2') && (protocol.include?('v1') || version === 1)
69+
!protocol.include?('v2') && (protocol.include?('v1') || version == 1)
7070
end
7171
end
7272
end

spec/spec_helper_full.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def entity_suffix
3535
v2_client = Auth0Client.new({ token: ENV['MASTER_JWT'], api_version: 2, domain: ENV['DOMAIN'] })
3636
v2_client
3737
.clients
38-
.select { |client| client['name'] != 'DefaultApp' and not client['global'] and client['name'].include? entity_suffix }
38+
.select { |client| client['name'] != 'DefaultApp' && !client['global'] && client['name'].include?(entity_suffix) }
3939
.each { |client| v2_client.delete_client(client['client_id']) }
4040
v2_client
4141
.users

0 commit comments

Comments
 (0)