From 2067f2fd1a3a30ccbdc1bd5468a0f357e7bd1c52 Mon Sep 17 00:00:00 2001 From: Rob Scanlon Date: Mon, 22 Apr 2019 17:03:48 -0400 Subject: [PATCH 1/7] Add Gemfile.lock to ensure testing is consistent. --- .gitignore | 1 - Gemfile.lock | 138 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 138 insertions(+), 1 deletion(-) create mode 100644 Gemfile.lock diff --git a/.gitignore b/.gitignore index 9286dd929..cafbb7956 100644 --- a/.gitignore +++ b/.gitignore @@ -2,7 +2,6 @@ **/coverage/** fhir_models*log* invariants.txt -Gemfile.lock .ruby-version .ruby-gemset tmp/ diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 000000000..994cb3f63 --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,138 @@ +PATH + remote: . + specs: + fhir_models (4.0.0) + bcp47 (>= 0.3) + date_time_precision (>= 0.8) + mime-types (>= 3.0) + nokogiri (>= 1.8.2) + +GEM + remote: https://rubygems.org/ + specs: + ast (2.4.0) + bcp47 (0.3.3) + i18n + codeclimate-test-reporter (1.0.7) + simplecov + coderay (1.1.2) + concurrent-ruby (1.1.5) + coolline (0.5.0) + unicode_utils (~> 1.4) + date_time_precision (0.8.1) + diff-lcs (1.3) + docile (1.3.1) + ffi (1.10.0) + formatador (0.2.5) + guard (2.15.0) + 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) + shellany (~> 0.0) + thor (>= 0.18.1) + guard-compat (1.2.1) + guard-rspec (4.7.3) + guard (~> 2.1) + guard-compat (~> 1.1) + rspec (>= 2.99.0, < 4.0) + guard-test (2.0.8) + guard-compat (~> 1.2) + test-unit (~> 3.0) + i18n (1.6.0) + concurrent-ruby (~> 1.0) + json (2.2.0) + 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.2.2) + mime-types-data (~> 3.2015) + mime-types-data (3.2019.0331) + mini_portile2 (2.4.0) + nenv (0.3.0) + nokogiri (1.10.3) + mini_portile2 (~> 2.4.0) + nokogiri-diff (0.2.0) + nokogiri (~> 1.5) + tdiff (~> 0.3, >= 0.3.2) + notiffany (0.1.1) + nenv (~> 0.1) + shellany (~> 0.0) + parallel (1.17.0) + parser (2.6.2.1) + ast (~> 2.4.0) + power_assert (1.1.4) + powerpack (0.1.2) + pry (0.12.2) + coderay (~> 1.1.0) + method_source (~> 0.9.0) + pry-coolline (0.2.5) + coolline (~> 0.5) + rainbow (3.0.0) + rake (12.3.2) + rb-fsevent (0.10.3) + rb-inotify (0.10.0) + ffi (~> 1.0) + rspec (3.8.0) + rspec-core (~> 3.8.0) + rspec-expectations (~> 3.8.0) + rspec-mocks (~> 3.8.0) + rspec-core (3.8.0) + rspec-support (~> 3.8.0) + rspec-expectations (3.8.3) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.8.0) + rspec-mocks (3.8.0) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.8.0) + rspec-support (3.8.0) + rubocop (0.52.1) + parallel (~> 1.10) + parser (>= 2.4.0.2, < 3.0) + powerpack (~> 0.1) + rainbow (>= 2.2.2, < 4.0) + ruby-progressbar (~> 1.7) + unicode-display_width (~> 1.0, >= 1.0.1) + ruby-progressbar (1.10.0) + ruby_dep (1.5.0) + shellany (0.0.1) + simplecov (0.16.1) + docile (~> 1.1) + json (>= 1.8, < 3) + simplecov-html (~> 0.10.0) + simplecov-html (0.10.2) + tdiff (0.3.4) + test-unit (3.3.2) + power_assert + thor (0.20.3) + unicode-display_width (1.5.0) + unicode_utils (1.4.0) + +PLATFORMS + ruby + +DEPENDENCIES + bundler + codeclimate-test-reporter + fhir_models! + guard-rspec + guard-test + nokogiri-diff + pry + pry-coolline + rake + rspec + rubocop (= 0.52.1) + simplecov + test-unit + +RUBY VERSION + ruby 2.5.1p57 + +BUNDLED WITH + 2.0.1 From a9e3e7aab8caba68d4e7d2534be9661a153fe61c Mon Sep 17 00:00:00 2001 From: Rob Scanlon Date: Mon, 22 Apr 2019 22:06:28 -0400 Subject: [PATCH 2/7] Update rubocop. --- .rubocop_todo.yml | 118 +++++++++++++++++++++++++++++++------------- fhir_models.gemspec | 2 +- 2 files changed, 84 insertions(+), 36 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 47e2ea4ca..723a9ba19 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,47 +1,90 @@ # This configuration was generated by # `rubocop --auto-gen-config` -# on 2019-03-22 01:48:08 -0400 using RuboCop version 0.52.1. +# on 2019-04-22 22:05:37 -0400 using RuboCop version 0.67.2. # 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: 39 +# 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/fluentpath/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 Metrics/AbcSize: - Max: 423 + Max: 392 # Offense count: 7 # Configuration parameters: CountComments, ExcludedMethods. +# ExcludedMethods: refine Metrics/BlockLength: - Max: 100 + Max: 74 -# Offense count: 7 +# Offense count: 8 # Configuration parameters: CountBlocks. Metrics/BlockNesting: Max: 5 -# Offense count: 6 +# Offense count: 7 # Configuration parameters: CountComments. Metrics/ClassLength: - Max: 500 + Max: 354 -# Offense count: 25 +# Offense count: 23 Metrics/CyclomaticComplexity: - Max: 69 + Max: 65 -# Offense count: 43 -# Configuration parameters: CountComments. +# Offense count: 44 +# Configuration parameters: CountComments, ExcludedMethods. Metrics/MethodLength: - Max: 200 + Max: 131 -# Offense count: 1 +# Offense count: 2 # Configuration parameters: CountComments. Metrics/ModuleLength: Max: 114 -# Offense count: 24 +# Offense count: 23 Metrics/PerceivedComplexity: - Max: 72 + Max: 68 + +# Offense count: 1 +# Configuration parameters: PreferredName. +Naming/RescuedExceptionsVariableName: + Exclude: + - 'lib/fhir_models/bootstrap/hashable.rb' + +# Offense count: 4 +# Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames. +# AllowedNames: io, id, to, by, on, in, at, ip, db +Naming/UncommunicativeMethodParamName: + Exclude: + - 'lib/fhir_models/fhir_ext/structure_definition_compare.rb' # Offense count: 3 Performance/Caller: @@ -49,14 +92,17 @@ Performance/Caller: - 'lib/fhir_models/bootstrap/model.rb' - 'lib/fhir_models/deprecate.rb' -# Offense count: 3 +# Offense count: 1 # Cop supports --auto-correct. -# Configuration parameters: AutoCorrect. -Performance/HashEachMethods: +Performance/InefficientHashSearch: Exclude: - - 'lib/fhir_models/bootstrap/definitions.rb' - - 'lib/fhir_models/bootstrap/model.rb' - - 'lib/fhir_models/bootstrap/preprocess.rb' + - 'lib/fhir_models/bootstrap/template.rb' + +# Offense count: 1 +# Configuration parameters: . +# SupportedStyles: inline, group +Style/AccessModifierDeclarations: + EnforcedStyle: inline # Offense count: 17 Style/ClassVars: @@ -90,7 +136,7 @@ Style/Documentation: - 'lib/fhir_models/fluentpath/expression.rb' - 'lib/fhir_models/fluentpath/parse.rb' -# Offense count: 28 +# Offense count: 29 # Cop supports --auto-correct. Style/IfUnlessModifier: Exclude: @@ -103,27 +149,33 @@ Style/IfUnlessModifier: - 'lib/fhir_models/fhir_ext/structure_definition_compare.rb' # Offense count: 1 -Style/MethodMissing: +Style/MethodMissingSuper: Exclude: - 'lib/fhir_models/bootstrap/model.rb' -# Offense count: 6 +# 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. +# Configuration parameters: AutoCorrect, EnforcedStyle, IgnoredMethods. # SupportedStyles: predicate, comparison Style/NumericPredicate: Exclude: - 'spec/**/*' - 'lib/fhir_models/fhir_ext/structure_definition_compare.rb' -# Offense count: 1 +# Offense count: 2 # Cop supports --auto-correct. Style/OrAssignment: Exclude: @@ -146,25 +198,21 @@ Style/RescueStandardError: - 'lib/fhir_models/fluentpath/expression.rb' - 'lib/fhir_models/fluentpath/parse.rb' -# Offense count: 4 +# Offense count: 6 # Cop supports --auto-correct. -# Configuration parameters: ConvertCodeThatCanStartToReturnNil. +# Configuration parameters: ConvertCodeThatCanStartToReturnNil, Whitelist. +# Whitelist: 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 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle. -# SupportedStyles: all_comparison_operators, equality_operators_only +# SupportedStyles: forbid_for_all_comparison_operators, forbid_for_equality_operators_only, require_for_all_comparison_operators, require_for_equality_operators_only Style/YodaCondition: Exclude: - 'lib/fhir_models/bootstrap/preprocess.rb' - 'lib/fhir_models/fluentpath/parse.rb' - -# Offense count: 270 -# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns. -# URISchemes: http, https -Metrics/LineLength: - Max: 290 diff --git a/fhir_models.gemspec b/fhir_models.gemspec index df75cd8d2..a144a7edd 100644 --- a/fhir_models.gemspec +++ b/fhir_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.52.1' + spec.add_development_dependency 'rubocop', '0.67' spec.add_development_dependency 'codeclimate-test-reporter' spec.add_development_dependency 'guard-rspec' spec.add_development_dependency 'guard-test' From bc6087b49fd52f4cb5b196587a200f69232401ae Mon Sep 17 00:00:00 2001 From: Rob Scanlon Date: Mon, 22 Apr 2019 22:12:35 -0400 Subject: [PATCH 3/7] Ignore dependant libraries in rubocop. --- .rubocop.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.rubocop.yml b/.rubocop.yml index 1212d671e..9136451e8 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -14,3 +14,6 @@ Metrics/LineLength: Enabled: false Style/FrozenStringLiteralComment: Enabled: false +inherit_mode: + merge: + - Exclude From 0f1277fbf0812cca4c7674f91756ea25bf68f3b6 Mon Sep 17 00:00:00 2001 From: Rob Scanlon Date: Mon, 22 Apr 2019 22:15:46 -0400 Subject: [PATCH 4/7] Update Gemfile.lock. --- Gemfile.lock | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 994cb3f63..82a614445 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -43,6 +43,7 @@ GEM test-unit (~> 3.0) i18n (1.6.0) concurrent-ruby (~> 1.0) + jaro_winkler (1.5.2) json (2.2.0) listen (3.1.5) rb-fsevent (~> 0.9, >= 0.9.4) @@ -67,12 +68,12 @@ GEM parser (2.6.2.1) ast (~> 2.4.0) power_assert (1.1.4) - powerpack (0.1.2) pry (0.12.2) coderay (~> 1.1.0) method_source (~> 0.9.0) pry-coolline (0.2.5) coolline (~> 0.5) + psych (3.1.0) rainbow (3.0.0) rake (12.3.2) rb-fsevent (0.10.3) @@ -91,13 +92,14 @@ GEM diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.8.0) rspec-support (3.8.0) - rubocop (0.52.1) + rubocop (0.67.0) + jaro_winkler (~> 1.5.1) parallel (~> 1.10) - parser (>= 2.4.0.2, < 3.0) - powerpack (~> 0.1) + parser (>= 2.5, != 2.5.1.1) + psych (>= 3.1.0) rainbow (>= 2.2.2, < 4.0) ruby-progressbar (~> 1.7) - unicode-display_width (~> 1.0, >= 1.0.1) + unicode-display_width (>= 1.4.0, < 1.6) ruby-progressbar (1.10.0) ruby_dep (1.5.0) shellany (0.0.1) @@ -127,7 +129,7 @@ DEPENDENCIES pry-coolline rake rspec - rubocop (= 0.52.1) + rubocop (= 0.67) simplecov test-unit From fca43f311e84f0887ac4021b8c3188c1934d2355 Mon Sep 17 00:00:00 2001 From: Rob Scanlon Date: Mon, 22 Apr 2019 22:21:24 -0400 Subject: [PATCH 5/7] More rubocop todos. --- .rubocop_todo.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 723a9ba19..86c6c1576 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,6 +1,6 @@ # This configuration was generated by # `rubocop --auto-gen-config` -# on 2019-04-22 22:05:37 -0400 using RuboCop version 0.67.2. +# on 2019-04-22 22:20:52 -0400 using RuboCop version 0.67.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 @@ -73,11 +73,15 @@ Metrics/ModuleLength: Metrics/PerceivedComplexity: Max: 68 -# Offense count: 1 +# Offense count: 5 # Configuration parameters: PreferredName. Naming/RescuedExceptionsVariableName: Exclude: - 'lib/fhir_models/bootstrap/hashable.rb' + - 'lib/fhir_models/bootstrap/json.rb' + - 'lib/fhir_models/bootstrap/xml.rb' + - 'lib/fhir_models/fhir_ext/structure_definition.rb' + - 'lib/fhir_models/fhir_ext/structure_definition_finding.rb' # Offense count: 4 # Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames. From 486d4720363e31fdd824ffc895991a964c2a7309 Mon Sep 17 00:00:00 2001 From: Rob Scanlon Date: Mon, 22 Apr 2019 22:31:48 -0400 Subject: [PATCH 6/7] Update codeclimate to newer rubocop version. --- .codeclimate.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.codeclimate.yml b/.codeclimate.yml index 6abd57bca..22fbdcc6a 100644 --- a/.codeclimate.yml +++ b/.codeclimate.yml @@ -9,6 +9,10 @@ engines: enabled: true rubocop: enabled: true +plugins: + rubocop: + enabled: true + channel: rubocop-0-67 ratings: paths: - "**.inc" From 5f9f4ff55d55284663d4fe56c952651c7a1fb72f Mon Sep 17 00:00:00 2001 From: Rob Scanlon Date: Mon, 22 Apr 2019 22:34:18 -0400 Subject: [PATCH 7/7] More codeclimate updates. --- .codeclimate.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.codeclimate.yml b/.codeclimate.yml index 22fbdcc6a..73318ebab 100644 --- a/.codeclimate.yml +++ b/.codeclimate.yml @@ -7,9 +7,6 @@ engines: - ruby fixme: enabled: true - rubocop: - enabled: true -plugins: rubocop: enabled: true channel: rubocop-0-67