Skip to content

Commit

Permalink
Merge pull request #108 from fhir-crucible/FI-2332-Bump-to-Ruby-3
Browse files Browse the repository at this point in the history
FI-2332 Bump Ruby to 3
  • Loading branch information
360dgries authored Dec 18, 2023
2 parents 77b31c9 + de17ea4 commit be9087e
Show file tree
Hide file tree
Showing 26 changed files with 230 additions and 242 deletions.
2 changes: 1 addition & 1 deletion .codeclimate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ engines:
enabled: true
rubocop:
enabled: true
channel: rubocop-0-80
channel: rubocop-1-23-0
ratings:
paths:
- "**.inc"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
ruby-version: ['2.7']
ruby-version: ['3.0', '3.1', '3.2']

steps:
- uses: actions/checkout@v2
Expand Down
6 changes: 5 additions & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
inherit_from: .rubocop_todo.yml
AllCops:
TargetRubyVersion: 2.4
TargetRubyVersion: 3.0
Exclude:
- 'test/**/*'
- 'spec/**/*'
Expand All @@ -12,6 +12,8 @@ AllCops:
- 'bin/*'
Layout/LineLength:
Enabled: false
Style/AccessorGrouping:
Enabled: false
Style/FrozenStringLiteralComment:
Enabled: false
Style/HashEachMethods:
Expand All @@ -20,6 +22,8 @@ Style/HashTransformKeys:
Enabled: true
Style/HashTransformValues:
Enabled: true
Style/WordArray:
EnforcedStyle: brackets
inherit_mode:
merge:
- Exclude
165 changes: 49 additions & 116 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,47 +1,19 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2021-03-30 16:14:38 -0400 using RuboCop version 0.80.0.
# on 2023-12-13 19:55:27 UTC using RuboCop version 1.23.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
# versions of RuboCop, may require this file to be generated again.

# Offense count: 51
# Cop supports --auto-correct.
Layout/EmptyLineAfterGuardClause:
Exclude:
- 'lib/fhir_models/bootstrap/definitions.rb'
- 'lib/fhir_models/bootstrap/generator.rb'
- 'lib/fhir_models/bootstrap/hashable.rb'
- 'lib/fhir_models/bootstrap/model.rb'
- 'lib/fhir_models/bootstrap/preprocess.rb'
- 'lib/fhir_models/bootstrap/xml.rb'
- 'lib/fhir_models/deprecate.rb'
- 'lib/fhir_models/fhir_ext/element_definition.rb'
- 'lib/fhir_models/fhir_ext/structure_definition.rb'
- 'lib/fhir_models/fhir_ext/structure_definition_compare.rb'
- 'lib/fhir_models/fhirpath/parse.rb'

# Offense count: 1
# Cop supports --auto-correct.
Layout/RescueEnsureAlignment:
Exclude:
- 'lib/fhir_models/bootstrap/hashable.rb'

# Offense count: 2
# Cop supports --auto-correct.
Lint/ToJSON:
Exclude:
- 'lib/fhir_models/bootstrap/json.rb'
- 'lib/fhir_models/fhir_ext/structure_definition_finding.rb'

# Offense count: 40
# Offense count: 38
# Configuration parameters: IgnoredMethods, CountRepeatedAttributes.
Metrics/AbcSize:
Max: 392
Max: 394

# Offense count: 7
# Configuration parameters: CountComments, ExcludedMethods.
# ExcludedMethods: refine
# Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods.
# IgnoredMethods: refine
Metrics/BlockLength:
Max: 78

Expand All @@ -51,65 +23,75 @@ Metrics/BlockNesting:
Max: 5

# Offense count: 7
# Configuration parameters: CountComments.
# Configuration parameters: CountComments, CountAsOne.
Metrics/ClassLength:
Max: 356
Max: 355

# Offense count: 23
# Offense count: 32
# Configuration parameters: IgnoredMethods.
Metrics/CyclomaticComplexity:
Max: 65
Max: 73

# Offense count: 44
# Configuration parameters: CountComments, ExcludedMethods.
# Offense count: 45
# Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods.
Metrics/MethodLength:
Max: 133
Max: 132

# Offense count: 2
# Configuration parameters: CountComments.
# Configuration parameters: CountComments, CountAsOne.
Metrics/ModuleLength:
Max: 114
Max: 115

# Offense count: 23
# Offense count: 28
# Configuration parameters: IgnoredMethods.
Metrics/PerceivedComplexity:
Max: 68
Max: 76

# Offense count: 5
# Configuration parameters: EnforcedStyle, IgnoredPatterns.
# SupportedStyles: snake_case, camelCase
Naming/MethodName:
Exclude:
- 'lib/fhir_models/fhir_ext/structure_definition_finding.rb'

# Offense count: 4
# Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames.
# AllowedNames: io, id, to, by, on, in, at, ip, db, os, pp
# AllowedNames: at, by, db, id, in, io, ip, of, on, os, pp, to
Naming/MethodParameterName:
Exclude:
- 'lib/fhir_models/fhir_ext/structure_definition_compare.rb'

# Offense count: 2
# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: PreferredName.
Naming/RescuedExceptionsVariableName:
# Configuration parameters: EnforcedStyle.
# SupportedStyles: nested, compact
Style/ClassAndModuleChildren:
Exclude:
- 'lib/fhir_models/bootstrap/hashable.rb'

# Offense count: 1
# Configuration parameters: .
# SupportedStyles: inline, group
Style/AccessModifierDeclarations:
EnforcedStyle: inline
- '.simplecov'

# Offense count: 17
Style/ClassVars:
Exclude:
- 'lib/fhir_models/bootstrap/definitions.rb'
- 'lib/fhir_models/fhirpath/parse.rb'

# Offense count: 1
Style/CombinableLoops:
Exclude:
- 'lib/fhir_models/fhir_ext/structure_definition_compare.rb'

# Offense count: 6
# Cop supports --auto-correct.
Style/CommentedKeyword:
Exclude:
- 'lib/fhir_models/bootstrap/hashable.rb'
- 'lib/fhir_models/bootstrap/model.rb'

# Offense count: 14
# Offense count: 15
# Configuration parameters: AllowedConstants.
Style/Documentation:
Exclude:
- 'spec/**/*'
- 'test/**/*'
- '.simplecov'
- 'lib/fhir_models/bootstrap/definitions.rb'
- 'lib/fhir_models/bootstrap/field.rb'
- 'lib/fhir_models/bootstrap/generator.rb'
Expand All @@ -136,71 +118,22 @@ Style/IfUnlessModifier:
- 'lib/fhir_models/fhir_ext/structure_definition.rb'
- 'lib/fhir_models/fhir_ext/structure_definition_compare.rb'

# Offense count: 1
Style/MethodMissingSuper:
Exclude:
- 'lib/fhir_models/bootstrap/model.rb'

# Offense count: 1
Style/MissingRespondToMissing:
Exclude:
- 'lib/fhir_models/bootstrap/model.rb'

# Offense count: 9
Style/MultipleComparison:
Exclude:
- 'lib/fhir_models/bootstrap/definitions.rb'
- 'lib/fhir_models/bootstrap/generator.rb'
- 'lib/fhir_models/bootstrap/model.rb'
- 'lib/fhir_models/fhir_ext/structure_definition.rb'

# Offense count: 2
# Cop supports --auto-correct.
# Configuration parameters: AutoCorrect, EnforcedStyle, IgnoredMethods.
# SupportedStyles: predicate, comparison
Style/NumericPredicate:
Exclude:
- 'spec/**/*'
- 'lib/fhir_models/fhir_ext/structure_definition_compare.rb'

# Offense count: 1
# Cop supports --auto-correct.
Style/OrAssignment:
# Configuration parameters: AllowedMethods.
# AllowedMethods: respond_to_missing?
Style/OptionalBooleanParameter:
Exclude:
- 'lib/fhir_models/bootstrap/generator.rb'
- 'lib/fhir_models/bootstrap/template.rb'

# Offense count: 16
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle.
# SupportedStyles: implicit, explicit
Style/RescueStandardError:
Exclude:
- 'lib/fhir_models/bootstrap/definitions.rb'
- 'lib/fhir_models/bootstrap/hashable.rb'
- 'lib/fhir_models/bootstrap/json.rb'
- 'lib/fhir_models/bootstrap/model.rb'
- 'lib/fhir_models/bootstrap/xml.rb'
- 'lib/fhir_models/fhir.rb'
- 'lib/fhir_models/fhir_ext/structure_definition.rb'
- 'lib/fhir_models/fhir_ext/structure_definition_finding.rb'
- 'lib/fhir_models/fhirpath/expression.rb'
- 'lib/fhir_models/fhirpath/parse.rb'

# Offense count: 4
# Cop supports --auto-correct.
# Configuration parameters: ConvertCodeThatCanStartToReturnNil, AllowedMethods.
# AllowedMethods: present?, blank?, presence, try, try!
Style/SafeNavigation:
Exclude:
- 'lib/fhir_models/bootstrap/definitions.rb'
- 'lib/fhir_models/bootstrap/xml.rb'
- 'lib/fhir_models/fhir_ext/structure_definition.rb'

# Offense count: 7
# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle.
# SupportedStyles: forbid_for_all_comparison_operators, forbid_for_equality_operators_only, require_for_all_comparison_operators, require_for_equality_operators_only
Style/YodaCondition:
# Configuration parameters: AllowModifier.
Style/SoleNestedConditional:
Exclude:
- 'lib/fhir_models/bootstrap/preprocess.rb'
- 'lib/fhir_models/fhirpath/parse.rb'
- 'lib/fhir_models/fhir_ext/structure_definition_compare.rb'
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.7.4
3.1.2
6 changes: 1 addition & 5 deletions .simplecov
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
require 'simplecov'
SimpleCov.command_name 'Unit Tests'
SimpleCov.start do
add_filter "test/"
add_group "Library", "lib"
end

class SimpleCov::Formatter::QualityFormatter
def format(result)
SimpleCov::Formatter::HTMLFormatter.new.format(result)
File.open("coverage/covered_percent", "w") do |f|
File.open('coverage/covered_percent', 'w') do |f|
f.puts result.source_files.covered_percent.to_f
end
end
Expand Down
2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ruby 2.7.4
ruby 3.1.2
32 changes: 18 additions & 14 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ GEM
test-unit (~> 3.0)
i18n (1.12.0)
concurrent-ruby (~> 1.0)
jaro_winkler (1.5.4)
json (2.3.1)
listen (3.3.1)
rb-fsevent (~> 0.10, >= 0.10.3)
Expand All @@ -62,22 +61,24 @@ GEM
notiffany (0.1.3)
nenv (~> 0.1)
shellany (~> 0.0)
parallel (1.20.1)
parser (3.0.0.0)
parallel (1.23.0)
parser (3.2.2.4)
ast (~> 2.4.1)
racc
power_assert (1.2.0)
pry (0.13.1)
pry (0.14.2)
coderay (~> 1.1)
method_source (~> 1.0)
pry-coolline (0.2.5)
coolline (~> 0.5)
racc (1.7.3)
rainbow (3.0.0)
rainbow (3.1.1)
rake (13.0.1)
rb-fsevent (0.10.4)
rb-inotify (0.10.1)
ffi (~> 1.0)
rexml (3.2.5)
regexp_parser (2.8.2)
rexml (3.2.6)
rspec (3.10.0)
rspec-core (~> 3.10.0)
rspec-expectations (~> 3.10.0)
Expand All @@ -91,15 +92,18 @@ GEM
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.10.0)
rspec-support (3.10.0)
rubocop (0.80.0)
jaro_winkler (~> 1.5.1)
rubocop (1.23.0)
parallel (~> 1.10)
parser (>= 2.7.0.1)
parser (>= 3.0.0.0)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml
rubocop-ast (>= 1.12.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 1.7)
ruby-progressbar (1.11.0)
unicode-display_width (>= 1.4.0, < 3.0)
rubocop-ast (1.30.0)
parser (>= 3.2.1.0)
ruby-progressbar (1.13.0)
shellany (0.0.1)
simplecov (0.17.1)
docile (~> 1.1)
Expand All @@ -110,7 +114,7 @@ GEM
test-unit (3.3.6)
power_assert
thor (1.0.1)
unicode-display_width (1.6.1)
unicode-display_width (2.5.0)
unicode_utils (1.4.0)

PLATFORMS
Expand All @@ -126,12 +130,12 @@ DEPENDENCIES
pry-coolline
rake
rspec
rubocop (= 0.80)
rubocop (= 1.23.0)
simplecov (~> 0.17.0)
test-unit

RUBY VERSION
ruby 2.7.4p191
ruby 3.1.2p20

BUNDLED WITH
2.2.21
2 changes: 1 addition & 1 deletion Guardfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#
# and, you'll have to watch "config/Guardfile" instead of "Guardfile"

# Note: The cmd option is now required due to the increasing number of ways
# NOTE: The cmd option is now required due to the increasing number of ways
# rspec may be run, below are examples of the most common uses.
# * bundler: 'bundle exec rspec'
# * bundler binstubs: 'bin/rspec'
Expand Down
Loading

0 comments on commit be9087e

Please sign in to comment.