Skip to content

Commit

Permalink
chore: rubocop
Browse files Browse the repository at this point in the history
  • Loading branch information
ronaldtse committed Jan 11, 2025
1 parent fb2ac83 commit bae8154
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 90 deletions.
81 changes: 3 additions & 78 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 2025-01-02 11:31:42 UTC using RuboCop version 1.69.2.
# on 2025-01-11 04:48:38 UTC using RuboCop version 1.70.0.
# 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 @@ -13,33 +13,6 @@ Gemspec/DuplicatedAssignment:
Exclude:
- 'unitsdb.gemspec'

# Offense count: 14
# This cop supports safe autocorrection (--autocorrect).
Layout/EmptyLineAfterMagicComment:
Exclude:
- 'lib/unitsdb/dimension.rb'
- 'lib/unitsdb/dimension_symbol.rb'
- 'lib/unitsdb/prefix.rb'
- 'lib/unitsdb/prefix_symbol.rb'
- 'lib/unitsdb/quantity.rb'
- 'lib/unitsdb/root_unit.rb'
- 'lib/unitsdb/root_units.rb'
- 'lib/unitsdb/si_derived_base.rb'
- 'lib/unitsdb/symbol.rb'
- 'lib/unitsdb/unit.rb'
- 'lib/unitsdb/unit_symbol.rb'
- 'lib/unitsdb/unit_system.rb'
- 'lib/unitsdb/unit_systems.rb'
- 'lib/unitsdb/units.rb'

# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle.
# SupportedStyles: empty_lines, empty_lines_except_namespace, empty_lines_special, no_empty_lines, beginning_only, ending_only
Layout/EmptyLinesAroundClassBody:
Exclude:
- 'lib/unitsdb/unit_systems.rb'

# Offense count: 2
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle, IndentationWidth.
Expand All @@ -48,58 +21,10 @@ Layout/FirstHashElementIndentation:
Exclude:
- 'lib/unitsdb/units.rb'

# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: AutoCorrect.
Lint/UselessAssignment:
Exclude:
- 'spec/unitsdb/unit_spec.rb'

# Offense count: 1
# This cop supports unsafe autocorrection (--autocorrect-all).
Security/YAMLLoad:
Exclude:
- 'spec/unitsdb/unit_spec.rb'

# Offense count: 13
# Offense count: 19
# Configuration parameters: AllowedConstants.
Style/Documentation:
Exclude:
- 'spec/**/*'
- 'test/**/*'
- 'lib/unitsdb/dimension.rb'
- 'lib/unitsdb/dimension_symbol.rb'
- 'lib/unitsdb/prefix.rb'
- 'lib/unitsdb/quantity.rb'
- 'lib/unitsdb/root_unit.rb'
- 'lib/unitsdb/root_units.rb'
- 'lib/unitsdb/si_derived_base.rb'
- 'lib/unitsdb/symbol.rb'
- 'lib/unitsdb/unit.rb'
- 'lib/unitsdb/unit_symbol.rb'
- 'lib/unitsdb/unit_system.rb'
- 'lib/unitsdb/units.rb'

# Offense count: 14
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: EnforcedStyle.
# SupportedStyles: always, always_true, never
Style/FrozenStringLiteralComment:
Exclude:
- 'lib/unitsdb/dimension.rb'
- 'lib/unitsdb/dimension_symbol.rb'
- 'lib/unitsdb/prefix.rb'
- 'lib/unitsdb/prefix_symbol.rb'
- 'lib/unitsdb/quantity.rb'
- 'lib/unitsdb/root_unit.rb'
- 'lib/unitsdb/root_units.rb'
- 'lib/unitsdb/si_derived_base.rb'
- 'lib/unitsdb/symbol.rb'
- 'lib/unitsdb/unit.rb'
- 'lib/unitsdb/unit_symbol.rb'
- 'lib/unitsdb/unit_system.rb'
- 'lib/unitsdb/unit_systems.rb'
- 'lib/unitsdb/units.rb'
Enabled: false

# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ source "https://rubygems.org"
# Specify your gem's dependencies in suma.gemspec
gemspec

gem "diffy"
gem "rake", "~> 13.0"
gem "rspec", "~> 3.0"
gem "rubocop"
gem "rubocop-performance"
gem "diffy"
4 changes: 2 additions & 2 deletions lib/unitsdb/dimensions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ class Dimensions < Lutaml::Model::Serializable

key_value do
map to: :dimension, root_mappings: {
id: :key,
}
id: :key
}
end
end
end
4 changes: 2 additions & 2 deletions lib/unitsdb/prefixes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ class Prefixes < Lutaml::Model::Serializable

key_value do
map to: :prefix, root_mappings: {
id: :key,
}
id: :key
}
end
end
end
4 changes: 2 additions & 2 deletions lib/unitsdb/quantities.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ class Quantities < Lutaml::Model::Serializable

key_value do
map to: :quantity, root_mappings: {
id: :key,
}
id: :key
}
end
end
end
2 changes: 1 addition & 1 deletion lib/unitsdb/unit_systems.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class UnitSystems < Lutaml::Model::Serializable

key_value do
map to: :unit_system, root_mappings: {
id: :key,
id: :key
}
end
end
Expand Down
8 changes: 4 additions & 4 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ def sort_yaml_keys(obj)
end
end

failure_message do |actual|
failure_message do |_actual|
diff = Diffy::Diff.new(@expected_sorted, @actual_sorted,
include_diff_info: false,
include_plus_and_minus_in_html: true,
diff_options: "-u")

"expected YAML to be equivalent\n\n" +
"Diff:\n" +
diff.to_s(:color)
"expected YAML to be equivalent\n\n" \
"Diff:\n" +
diff.to_s(:color)
end
end

0 comments on commit bae8154

Please sign in to comment.