From b8f1ee19e7934678d9f701c6d46d327eea6d7557 Mon Sep 17 00:00:00 2001 From: Jerry Cheung Date: Mon, 11 Jan 2016 21:42:49 -0800 Subject: [PATCH 1/3] enable rubocop in ci --- Rakefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Rakefile b/Rakefile index 51ab55dc..da4cf8e7 100644 --- a/Rakefile +++ b/Rakefile @@ -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] From 09f9fe31b64b33343839e9ab382e455cee71baf3 Mon Sep 17 00:00:00 2001 From: Kevin McCormack Date: Sun, 12 Jul 2020 00:41:58 -0400 Subject: [PATCH 2/3] Update Rubocop configs --- .rubocop.yml | 2 +- .rubocop_todo.yml | 30 +++++++----------------------- 2 files changed, 8 insertions(+), 24 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 7bdfa631..9049058b 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -4,7 +4,7 @@ AllCops: Exclude: - 'pkg/**/*' -Style/ExtraSpacing: +Layout/ExtraSpacing: Enabled: false Lint/AssignmentInCondition: diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 46b0467a..315dc0c5 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -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 @@ -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: @@ -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. @@ -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 @@ -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: @@ -611,7 +596,7 @@ 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: @@ -619,7 +604,6 @@ Style/RedundantReturn: - '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. @@ -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 @@ -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 From 89f8d75410415dc76beef4eef63b9a6a28777601 Mon Sep 17 00:00:00 2001 From: Kevin McCormack Date: Sun, 12 Jul 2020 00:42:11 -0400 Subject: [PATCH 3/3] Rubocop fix --- lib/net/ldap/dataset.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/net/ldap/dataset.rb b/lib/net/ldap/dataset.rb index 9027ed28..5f28d189 100644 --- a/lib/net/ldap/dataset.rb +++ b/lib/net/ldap/dataset.rb @@ -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