Skip to content

Commit 1ae8b7c

Browse files
committed
Disabled rubocop check for double negation
1 parent 41afcfd commit 1ae8b7c

File tree

3 files changed

+11
-21
lines changed

3 files changed

+11
-21
lines changed

.rubocop.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,7 @@ AllCops:
33
- vendor/**/*
44
- bin/**/*
55

6+
Style/DoubleNegation:
7+
Enabled: false
8+
69
inherit_from: .rubocop_todo.yml

.rubocop_todo.yml

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,6 @@
66
# Note that changes in the inspected code, or installation of new
77
# versions of RuboCop, may require this file to be generated again.
88

9-
# Offense count: 1
10-
Lint/IneffectiveAccessModifier:
11-
Exclude:
12-
- 'lib/grape/router.rb'
13-
149
# Offense count: 39
1510
Metrics/AbcSize:
1611
Max: 44
@@ -66,14 +61,6 @@ Style/BlockDelimiters:
6661
Style/Documentation:
6762
Enabled: false
6863

69-
# Offense count: 6
70-
Style/DoubleNegation:
71-
Exclude:
72-
- 'lib/grape/api.rb'
73-
- 'lib/grape/middleware/versioner/accept_version_header.rb'
74-
- 'lib/grape/middleware/versioner/header.rb'
75-
- 'lib/grape/path.rb'
76-
7764
# Offense count: 14
7865
# Configuration parameters: EnforcedStyle, SupportedStyles.
7966
# SupportedStyles: compact, exploded

lib/grape/router.rb

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,14 @@ def initialize(pattern, attributes = {})
1111
end
1212
end
1313

14+
def self.normalize_path(path)
15+
path = "/#{path}"
16+
path.squeeze!('/')
17+
path.sub!(%r{/+\Z}, '')
18+
path = '/' if path == ''
19+
path
20+
end
21+
1422
def initialize
1523
@neutral_map = []
1624
@map = Hash.new { |hash, key| hash[key] = [] }
@@ -149,13 +157,5 @@ def routes_for(method)
149157
def string_for(input)
150158
self.class.normalize_path(input)
151159
end
152-
153-
def self.normalize_path(path)
154-
path = "/#{path}"
155-
path.squeeze!('/')
156-
path.sub!(%r{/+\Z}, '')
157-
path = '/' if path == ''
158-
path
159-
end
160160
end
161161
end

0 commit comments

Comments
 (0)