Skip to content

Commit

Permalink
chore: rubocop
Browse files Browse the repository at this point in the history
  • Loading branch information
ronaldtse committed Sep 11, 2024
1 parent 5926c1e commit b5c7396
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 19 deletions.
46 changes: 41 additions & 5 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,36 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2024-08-16 10:48:03 UTC using RuboCop version 1.65.1.
# on 2024-09-11 00:07:51 UTC using RuboCop version 1.66.1.
# 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: 4
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: TreatCommentsAsGroupSeparators, ConsiderPunctuation, Include.
# Include: **/*.gemfile, **/Gemfile, **/gems.rb
Bundler/OrderedGems:
Exclude:
- 'Gemfile'

# Offense count: 1
# Configuration parameters: Severity, Include.
# Include: **/*.gemspec
Gemspec/RequiredRubyVersion:
Exclude:
- 'modspec.gemspec'

# Offense count: 5
# Offense count: 10
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle, IndentationWidth.
# SupportedStyles: aligned, indented, indented_relative_to_receiver
Layout/MultilineMethodCallIndentation:
Exclude:
- 'modspec.gemspec'
- 'spec/modspec/suite_spec.rb'

# Offense count: 4
# Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes.
Metrics/AbcSize:
Max: 33
Expand All @@ -27,14 +44,14 @@ Metrics/BlockLength:
# Offense count: 1
# Configuration parameters: CountComments, CountAsOne.
Metrics/ClassLength:
Max: 207
Max: 204

# Offense count: 1
# Configuration parameters: AllowedMethods, AllowedPatterns.
Metrics/CyclomaticComplexity:
Max: 12

# Offense count: 6
# Offense count: 5
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
Metrics/MethodLength:
Max: 18
Expand Down Expand Up @@ -74,7 +91,26 @@ Style/IfUnlessModifier:
- 'lib/modspec/conformance_class.rb'
- 'lib/modspec/normative_statements_class.rb'

# Offense count: 12
# Offense count: 27
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyleForMultiline.
# SupportedStylesForMultiline: comma, consistent_comma, no_comma
Style/TrailingCommaInArguments:
Exclude:
- 'spec/modspec/conformance_class_spec.rb'
- 'spec/modspec/conformance_test_spec.rb'
- 'spec/modspec/normative_statement_spec.rb'
- 'spec/modspec/normative_statements_class_spec.rb'

# Offense count: 6
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyleForMultiline.
# SupportedStylesForMultiline: comma, consistent_comma, no_comma
Style/TrailingCommaInArrayLiteral:
Exclude:
- 'spec/modspec/conformance_class_spec.rb'

# Offense count: 13
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns.
# URISchemes: http, https
Expand Down
6 changes: 4 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,7 @@ source "https://rubygems.org"
# Specify your gem's dependencies in modspec.gemspec
gemspec

gem "rake", "~> 13.0"
gem "rspec", "~> 3.0"
gem "equivalent-xml"
gem "pry"
gem "rake"
gem "rspec"
4 changes: 1 addition & 3 deletions lib/modspec/conformance_class.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,7 @@ def validate_identifier_prefix
errors = []
expected_prefix = "#{identifier}/"
tests.each do |test|
unless test.identifier.to_s.start_with?(expected_prefix)
errors << "Conformance test #{test.identifier} does not share the expected prefix #{expected_prefix}"
end
errors << "Conformance test #{test.identifier} does not share the expected prefix #{expected_prefix}" unless test.identifier.to_s.start_with?(expected_prefix)
end
errors
end
Expand Down
4 changes: 1 addition & 3 deletions lib/modspec/normative_statements_class.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,7 @@ def validate_identifier_prefix
errors = []
expected_prefix = "#{identifier}/"
normative_statements.each do |statement|
unless statement.identifier.to_s.start_with?(expected_prefix)
errors << "Normative statement #{statement.identifier} does not share the expected prefix #{expected_prefix}"
end
errors << "Normative statement #{statement.identifier} does not share the expected prefix #{expected_prefix}" unless statement.identifier.to_s.start_with?(expected_prefix)
end
errors
end
Expand Down
7 changes: 1 addition & 6 deletions modspec.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Gem::Specification.new do |spec|

# Specify which files should be added to the gem when it is released.
spec.files = all_files_in_git
.reject { |f| f.match(%r{\A(?:test|spec|features|bin|\.)/}) }
.reject { |f| f.match(%r{\A(?:test|features|bin|\.)/}) }

spec.bindir = "exe"
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
Expand All @@ -32,9 +32,4 @@ Gem::Specification.new do |spec|
spec.add_dependency "lutaml-model", "~> 0.3.10"
spec.add_dependency "nokogiri"
spec.add_dependency "toml-rb"

spec.add_development_dependency "equivalent-xml", "~> 0.6"
spec.add_development_dependency "pry", "~> 0.14.0"
spec.add_development_dependency "rake", "~> 13.0"
spec.add_development_dependency "rspec", "~> 3.10"
end

0 comments on commit b5c7396

Please sign in to comment.