From ae6dcff4243e56344aeafdf71313fa670f9c915c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 2 Dec 2024 03:41:34 +0000 Subject: [PATCH 1/2] build(deps-dev): update rubocop requirement from = 1.68.0 to = 1.69.0 Updates the requirements on [rubocop](https://github.com/rubocop/rubocop) to permit the latest version. - [Release notes](https://github.com/rubocop/rubocop/releases) - [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md) - [Commits](https://github.com/rubocop/rubocop/compare/v1.68.0...v1.69.0) --- updated-dependencies: - dependency-name: rubocop dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 20 +++++++++++--------- erblint-github.gemspec | 2 +- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 157d169..98336ef 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -47,7 +47,7 @@ GEM erubi (1.13.0) i18n (1.14.6) concurrent-ruby (~> 1.0) - json (2.7.5) + json (2.8.2) language_server-protocol (3.17.0.3) loofah (2.22.0) crass (~> 1.0.2) @@ -61,7 +61,7 @@ GEM mini_portile2 (~> 2.8.2) racc (~> 1.4) parallel (1.26.3) - parser (3.3.5.1) + parser (3.3.6.0) ast (~> 2.4.1) racc racc (1.8.1) @@ -75,18 +75,18 @@ GEM nokogiri (~> 1.14) rainbow (3.1.1) rake (13.2.1) - regexp_parser (2.9.2) - rubocop (1.68.0) + regexp_parser (2.9.3) + rubocop (1.69.0) json (~> 2.3) language_server-protocol (>= 3.17.0) parallel (~> 1.10) parser (>= 3.3.0.2) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 2.4, < 3.0) - rubocop-ast (>= 1.32.2, < 2.0) + rubocop-ast (>= 1.36.1, < 2.0) ruby-progressbar (~> 1.7) - unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.33.1) + unicode-display_width (>= 2.4.0, < 4.0) + rubocop-ast (1.36.2) parser (>= 3.3.1.0) rubocop-github (0.20.0) rubocop (>= 1.37) @@ -104,7 +104,9 @@ GEM smart_properties (1.17.0) tzinfo (2.0.6) concurrent-ruby (~> 1.0) - unicode-display_width (2.6.0) + unicode-display_width (3.1.2) + unicode-emoji (~> 4.0, >= 4.0.4) + unicode-emoji (4.0.4) PLATFORMS ruby @@ -115,7 +117,7 @@ DEPENDENCIES minitest (~> 5.25.1) mocha (~> 2.6.0) rake (~> 13.2.1) - rubocop (= 1.68.0) + rubocop (= 1.69.0) rubocop-github (~> 0.20.0) BUNDLED WITH diff --git a/erblint-github.gemspec b/erblint-github.gemspec index b0bd531..1df0341 100644 --- a/erblint-github.gemspec +++ b/erblint-github.gemspec @@ -21,7 +21,7 @@ Gem::Specification.new do |s| s.add_development_dependency "mocha", "~> 2.6.0" s.add_development_dependency "rake", "~> 13.2.1" - s.add_development_dependency "rubocop", "= 1.68.0" + s.add_development_dependency "rubocop", "= 1.69.0" s.add_development_dependency "rubocop-github", "~> 0.20.0" s.metadata["rubygems_mfa_required"] = "true" From 6a126c390a95f525b00fc4307c1ea701583a8993 Mon Sep 17 00:00:00 2001 From: Joyce Zhu Date: Tue, 3 Dec 2024 18:31:46 -0500 Subject: [PATCH 2/2] Appease `SafeNavigationChainLength` --- lib/erblint-github/linters/custom_helpers.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/erblint-github/linters/custom_helpers.rb b/lib/erblint-github/linters/custom_helpers.rb index 14786ae..f1d791f 100644 --- a/lib/erblint-github/linters/custom_helpers.rb +++ b/lib/erblint-github/linters/custom_helpers.rb @@ -36,11 +36,12 @@ def counter_correct?(processed_source) processed_source.parser.ast.descendants(:erb).each do |node| indicator_node, _, code_node, = *node indicator = indicator_node&.loc&.source - comment = code_node&.loc&.source&.strip + comment = code_node&.loc&.source + stripped_comment = comment&.strip - if indicator == "#" && comment.start_with?("erblint:counter") && comment.match(rule_name) + if indicator == "#" && stripped_comment.start_with?("erblint:counter") && stripped_comment.match(rule_name) comment_node = node - expected_count = comment.match(/\s(\d+)\s?$/)[1].to_i + expected_count = stripped_comment.match(/\s(\d+)\s?$/)[1].to_i end end