Skip to content

Commit

Permalink
switch to voxpupuli-rubocop
Browse files Browse the repository at this point in the history
  • Loading branch information
bastelfreak committed Jul 12, 2024
1 parent 640a4c6 commit a75665f
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 95 deletions.
18 changes: 2 additions & 16 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -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
69 changes: 3 additions & 66 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,19 @@
# 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
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.
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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'
Expand Down Expand Up @@ -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:
Expand Down
7 changes: 2 additions & 5 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,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
2 changes: 1 addition & 1 deletion test/fragment_validation_with_ref_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
14 changes: 7 additions & 7 deletions test/uri_util_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit a75665f

Please sign in to comment.