diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index 8eda42633..e96997e47 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - ruby-version: ['2.6', '2.7'] + ruby-version: ['3.0', '3.1', '3.2'] steps: - uses: actions/checkout@v2 @@ -19,7 +19,10 @@ jobs: uses: ruby/setup-ruby@v1 with: ruby-version: ${{ matrix.ruby-version }} - bundler-cache: true # runs 'bundle install' and caches installed gems automatically + - name: Set frozen config to false + run: bundle config set --local frozen false + - name: Install Dependencies + run: bundle install - name: Run tests run: bundle exec rake - name: Rubocop diff --git a/.rubocop.yml b/.rubocop.yml index 2751180fb..299df42e1 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,6 +1,6 @@ inherit_from: .rubocop_todo.yml AllCops: - TargetRubyVersion: 2.4 + TargetRubyVersion: 3.1.2 Exclude: - 'test/**/*' - 'spec/**/*' diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 0551bb8e5..ef845ac13 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,12 +1,20 @@ # 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-11-17 19:45:05 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 +# Offense count: 1 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyleAlignWith, Severity. +# SupportedStylesAlignWith: start_of_line, begin +Layout/BeginEndAlignment: + Exclude: + - 'lib/fhir_models/bootstrap/model.rb' + +# Offense count: 49 # Cop supports --auto-correct. Layout/EmptyLineAfterGuardClause: Exclude: @@ -26,22 +34,22 @@ Layout/EmptyLineAfterGuardClause: # Cop supports --auto-correct. Layout/RescueEnsureAlignment: Exclude: - - 'lib/fhir_models/bootstrap/hashable.rb' + - 'lib/fhir_models/bootstrap/model.rb' -# Offense count: 2 +# Offense count: 1 # 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 @@ -51,31 +59,40 @@ 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 -# 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' @@ -87,11 +104,36 @@ Naming/RescuedExceptionsVariableName: Exclude: - 'lib/fhir_models/bootstrap/hashable.rb' +# Offense count: 35 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle. +# SupportedStyles: separated, grouped +Style/AccessorGrouping: + Exclude: + - 'lib/fhir_models/bootstrap/field.rb' + - 'lib/fhir_models/bootstrap/generator.rb' + - 'lib/fhir_models/bootstrap/template.rb' + - 'lib/fhir_models/fhir_ext/element_definition.rb' + - 'lib/fhir_models/fhir_ext/structure_definition.rb' + - 'lib/fhir_models/fhir_ext/structure_definition_finding.rb' + +# Offense count: 5 +# Cop supports --auto-correct. +Style/CaseLikeIf: + Exclude: + - '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/fhir_ext/structure_definition.rb' + # Offense count: 1 -# Configuration parameters: . -# SupportedStyles: inline, group -Style/AccessModifierDeclarations: - EnforcedStyle: inline +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle. +# SupportedStyles: nested, compact +Style/ClassAndModuleChildren: + Exclude: + - '.simplecov' # Offense count: 17 Style/ClassVars: @@ -99,17 +141,31 @@ Style/ClassVars: - '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: 1 +# Cop supports --auto-correct. +# Configuration parameters: Keywords, RequireColon. +# Keywords: TODO, FIXME, OPTIMIZE, HACK, REVIEW, NOTE +Style/CommentAnnotation: + Exclude: + - 'Guardfile' + # 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' @@ -125,6 +181,12 @@ Style/Documentation: - 'lib/fhir_models/fhirpath/expression.rb' - 'lib/fhir_models/fhirpath/parse.rb' +# Offense count: 1 +# Cop supports --auto-correct. +Style/GlobalStdStream: + Exclude: + - 'lib/fhir_models/fhir.rb' + # Offense count: 28 # Cop supports --auto-correct. Style/IfUnlessModifier: @@ -136,39 +198,71 @@ 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 +# Offense count: 6 +# Cop supports --auto-correct. +# Configuration parameters: AllowMethodComparison. 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. +# Configuration parameters: EnforcedStyle, IgnoredMethods. # SupportedStyles: predicate, comparison Style/NumericPredicate: Exclude: - - 'spec/**/*' - 'lib/fhir_models/fhir_ext/structure_definition_compare.rb' +# Offense count: 2 +# Configuration parameters: AllowedMethods. +# AllowedMethods: respond_to_missing? +Style/OptionalBooleanParameter: + Exclude: + - 'lib/fhir_models/bootstrap/generator.rb' + - 'lib/fhir_models/bootstrap/template.rb' + # Offense count: 1 # Cop supports --auto-correct. Style/OrAssignment: Exclude: - 'lib/fhir_models/bootstrap/generator.rb' +# Offense count: 2 +# Cop supports --auto-correct. +Style/RedundantBegin: + Exclude: + - 'lib/fhir_models/fhir_ext/structure_definition.rb' + - 'lib/fhir_models/fhirpath/expression.rb' + +# Offense count: 2 +# Cop supports --auto-correct. +Style/RedundantRegexpCharacterClass: + Exclude: + - 'lib/fhir_models/fhir.rb' + +# Offense count: 6 +# Cop supports --auto-correct. +Style/RedundantRegexpEscape: + Exclude: + - 'lib/fhir_models/bootstrap/generator.rb' + - 'lib/fhir_models/bootstrap/model.rb' + - 'lib/fhir_models/bootstrap/preprocess.rb' + - 'lib/fhir_models/fhir.rb' + - 'lib/fhir_models/fhirpath/parse.rb' + +# Offense count: 1 +# Cop supports --auto-correct. +Style/RedundantSelfAssignment: + Exclude: + - 'lib/fhir_models/fhir_ext/element_definition.rb' + # Offense count: 16 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle. @@ -196,6 +290,31 @@ Style/SafeNavigation: - 'lib/fhir_models/bootstrap/xml.rb' - 'lib/fhir_models/fhir_ext/structure_definition.rb' +# Offense count: 9 +# Cop supports --auto-correct. +Style/SlicingWithRange: + Exclude: + - 'lib/fhir_models/bootstrap/field.rb' + - 'lib/fhir_models/bootstrap/generator.rb' + - 'lib/fhir_models/bootstrap/model.rb' + - 'lib/fhir_models/fhir_ext/structure_definition.rb' + - 'lib/fhir_models/fhirpath/parse.rb' + +# Offense count: 1 +# Cop supports --auto-correct. +# Configuration parameters: AllowModifier. +Style/SoleNestedConditional: + Exclude: + - 'lib/fhir_models/fhir_ext/structure_definition_compare.rb' + +# Offense count: 2 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, ConsistentQuotesInMultiline. +# SupportedStyles: single_quotes, double_quotes +Style/StringLiterals: + Exclude: + - '.simplecov' + # Offense count: 7 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle. diff --git a/.simplecov b/.simplecov index a555a3758..bdf3dbbb9 100644 --- a/.simplecov +++ b/.simplecov @@ -1,9 +1,9 @@ require 'simplecov' SimpleCov.command_name 'Unit Tests' -SimpleCov.start do - add_filter "test/" - add_group "Library", "lib" -end +# SimpleCov.start do +# add_filter "test/" +# add_group "Library", "lib" +# end class SimpleCov::Formatter::QualityFormatter def format(result) diff --git a/Gemfile.lock b/Gemfile.lock index e4f86e1d3..764904c3f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -14,21 +14,21 @@ GEM bcp47 (0.3.3) i18n coderay (1.1.3) - concurrent-ruby (1.1.10) + concurrent-ruby (1.2.2) coolline (0.5.0) unicode_utils (~> 1.4) date_time_precision (0.8.1) - diff-lcs (1.4.4) - docile (1.3.2) - ffi (1.13.1) - formatador (0.2.5) - guard (2.16.2) + diff-lcs (1.5.0) + docile (1.4.0) + ffi (1.16.3) + formatador (1.1.0) + guard (2.18.1) formatador (>= 0.2.4) listen (>= 2.7, < 4.0) lumberjack (>= 1.0.12, < 2.0) nenv (~> 0.1) notiffany (~> 0.0) - pry (>= 0.9.12) + pry (>= 0.13.0) shellany (~> 0.0) thor (>= 0.18.1) guard-compat (1.2.1) @@ -39,22 +39,19 @@ GEM guard-test (2.0.8) guard-compat (~> 1.2) test-unit (~> 3.0) - i18n (1.12.0) + i18n (1.14.1) concurrent-ruby (~> 1.0) - jaro_winkler (1.5.4) - json (2.3.1) - listen (3.3.1) + json (2.6.3) + listen (3.8.0) rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) - lumberjack (1.2.8) + lumberjack (1.2.10) method_source (1.0.0) - mime-types (3.4.1) + mime-types (3.5.1) mime-types-data (~> 3.2015) - mime-types-data (3.2022.0105) - mini_portile2 (2.5.3) + mime-types-data (3.2023.1003) nenv (0.3.0) - nokogiri (1.11.7) - mini_portile2 (~> 2.5.0) + nokogiri (1.15.5-x86_64-linux) racc (~> 1.4) nokogiri-diff (0.2.0) nokogiri (~> 1.5) @@ -62,44 +59,50 @@ 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) - power_assert (1.2.0) - pry (0.13.1) + racc + power_assert (2.0.3) + pry (0.14.2) coderay (~> 1.1) method_source (~> 1.0) - pry-coolline (0.2.5) + pry-coolline (0.2.6) coolline (~> 0.5) - racc (1.5.2) - rainbow (3.0.0) - rake (13.0.1) - rb-fsevent (0.10.4) + pry (~> 0.13) + racc (1.7.3) + rainbow (3.1.1) + rake (13.1.0) + rb-fsevent (0.11.2) rb-inotify (0.10.1) ffi (~> 1.0) - rexml (3.2.5) - rspec (3.10.0) - rspec-core (~> 3.10.0) - rspec-expectations (~> 3.10.0) - rspec-mocks (~> 3.10.0) - rspec-core (3.10.0) - rspec-support (~> 3.10.0) - rspec-expectations (3.10.0) + regexp_parser (2.8.2) + rexml (3.2.6) + rspec (3.12.0) + rspec-core (~> 3.12.0) + rspec-expectations (~> 3.12.0) + rspec-mocks (~> 3.12.0) + rspec-core (3.12.2) + rspec-support (~> 3.12.0) + rspec-expectations (3.12.3) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.10.0) - rspec-mocks (3.10.0) + rspec-support (~> 3.12.0) + rspec-mocks (3.12.6) 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) + rspec-support (~> 3.12.0) + rspec-support (3.12.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) @@ -107,14 +110,14 @@ GEM simplecov-html (~> 0.10.0) simplecov-html (0.10.2) tdiff (0.3.4) - test-unit (3.3.6) + test-unit (3.6.1) power_assert - thor (1.0.1) - unicode-display_width (1.6.1) + thor (1.3.0) + unicode-display_width (2.5.0) unicode_utils (1.4.0) PLATFORMS - ruby + x86_64-linux DEPENDENCIES bundler @@ -126,12 +129,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.4.17 diff --git a/fhir_models.gemspec b/fhir_models.gemspec index fac646552..803142387 100644 --- a/fhir_models.gemspec +++ b/fhir_models.gemspec @@ -34,7 +34,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'rspec' spec.add_development_dependency 'simplecov', '~> 0.17.0' spec.add_development_dependency 'nokogiri-diff' - spec.add_development_dependency 'rubocop', '0.80' + spec.add_development_dependency 'rubocop', '1.23.0' spec.add_development_dependency 'guard-rspec' spec.add_development_dependency 'guard-test' end