diff --git a/.codeclimate.yml b/.codeclimate.yml index 311c116..a6e9537 100644 --- a/.codeclimate.yml +++ b/.codeclimate.yml @@ -9,7 +9,7 @@ engines: enabled: true rubocop: enabled: true - channel: rubocop-0-80 + channel: rubocop-1-23-0 ratings: paths: - "**.inc" diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index 8eda426..e96997e 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 3330761..0e2036a 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,6 +1,6 @@ inherit_from: .rubocop_todo.yml AllCops: - TargetRubyVersion: 2.7 + TargetRubyVersion: 3.1 Exclude: - 'test/**/*' - 'spec/**/*' diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index e93e682..cb3da6c 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,11 +1,19 @@ # This configuration was generated by # `rubocop --auto-gen-config` -# on 2021-03-30 17:30:14 -0400 using RuboCop version 0.80.0. +# on 2023-11-17 20:09:11 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: 1 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyleAlignWith, Severity. +# SupportedStylesAlignWith: start_of_line, begin +Layout/BeginEndAlignment: + Exclude: + - 'lib/fhir_stu3_models/bootstrap/model.rb' + # Offense count: 49 # Cop supports --auto-correct. Layout/EmptyLineAfterGuardClause: @@ -26,13 +34,7 @@ Layout/EmptyLineAfterGuardClause: # Cop supports --auto-correct. Layout/RescueEnsureAlignment: Exclude: - - 'lib/fhir_stu3_models/bootstrap/hashable.rb' - -# Offense count: 6 -# Cop supports --auto-correct. -Lint/NonDeterministicRequireOrder: - Exclude: - - 'lib/fhir_stu3_models.rb' + - 'lib/fhir_stu3_models/bootstrap/model.rb' # Offense count: 2 # Cop supports --auto-correct. @@ -41,13 +43,14 @@ Lint/ToJSON: - 'lib/fhir_stu3_models/bootstrap/json.rb' - 'lib/fhir_stu3_models/fhir_ext/structure_definition_finding.rb' -# Offense count: 38 +# Offense count: 37 +# Configuration parameters: IgnoredMethods, CountRepeatedAttributes. Metrics/AbcSize: - Max: 405 + Max: 407 # Offense count: 7 -# Configuration parameters: CountComments, ExcludedMethods. -# ExcludedMethods: refine +# Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods. +# IgnoredMethods: refine Metrics/BlockLength: Max: 70 @@ -57,31 +60,40 @@ Metrics/BlockNesting: Max: 5 # Offense count: 6 -# Configuration parameters: CountComments. +# Configuration parameters: CountComments, CountAsOne. Metrics/ClassLength: - Max: 345 + Max: 343 -# Offense count: 25 +# Offense count: 32 +# Configuration parameters: IgnoredMethods. Metrics/CyclomaticComplexity: - Max: 69 + Max: 77 -# Offense count: 43 -# Configuration parameters: CountComments, ExcludedMethods. +# Offense count: 44 +# Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods. Metrics/MethodLength: - Max: 127 + Max: 125 # Offense count: 1 -# Configuration parameters: CountComments. +# Configuration parameters: CountComments, CountAsOne. Metrics/ModuleLength: Max: 114 -# Offense count: 24 +# Offense count: 29 +# Configuration parameters: IgnoredMethods. Metrics/PerceivedComplexity: - Max: 72 + Max: 80 + +# Offense count: 5 +# Configuration parameters: EnforcedStyle, IgnoredPatterns. +# SupportedStyles: snake_case, camelCase +Naming/MethodName: + Exclude: + - 'lib/fhir_stu3_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_stu3_models/fhir_ext/structure_definition_compare.rb' @@ -93,11 +105,35 @@ Naming/RescuedExceptionsVariableName: Exclude: - 'lib/fhir_stu3_models/bootstrap/hashable.rb' +# Offense count: 35 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle. +# SupportedStyles: separated, grouped +Style/AccessorGrouping: + Exclude: + - 'lib/fhir_stu3_models/bootstrap/field.rb' + - 'lib/fhir_stu3_models/bootstrap/generator.rb' + - 'lib/fhir_stu3_models/bootstrap/template.rb' + - 'lib/fhir_stu3_models/fhir_ext/element_definition.rb' + - 'lib/fhir_stu3_models/fhir_ext/structure_definition.rb' + - 'lib/fhir_stu3_models/fhir_ext/structure_definition_finding.rb' + +# Offense count: 6 +# Cop supports --auto-correct. +Style/CaseLikeIf: + Exclude: + - 'lib/fhir_stu3_models/bootstrap/model.rb' + - 'lib/fhir_stu3_models/bootstrap/preprocess.rb' + - 'lib/fhir_stu3_models/bootstrap/xml.rb' + - 'lib/fhir_stu3_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: @@ -105,17 +141,31 @@ Style/ClassVars: - 'lib/fhir_stu3_models/bootstrap/definitions.rb' - 'lib/fhir_stu3_models/fluentpath/parse.rb' +# Offense count: 1 +Style/CombinableLoops: + Exclude: + - 'lib/fhir_stu3_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_stu3_models/bootstrap/hashable.rb' - 'lib/fhir_stu3_models/bootstrap/model.rb' -# Offense count: 14 +# Offense count: 15 +# Configuration parameters: AllowedConstants. Style/Documentation: Exclude: - - 'spec/**/*' - - 'test/**/*' + - '.simplecov' - 'lib/fhir_stu3_models/bootstrap/definitions.rb' - 'lib/fhir_stu3_models/bootstrap/field.rb' - 'lib/fhir_stu3_models/bootstrap/generator.rb' @@ -131,12 +181,11 @@ Style/Documentation: - 'lib/fhir_stu3_models/fluentpath/expression.rb' - 'lib/fhir_stu3_models/fluentpath/parse.rb' -# Offense count: 22 +# Offense count: 1 # Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle. -# SupportedStyles: always, always_true, never -Style/FrozenStringLiteralComment: - Enabled: false +Style/GlobalStdStream: + Exclude: + - 'lib/fhir_stu3_models/fhir.rb' # Offense count: 29 # Cop supports --auto-correct. @@ -150,30 +199,53 @@ Style/IfUnlessModifier: - 'lib/fhir_stu3_models/fhir_ext/structure_definition.rb' - 'lib/fhir_stu3_models/fhir_ext/structure_definition_compare.rb' -# Offense count: 1 -Style/MethodMissingSuper: - Exclude: - - 'lib/fhir_stu3_models/bootstrap/model.rb' - # Offense count: 1 Style/MissingRespondToMissing: Exclude: - 'lib/fhir_stu3_models/bootstrap/model.rb' -# Offense count: 9 +# Offense count: 6 +# Cop supports --auto-correct. +# Configuration parameters: AllowMethodComparison. Style/MultipleComparison: Exclude: - - 'lib/fhir_stu3_models/bootstrap/definitions.rb' - 'lib/fhir_stu3_models/bootstrap/generator.rb' - 'lib/fhir_stu3_models/bootstrap/model.rb' - 'lib/fhir_stu3_models/fhir_ext/structure_definition.rb' +# Offense count: 2 +# Configuration parameters: AllowedMethods. +# AllowedMethods: respond_to_missing? +Style/OptionalBooleanParameter: + Exclude: + - 'lib/fhir_stu3_models/bootstrap/generator.rb' + - 'lib/fhir_stu3_models/bootstrap/template.rb' + # Offense count: 1 # Cop supports --auto-correct. Style/OrAssignment: Exclude: - 'lib/fhir_stu3_models/bootstrap/generator.rb' +# Offense count: 3 +# Cop supports --auto-correct. +Style/RedundantRegexpCharacterClass: + Exclude: + - 'lib/fhir_stu3_models/fhir.rb' + +# Offense count: 3 +# Cop supports --auto-correct. +Style/RedundantRegexpEscape: + Exclude: + - 'lib/fhir_stu3_models/fhir.rb' + - 'lib/fhir_stu3_models/fluentpath/parse.rb' + +# Offense count: 1 +# Cop supports --auto-correct. +Style/RedundantSelfAssignment: + Exclude: + - 'lib/fhir_stu3_models/fhir_ext/element_definition.rb' + # Offense count: 16 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle. @@ -200,6 +272,31 @@ Style/SafeNavigation: - 'lib/fhir_stu3_models/bootstrap/xml.rb' - 'lib/fhir_stu3_models/fhir_ext/structure_definition.rb' +# Offense count: 9 +# Cop supports --auto-correct. +Style/SlicingWithRange: + Exclude: + - 'lib/fhir_stu3_models/bootstrap/field.rb' + - 'lib/fhir_stu3_models/bootstrap/generator.rb' + - 'lib/fhir_stu3_models/bootstrap/model.rb' + - 'lib/fhir_stu3_models/fhir_ext/structure_definition.rb' + - 'lib/fhir_stu3_models/fluentpath/parse.rb' + +# Offense count: 1 +# Cop supports --auto-correct. +# Configuration parameters: AllowModifier. +Style/SoleNestedConditional: + Exclude: + - 'lib/fhir_stu3_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 a555a37..bdf3dbb 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 b3e454f..3aff8fc 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -13,20 +13,20 @@ GEM ast (2.4.2) bcp47 (0.3.3) i18n - coderay (1.1.2) - concurrent-ruby (1.1.9) + coderay (1.1.3) + concurrent-ruby (1.2.2) date_time_precision (0.8.1) - diff-lcs (1.3) - docile (1.1.5) - ffi (1.11.1) - formatador (0.2.5) - guard (2.15.0) + 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) @@ -37,23 +37,20 @@ GEM guard-test (2.0.8) guard-compat (~> 1.2) test-unit (~> 3.0) - i18n (1.8.10) + i18n (1.14.1) concurrent-ruby (~> 1.0) - jaro_winkler (1.5.4) - json (2.5.1) - listen (3.1.5) - rb-fsevent (~> 0.9, >= 0.9.4) - rb-inotify (~> 0.9, >= 0.9.7) - ruby_dep (~> 1.2) - lumberjack (1.0.13) - method_source (0.9.2) - mime-types (3.3.1) + listen (3.8.0) + rb-fsevent (~> 0.10, >= 0.10.3) + rb-inotify (~> 0.9, >= 0.9.10) + lumberjack (1.2.10) + method_source (1.0.0) + mime-types (3.5.1) mime-types-data (~> 3.2015) - mime-types-data (3.2021.0901) - mini_portile2 (2.5.3) + mime-types-data (3.2023.1003) + mini_portile2 (2.8.5) nenv (0.3.0) - nokogiri (1.11.7) - mini_portile2 (~> 2.5.0) + nokogiri (1.15.5) + mini_portile2 (~> 2.8.2) racc (~> 1.4) nokogiri-diff (0.2.0) nokogiri (~> 1.5) @@ -61,54 +58,59 @@ 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.1.5) - pry (0.12.2) - coderay (~> 1.1.0) - method_source (~> 0.9.0) - racc (1.5.2) - rainbow (3.0.0) - rake (12.3.3) - rb-fsevent (0.10.3) - rb-inotify (0.10.0) + racc + power_assert (2.0.3) + pry (0.14.2) + coderay (~> 1.1) + method_source (~> 1.0) + 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.8.0) - rspec-core (~> 3.8.0) - rspec-expectations (~> 3.8.0) - rspec-mocks (~> 3.8.0) - rspec-core (3.8.2) - rspec-support (~> 3.8.0) - rspec-expectations (3.8.4) + 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.8.0) - rspec-mocks (3.8.1) + rspec-support (~> 3.12.0) + rspec-mocks (3.12.6) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.8.0) - rspec-support (3.8.2) - 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) - ruby_dep (1.5.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.13.0) - docile (~> 1.1.0) - json (>= 1.8, < 3) - simplecov-html (~> 0.10.0) - simplecov-html (0.10.2) + simplecov (0.22.0) + docile (~> 1.1) + simplecov-html (~> 0.11) + simplecov_json_formatter (~> 0.1) + simplecov-html (0.12.3) + simplecov_json_formatter (0.1.4) tdiff (0.3.4) - test-unit (3.3.3) + test-unit (3.6.1) power_assert - thor (0.20.3) - unicode-display_width (1.6.1) + thor (1.3.0) + unicode-display_width (2.5.0) PLATFORMS ruby @@ -122,12 +124,12 @@ DEPENDENCIES pry rake rspec - rubocop (= 0.80) + rubocop (= 1.23.0) simplecov test-unit RUBY VERSION - ruby 2.7.2p137 + ruby 3.1.2p20 BUNDLED WITH 2.1.4 diff --git a/fhir_stu3_models.gemspec b/fhir_stu3_models.gemspec index 30985c9..dda6e80 100644 --- a/fhir_stu3_models.gemspec +++ b/fhir_stu3_models.gemspec @@ -33,7 +33,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'rspec' spec.add_development_dependency 'simplecov' 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