Skip to content

Commit

Permalink
re-run rubocop
Browse files Browse the repository at this point in the history
  • Loading branch information
dunn committed Oct 30, 2023
1 parent 6462964 commit 8abf0d7
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 92 deletions.
98 changes: 8 additions & 90 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,73 +6,13 @@
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.

# Offense count: 2
# This cop supports safe auto-correction (--auto-correct).
# Configuration parameters: EmptyLineBetweenMethodDefs, EmptyLineBetweenClassDefs, EmptyLineBetweenModuleDefs, AllowAdjacentOneLineDefs, NumberOfEmptyLines.
Layout/EmptyLineBetweenDefs:
Exclude:
- 'app/jobs/bulkrax/import_file_set_job.rb'
- 'app/models/bulkrax/entry.rb'

# Offense count: 2
# This cop supports safe auto-correction (--auto-correct).
# Configuration parameters: EnforcedStyle.
# SupportedStyles: empty_lines, no_empty_lines
Layout/EmptyLinesAroundBlockBody:
Exclude:
- 'spec/rails_helper.rb'

# Offense count: 3
# This cop supports safe auto-correction (--auto-correct).
# Configuration parameters: AllowMultipleStyles, EnforcedHashRocketStyle, EnforcedColonStyle, EnforcedLastArgumentHashStyle.
# SupportedHashRocketStyles: key, separator, table
# SupportedColonStyles: key, separator, table
# SupportedLastArgumentHashStyles: always_inspect, always_ignore, ignore_implicit, ignore_explicit
Layout/HashAlignment:
Exclude:
- 'app/parsers/bulkrax/csv_parser.rb'
- 'spec/models/bulkrax/rdf_entry_spec.rb'
- 'spec/models/bulkrax/xml_entry_spec.rb'

# Offense count: 1
# This cop supports safe auto-correction (--auto-correct).
# Configuration parameters: Width, AllowedPatterns, IgnoredPatterns.
Layout/IndentationWidth:
Exclude:
- 'spec/rails_helper.rb'

# Offense count: 8
# Offense count: 5
# This cop supports safe auto-correction (--auto-correct).
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns, IgnoredPatterns.
# URISchemes: http, https
Layout/LineLength:
Max: 301

# Offense count: 1
# This cop supports safe auto-correction (--auto-correct).
# Configuration parameters: EnforcedStyle.
# SupportedStyles: symmetrical, new_line, same_line
Layout/MultilineMethodCallBraceLayout:
Exclude:
- 'app/parsers/bulkrax/csv_parser.rb'

# Offense count: 1
# This cop supports safe auto-correction (--auto-correct).
Layout/RescueEnsureAlignment:
Exclude:
- 'spec/rails_helper.rb'

# Offense count: 7
# This cop supports safe auto-correction (--auto-correct).
# Configuration parameters: AllowInHeredoc.
Layout/TrailingWhitespace:
Exclude:
- 'app/models/bulkrax/csv_entry.rb'
- 'app/parsers/bulkrax/csv_parser.rb'
- 'spec/models/bulkrax/rdf_entry_spec.rb'
- 'spec/models/bulkrax/xml_entry_spec.rb'
- 'spec/rails_helper.rb'

# Offense count: 16
# Configuration parameters: IgnoredMethods, CountRepeatedAttributes.
Metrics/AbcSize:
Expand All @@ -81,24 +21,24 @@ Metrics/AbcSize:
# Offense count: 4
# Configuration parameters: CountComments, CountAsOne.
Metrics/ClassLength:
Max: 201
Max: 140

# Offense count: 13
# Offense count: 12
# Configuration parameters: IgnoredMethods.
Metrics/CyclomaticComplexity:
Max: 19

# Offense count: 32
# Offense count: 28
# Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods.
Metrics/MethodLength:
Max: 26

# Offense count: 2
# Configuration parameters: CountComments, CountAsOne.
Metrics/ModuleLength:
Max: 131
Max: 130

# Offense count: 9
# Offense count: 10
# Configuration parameters: IgnoredMethods.
Metrics/PerceivedComplexity:
Max: 19
Expand All @@ -110,30 +50,8 @@ Rails/HasManyOrHasOneDependent:
Exclude:
- 'app/models/concerns/bulkrax/status_info.rb'

# Offense count: 2
# This cop supports safe auto-correction (--auto-correct).
# Configuration parameters: Keywords, RequireColon.
# Keywords: TODO, FIXME, OPTIMIZE, HACK, REVIEW, NOTE
Style/CommentAnnotation:
Exclude:
- 'app/models/bulkrax/xml_entry.rb'
- 'spec/models/bulkrax/oai_entry_spec.rb'

# Offense count: 2
# This cop supports safe auto-correction (--auto-correct).
Style/IfUnlessModifier:
Exclude:
- 'app/models/bulkrax/csv_entry.rb'
- 'lib/generators/bulkrax/templates/config/initializers/bulkrax.rb'

# Offense count: 1
# This cop supports safe auto-correction (--auto-correct).
Style/MultilineIfModifier:
# Configuration parameters: MinBodyLength, AllowConsecutiveConditionals.
Style/GuardClause:
Exclude:
- 'app/models/bulkrax/csv_entry.rb'

# Offense count: 1
# This cop supports safe auto-correction (--auto-correct).
Style/RedundantBegin:
Exclude:
- 'spec/rails_helper.rb'
6 changes: 4 additions & 2 deletions app/models/bulkrax/csv_entry.rb
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,10 @@ def build_metadata

def validate_record
raise StandardError, 'Record not found' if record.nil?
raise StandardError, "Missing required elements, missing element(s) are: "\
"#{importerexporter.parser.missing_elements(record).join(', ')}" unless importerexporter.parser.required_elements?(record)
unless importerexporter.parser.required_elements?(record)
raise StandardError, "Missing required elements, missing element(s) are: "\
"#{importerexporter.parser.missing_elements(record).join(', ')}"
end
end

def add_identifier
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
end

# Sidebar for hyrax 3+ support
# rubocop:disable Style/IfUnlessModifier
if Object.const_defined?(:Hyrax) && ::Hyrax::DashboardController&.respond_to?(:sidebar_partials)
Hyrax::DashboardController.sidebar_partials[:repository_content] << "hyrax/dashboard/sidebar/bulkrax_sidebar_additions"
end

0 comments on commit 8abf0d7

Please sign in to comment.