Skip to content

Commit

Permalink
Merge pull request #130 from sul-dlss/rubocop
Browse files Browse the repository at this point in the history
Upgrade to latest version of rubocop
  • Loading branch information
justinlittman authored Jul 7, 2020
2 parents 0b742f7 + a0d67dd commit 90ec82b
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 8 deletions.
55 changes: 53 additions & 2 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ inherit_from: .rubocop_todo.yml
require:
- rubocop-rspec

Metrics/LineLength:
Layout/LineLength:
Max: 114
Exclude:
- lib/cocina/models/*
Expand All @@ -26,7 +26,58 @@ RSpec/ExampleLength:
- spec/cocina/models/description_spec.rb
- spec/cocina/models/dro_shared_examples.rb


Style/Documentation:
Exclude:
- lib/cocina/models/*

Layout/EmptyLinesAroundAttributeAccessor:
Enabled: true

Layout/SpaceAroundMethodCallOperator:
Enabled: true

Lint/DeprecatedOpenSSLConstant:
Enabled: true

Lint/MixedRegexpCaptureTypes:
Enabled: true

Lint/RaiseException:
Enabled: true

Lint/StructNewOverride:
Enabled: true

Style/AccessorGrouping:
Enabled: true

Style/BisectedAttrAccessor:
Enabled: true

Style/ExponentialNotation:
Enabled: true

Style/HashEachMethods:
Enabled: true

Style/HashTransformKeys:
Enabled: true

Style/HashTransformValues:
Enabled: true

Style/RedundantAssignment:
Enabled: true

Style/RedundantFetchBlock:
Enabled: true

Style/RedundantRegexpCharacterClass:
Enabled: true

Style/RedundantRegexpEscape:
Enabled: true

Style/SlicingWithRange:
Enabled: true

2 changes: 1 addition & 1 deletion cocina-models.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Gem::Specification.new do |spec|
spec.add_development_dependency 'committee'
spec.add_development_dependency 'rake', '~> 13.0'
spec.add_development_dependency 'rspec', '~> 3.0'
spec.add_development_dependency 'rubocop', '~> 0.74.0'
spec.add_development_dependency 'rubocop', '~> 0.87'
spec.add_development_dependency 'rubocop-rspec'
spec.add_development_dependency 'simplecov', '~> 0.17.0'
end
2 changes: 1 addition & 1 deletion lib/cocina/generator/generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def self.source_root
def generate
clean_output

schemas.keys.each do |schema_name|
schemas.each_key do |schema_name|
schema = schema_for(schema_name)
generate_for(schema) if schema
end
Expand Down
4 changes: 2 additions & 2 deletions lib/cocina/generator/schema_value.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ module Cocina
module Generator
# Class for generating from an openapi value
class SchemaValue < SchemaBase
# rubocop:disable Metrics/LineLength
# rubocop:disable Layout/LineLength
def generate
"#{description}#{example}attribute :#{name.camelize(:lower)}, Types::#{dry_datatype(schema_doc)}#{default}#{enum}#{omittable}"
end
# rubocop:enable Metrics/LineLength
# rubocop:enable Layout/LineLength

private

Expand Down
3 changes: 1 addition & 2 deletions lib/cocina/models.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

# Help Zeitwerk find some of our classes
class CocinaModelsInflector < Zeitwerk::Inflector
# rubocop:disable Metrics/CyclomaticComplexity
# rubocop:disable Metrics/MethodLength
def camelize(basename, _abspath)
case basename
Expand All @@ -34,7 +33,7 @@ def camelize(basename, _abspath)
super
end
end
# rubocop:enable Metrics/CyclomaticComplexity

# rubocop:enable Metrics/MethodLength
end

Expand Down

0 comments on commit 90ec82b

Please sign in to comment.