Skip to content

Commit

Permalink
Merge pull request #162 from OpenGeoMetadata/rubocop-fixes
Browse files Browse the repository at this point in the history
Reformat with rubocop
  • Loading branch information
dl-maura authored Sep 13, 2023
2 parents 00aaaf0 + a4ee1c7 commit 954af96
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 22 deletions.
35 changes: 16 additions & 19 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 2023-03-27 19:15:05 UTC using RuboCop version 1.48.1.
# on 2023-09-13 18:53:11 UTC using RuboCop version 1.56.3.
# 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 All @@ -12,6 +12,7 @@ Lint/RescueException:
- 'spec/helpers.rb'

# Offense count: 1
# This cop supports unsafe autocorrection (--autocorrect-all).
Lint/UselessAssignment:
Exclude:
- 'spec/helpers.rb'
Expand All @@ -32,17 +33,17 @@ Metrics/BlockLength:
Metrics/ClassLength:
Max: 152

# Offense count: 4
# Offense count: 5
# Configuration parameters: AllowedMethods, AllowedPatterns.
Metrics/CyclomaticComplexity:
Max: 11

# Offense count: 11
# Offense count: 13
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
Metrics/MethodLength:
Max: 21

# Offense count: 1
# Offense count: 2
# Configuration parameters: AllowedMethods, AllowedPatterns.
Metrics/PerceivedComplexity:
Max: 11
Expand All @@ -66,13 +67,6 @@ RSpec/ExpectInHook:
- 'spec/lib/geo_combine/geo_blacklight_harvester_spec.rb'
- 'spec/lib/geo_combine/geoblacklight_spec.rb'

# Offense count: 1
# Configuration parameters: Include, CustomTransform, IgnoreMethods, SpecSuffixOnly.
# Include: **/*_spec*rb*, **/spec/**/*
RSpec/FilePath:
Exclude:
- 'spec/lib/geo_combine_spec.rb'

# Offense count: 23
# Configuration parameters: EnforcedStyle.
# SupportedStyles: have_received, receive
Expand Down Expand Up @@ -110,16 +104,19 @@ RSpec/OverwritingSetup:
Exclude:
- 'spec/lib/geo_combine/geoblacklight_spec.rb'

# Offense count: 1
RSpec/PendingWithoutReason:
Exclude:
- 'spec/lib/geo_combine/migrators/v1_aardvark_migrator_spec.rb'

# Offense count: 2
RSpec/RepeatedExampleGroupBody:
Exclude:
- 'spec/lib/geo_combine/iso19139_spec.rb'

# Offense count: 1
# Configuration parameters: Include, CustomTransform, IgnoreMethods, IgnoreMetadata.
# Include: **/*_spec.rb
RSpec/SpecFilePathFormat:
Exclude:
- '**/spec/routing/**/*'
- 'spec/lib/geo_combine_spec.rb'

# Offense count: 19
RSpec/StubbedMock:
Exclude:
Expand All @@ -145,7 +142,7 @@ Security/Open:
Exclude:
- 'lib/geo_combine/geoblacklight.rb'

# Offense count: 7
# Offense count: 6
# Configuration parameters: AllowedConstants.
Style/Documentation:
Exclude:
Expand All @@ -158,9 +155,9 @@ Style/Documentation:
- 'lib/geo_combine/geometry_types.rb'
- 'lib/geo_combine/iso19139.rb'

# Offense count: 8
# Offense count: 12
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns.
# URISchemes: http, https
Layout/LineLength:
Max: 159
Max: 198
7 changes: 4 additions & 3 deletions lib/geo_combine/ckan_metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ def organization
def envelope
return envelope_from_bbox unless envelope_from_bbox.nil?
return envelope_from_spatial(',') unless envelope_from_spatial(',').nil?
return envelope_from_spatial(' ') unless envelope_from_spatial(' ').nil?

envelope_from_spatial(' ') unless envelope_from_spatial(' ').nil?
end

def envelope_from_bbox
Expand All @@ -55,7 +56,7 @@ def envelope_from_bbox
north: extras('bbox-north-lat')
)
begin
return bbox.to_envelope if bbox.valid?
bbox.to_envelope if bbox.valid?
rescue GeoCombine::Exceptions::InvalidGeometry
nil
end
Expand All @@ -67,7 +68,7 @@ def envelope_from_spatial(delimiter)
delimiter: delimiter
)
begin
return bbox.to_envelope if bbox.valid?
bbox.to_envelope if bbox.valid?
rescue GeoCombine::Exceptions::InvalidGeometry
nil
end
Expand Down

0 comments on commit 954af96

Please sign in to comment.