From a70a226b9b6af950633fcc30b7d2b1fd40a9f1af Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Mon, 24 Apr 2023 12:11:11 +0200 Subject: [PATCH] switch to voxpupuli-rubocop --- .rubocop.yml | 18 +----- .rubocop_todo.yml | 69 +---------------------- Gemfile | 7 +-- test/fragment_validation_with_ref_test.rb | 2 +- test/uri_util_test.rb | 14 ++--- 5 files changed, 15 insertions(+), 95 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 54e8f31e..addd33c0 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,24 +1,10 @@ --- inherit_from: .rubocop_todo.yml +inherit_gem: + voxpupuli-rubocop: rubocop.yml require: - rubocop-rake - rubocop-rspec - rubocop-performance - rubocop-minitest - -AllCops: - TargetRubyVersion: 2.7 - NewCops: enable - -Style/TrailingCommaInHashLiteral: - Enabled: True - EnforcedStyleForMultiline: consistent_comma - -Style/TrailingCommaInArrayLiteral: - Enabled: True - EnforcedStyleForMultiline: consistent_comma - -Style/TrailingCommaInArguments: - Enabled: True - EnforcedStyleForMultiline: consistent_comma diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 00151004..b128017a 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,12 +1,12 @@ # This configuration was generated by # `rubocop --auto-gen-config` -# on 2023-02-18 18:13:01 UTC using RuboCop version 1.45.1. +# on 2023-04-24 10:10:02 UTC using RuboCop version 1.50.2. # 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 # versions of RuboCop, may require this file to be generated again. -# Offense count: 3 +# Offense count: 1 # This cop supports safe autocorrection (--autocorrect). # Configuration parameters: TreatCommentsAsGroupSeparators, ConsiderPunctuation, Include. # Include: **/*.gemfile, **/Gemfile, **/gems.rb @@ -14,22 +14,6 @@ Bundler/OrderedGems: Exclude: - 'Gemfile' -# Offense count: 3 -# Configuration parameters: EnforcedStyle, AllowedGems, Include. -# SupportedStyles: Gemfile, gems.rb, gemspec -# Include: **/*.gemspec, **/Gemfile, **/gems.rb -Gemspec/DevelopmentDependencies: - Exclude: - - 'json-schema.gemspec' - -# Offense count: 1 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: Severity, Include. -# Include: **/*.gemspec -Gemspec/RequireMFA: - Exclude: - - 'json-schema.gemspec' - # Offense count: 1 # This cop supports safe autocorrection (--autocorrect). # Configuration parameters: EnforcedStyle. @@ -135,47 +119,6 @@ Lint/UnusedBlockArgument: Lint/UnusedMethodArgument: Enabled: false -# Offense count: 52 -# Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes. -Metrics/AbcSize: - Max: 60 - -# Offense count: 2 -# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns, inherit_mode. -# AllowedMethods: refine -Metrics/BlockLength: - Max: 37 - -# Offense count: 6 -# Configuration parameters: CountBlocks. -Metrics/BlockNesting: - Max: 4 - -# Offense count: 9 -# Configuration parameters: CountComments, CountAsOne. -Metrics/ClassLength: - Max: 560 - -# Offense count: 17 -# Configuration parameters: AllowedMethods, AllowedPatterns. -Metrics/CyclomaticComplexity: - Max: 21 - -# Offense count: 145 -# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns. -Metrics/MethodLength: - Max: 73 - -# Offense count: 38 -# Configuration parameters: CountKeywordArgs, MaxOptionalParameters. -Metrics/ParameterLists: - Max: 8 - -# Offense count: 15 -# Configuration parameters: AllowedMethods, AllowedPatterns. -Metrics/PerceivedComplexity: - Max: 20 - # Offense count: 63 Minitest/MultipleAssertions: Max: 25 @@ -228,7 +171,7 @@ Naming/MethodParameterName: # Offense count: 18 # Configuration parameters: EnforcedStyle, CheckMethodNames, CheckSymbols, AllowedIdentifiers, AllowedPatterns. # SupportedStyles: snake_case, normalcase, non_integer -# AllowedIdentifiers: capture3, iso8601, rfc1123_date, rfc822, rfc2822, rfc3339 +# AllowedIdentifiers: capture3, iso8601, rfc1123_date, rfc822, rfc2822, rfc3339, x86_64 Naming/VariableNumber: Exclude: - 'test/all_of_ref_schema_test.rb' @@ -287,12 +230,6 @@ Style/Alias: Exclude: - 'lib/json-schema/util/uuid.rb' -# Offense count: 2 -# This cop supports unsafe autocorrection (--autocorrect-all). -Style/CaseLikeIf: - Exclude: - - 'lib/json-schema/validator.rb' - # Offense count: 23 Style/ClassVars: Exclude: diff --git a/Gemfile b/Gemfile index c2384f7c..1c31f350 100644 --- a/Gemfile +++ b/Gemfile @@ -11,10 +11,7 @@ group :coverage, optional: ENV['COVERAGE'] != 'yes' do gem 'simplecov-console', require: false end -group :tests do - gem 'rubocop', '~> 1.45.0' - gem 'rubocop-rspec', '~> 2.18.1' - gem 'rubocop-rake', '~> 0.6.0' - gem 'rubocop-performance', '~> 1.16.0' +group :development do + gem 'voxpupuli-rubocop', '~> 1.2' gem 'rubocop-minitest', '~> 0.27.0' end diff --git a/test/fragment_validation_with_ref_test.rb b/test/fragment_validation_with_ref_test.rb index 7d44c145..4e7ac571 100644 --- a/test/fragment_validation_with_ref_test.rb +++ b/test/fragment_validation_with_ref_test.rb @@ -64,6 +64,6 @@ def test_validation_of_fragment_with_array data = { 'content' => 'ohai', 'author' => 'Bob' } assert_valid(whole_schema_with_array, data, - fragment: '#/definitions/omg/links/0/schema',) + fragment: '#/definitions/omg/links/0/schema') end end diff --git a/test/uri_util_test.rb b/test/uri_util_test.rb index f93d7a3e..5dc8e615 100644 --- a/test/uri_util_test.rb +++ b/test/uri_util_test.rb @@ -15,7 +15,7 @@ def test_normalized_uri str = 'https://www.google.com/search' uri = Addressable::URI.new(scheme: 'https', host: 'www.google.com', - path: 'search',) + path: 'search') assert_equal uri, JSON::Util::URI.normalized_uri(str, '/home') end @@ -25,7 +25,7 @@ def test_normalized_uri_with_empty_fragment uri = Addressable::URI.new(scheme: 'https', host: 'www.google.com', path: 'search', - fragment: nil,) + fragment: nil) assert_equal uri, JSON::Util::URI.normalized_uri(str, '/home') end @@ -35,7 +35,7 @@ def test_normalized_uri_with_fragment uri = Addressable::URI.new(scheme: 'https', host: 'www.google.com', path: 'search', - fragment: 'foo',) + fragment: 'foo') assert_equal uri, JSON::Util::URI.normalized_uri(str, '/home') end @@ -44,7 +44,7 @@ def test_normalized_uri_for_absolute_path str = '/foo/bar.json' uri = Addressable::URI.new(scheme: 'file', host: '', - path: '/foo/bar.json',) + path: '/foo/bar.json') assert_equal uri, JSON::Util::URI.normalized_uri(str, '/home') end @@ -53,7 +53,7 @@ def test_normalized_uri_for_relative_path str = 'foo/bar.json' uri = Addressable::URI.new(scheme: 'file', host: '', - path: '/home/foo/bar.json',) + path: '/home/foo/bar.json') assert_equal uri, JSON::Util::URI.normalized_uri(str, '/home') end @@ -62,7 +62,7 @@ def test_normalized_uri_for_file_path_with_host str = 'file://localhost/foo/bar.json' uri = Addressable::URI.new(scheme: 'file', host: 'localhost', - path: '/foo/bar.json',) + path: '/foo/bar.json') assert_equal uri, JSON::Util::URI.normalized_uri(str, '/home') end @@ -71,7 +71,7 @@ def test_uri_parse str = 'https://www.google.com/search' uri = Addressable::URI.new(scheme: 'https', host: 'www.google.com', - path: 'search',) + path: 'search') assert_equal uri, JSON::Util::URI.parse(str) end