Skip to content

Enable rubocop in ci #251

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jul 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ AllCops:
Exclude:
- 'pkg/**/*'

Style/ExtraSpacing:
Layout/ExtraSpacing:
Enabled: false

Lint/AssignmentInCondition:
Expand Down
30 changes: 7 additions & 23 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2020-01-31 16:17:37 +0100 using RuboCop version 0.49.1.
# on 2020-07-12 00:41:11 -0400 using RuboCop version 0.49.1.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
Expand Down Expand Up @@ -131,14 +131,6 @@ Layout/SpaceInsideBlockBraces:
Exclude:
- 'lib/net/ldap/dataset.rb'

# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: SupportedStyles, EnforcedStyleForEmptyBraces, SupportedStylesForEmptyBraces.
# SupportedStyles: space, no_space, compact
# SupportedStylesForEmptyBraces: space, no_space
Layout/SpaceInsideHashLiteralBraces:
EnforcedStyle: space

# Offense count: 8
# Cop supports --auto-correct.
Layout/SpaceInsideParens:
Expand Down Expand Up @@ -179,11 +171,6 @@ Lint/RescueException:
Exclude:
- 'lib/net/ldap/pdu.rb'

# Offense count: 1
Lint/ShadowingOuterLocalVariable:
Exclude:
- 'lib/net/ldap/instrumentation.rb'

# Offense count: 9
# Cop supports --auto-correct.
# Configuration parameters: IgnoreEmptyBlocks, AllowUnusedKeywordArguments.
Expand All @@ -209,17 +196,15 @@ Lint/UselessAccessModifier:
Exclude:
- 'lib/net/ldap/connection.rb'

# Offense count: 8
# Offense count: 6
Lint/UselessAssignment:
Exclude:
- 'lib/net/ldap/connection.rb'
- 'lib/net/ldap/password.rb'
- 'test/integration/test_add.rb'
- 'test/test_ldap_connection.rb'
- 'test/test_search.rb'
- 'test/test_snmp.rb'

# Offense count: 49
# Offense count: 48
Metrics/AbcSize:
Max: 116

Expand All @@ -242,7 +227,7 @@ Metrics/ClassLength:
Metrics/CyclomaticComplexity:
Max: 41

# Offense count: 215
# Offense count: 216
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
# URISchemes: http, https
Metrics/LineLength:
Expand Down Expand Up @@ -611,15 +596,14 @@ Style/RedundantParentheses:
- 'lib/net/ldap/filter.rb'
- 'test/test_filter.rb'

# Offense count: 4
# Offense count: 3
# Cop supports --auto-correct.
# Configuration parameters: AllowMultipleReturnValues.
Style/RedundantReturn:
Exclude:
- 'lib/net/ber/core_ext/string.rb'
- 'lib/net/ldap/auth_adapter.rb'
- 'lib/net/ldap/entry.rb'
- 'lib/net/ldap/password.rb'

# Offense count: 8
# Cop supports --auto-correct.
Expand Down Expand Up @@ -664,7 +648,7 @@ Style/SpecialGlobalVars:
- 'net-ldap.gemspec'
- 'testserver/ldapserver.rb'

# Offense count: 649
# Offense count: 656
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles, ConsistentQuotesInMultiline.
# SupportedStyles: single_quotes, double_quotes
Expand All @@ -676,7 +660,7 @@ Style/StructInheritance:
Exclude:
- 'test/test_ldap.rb'

# Offense count: 10
# Offense count: 11
# Cop supports --auto-correct.
# Configuration parameters: MinSize, SupportedStyles.
# SupportedStyles: percent, brackets
Expand Down
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Rake::TestTask.new do |t|
end

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

desc 'Run tests and RuboCop'
task rubotest: [:test, :rubocop]
Expand Down
2 changes: 1 addition & 1 deletion lib/net/ldap/dataset.rb
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def gets
# with the conversion of
def from_entry(entry)
dataset = Net::LDAP::Dataset.new
hash = { }
hash = {}
entry.each_attribute do |attribute, value|
next if attribute == :dn
hash[attribute] = value
Expand Down