Skip to content

Commit e4a667f

Browse files
Merge pull request #251 from ruby-ldap/enable-rubocop-in-ci
Enable rubocop in ci
2 parents 798d3e6 + 89f8d75 commit e4a667f

File tree

4 files changed

+10
-26
lines changed

4 files changed

+10
-26
lines changed

.rubocop.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ AllCops:
44
Exclude:
55
- 'pkg/**/*'
66

7-
Style/ExtraSpacing:
7+
Layout/ExtraSpacing:
88
Enabled: false
99

1010
Lint/AssignmentInCondition:

.rubocop_todo.yml

+7-23
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# This configuration was generated by
22
# `rubocop --auto-gen-config`
3-
# on 2020-01-31 16:17:37 +0100 using RuboCop version 0.49.1.
3+
# on 2020-07-12 00:41:11 -0400 using RuboCop version 0.49.1.
44
# The point is for the user to remove these configuration records
55
# one by one as the offenses are removed from the code base.
66
# Note that changes in the inspected code, or installation of new
@@ -131,14 +131,6 @@ Layout/SpaceInsideBlockBraces:
131131
Exclude:
132132
- 'lib/net/ldap/dataset.rb'
133133

134-
# Offense count: 1
135-
# Cop supports --auto-correct.
136-
# Configuration parameters: SupportedStyles, EnforcedStyleForEmptyBraces, SupportedStylesForEmptyBraces.
137-
# SupportedStyles: space, no_space, compact
138-
# SupportedStylesForEmptyBraces: space, no_space
139-
Layout/SpaceInsideHashLiteralBraces:
140-
EnforcedStyle: space
141-
142134
# Offense count: 8
143135
# Cop supports --auto-correct.
144136
Layout/SpaceInsideParens:
@@ -179,11 +171,6 @@ Lint/RescueException:
179171
Exclude:
180172
- 'lib/net/ldap/pdu.rb'
181173

182-
# Offense count: 1
183-
Lint/ShadowingOuterLocalVariable:
184-
Exclude:
185-
- 'lib/net/ldap/instrumentation.rb'
186-
187174
# Offense count: 9
188175
# Cop supports --auto-correct.
189176
# Configuration parameters: IgnoreEmptyBlocks, AllowUnusedKeywordArguments.
@@ -209,17 +196,15 @@ Lint/UselessAccessModifier:
209196
Exclude:
210197
- 'lib/net/ldap/connection.rb'
211198

212-
# Offense count: 8
199+
# Offense count: 6
213200
Lint/UselessAssignment:
214201
Exclude:
215-
- 'lib/net/ldap/connection.rb'
216-
- 'lib/net/ldap/password.rb'
217202
- 'test/integration/test_add.rb'
218203
- 'test/test_ldap_connection.rb'
219204
- 'test/test_search.rb'
220205
- 'test/test_snmp.rb'
221206

222-
# Offense count: 49
207+
# Offense count: 48
223208
Metrics/AbcSize:
224209
Max: 116
225210

@@ -242,7 +227,7 @@ Metrics/ClassLength:
242227
Metrics/CyclomaticComplexity:
243228
Max: 41
244229

245-
# Offense count: 215
230+
# Offense count: 216
246231
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
247232
# URISchemes: http, https
248233
Metrics/LineLength:
@@ -611,15 +596,14 @@ Style/RedundantParentheses:
611596
- 'lib/net/ldap/filter.rb'
612597
- 'test/test_filter.rb'
613598

614-
# Offense count: 4
599+
# Offense count: 3
615600
# Cop supports --auto-correct.
616601
# Configuration parameters: AllowMultipleReturnValues.
617602
Style/RedundantReturn:
618603
Exclude:
619604
- 'lib/net/ber/core_ext/string.rb'
620605
- 'lib/net/ldap/auth_adapter.rb'
621606
- 'lib/net/ldap/entry.rb'
622-
- 'lib/net/ldap/password.rb'
623607

624608
# Offense count: 8
625609
# Cop supports --auto-correct.
@@ -664,7 +648,7 @@ Style/SpecialGlobalVars:
664648
- 'net-ldap.gemspec'
665649
- 'testserver/ldapserver.rb'
666650

667-
# Offense count: 649
651+
# Offense count: 656
668652
# Cop supports --auto-correct.
669653
# Configuration parameters: EnforcedStyle, SupportedStyles, ConsistentQuotesInMultiline.
670654
# SupportedStyles: single_quotes, double_quotes
@@ -676,7 +660,7 @@ Style/StructInheritance:
676660
Exclude:
677661
- 'test/test_ldap.rb'
678662

679-
# Offense count: 10
663+
# Offense count: 11
680664
# Cop supports --auto-correct.
681665
# Configuration parameters: MinSize, SupportedStyles.
682666
# SupportedStyles: percent, brackets

Rakefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Rake::TestTask.new do |t|
1515
end
1616

1717
desc 'Run tests and RuboCop (RuboCop runs on mri only)'
18-
task ci: [:test]
18+
task ci: Bundler.current_ruby.mri? ? [:test, :rubocop] : [:test]
1919

2020
desc 'Run tests and RuboCop'
2121
task rubotest: [:test, :rubocop]

lib/net/ldap/dataset.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ def gets
103103
# with the conversion of
104104
def from_entry(entry)
105105
dataset = Net::LDAP::Dataset.new
106-
hash = { }
106+
hash = {}
107107
entry.each_attribute do |attribute, value|
108108
next if attribute == :dn
109109
hash[attribute] = value

0 commit comments

Comments
 (0)