From 4651505d1a5eda85456b85ddbdf7825291768fd1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 21 Dec 2023 11:20:33 +0000 Subject: [PATCH 1/3] Update rubocop-govuk requirement from = 4.12.0 to = 4.13.0 Updates the requirements on [rubocop-govuk](https://github.com/alphagov/rubocop-govuk) to permit the latest version. - [Changelog](https://github.com/alphagov/rubocop-govuk/blob/main/CHANGELOG.md) - [Commits](https://github.com/alphagov/rubocop-govuk/compare/v4.12.0...v4.13.0) --- updated-dependencies: - dependency-name: rubocop-govuk dependency-type: direct:development ... Signed-off-by: dependabot[bot] --- govspeak.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/govspeak.gemspec b/govspeak.gemspec index a9de6f3d..a0bf5a77 100644 --- a/govspeak.gemspec +++ b/govspeak.gemspec @@ -42,6 +42,6 @@ library for use in the UK Government Single Domain project' s.add_development_dependency "minitest", "~> 5.14" s.add_development_dependency "pry-byebug" s.add_development_dependency "rake" - s.add_development_dependency "rubocop-govuk", "4.12.0" + s.add_development_dependency "rubocop-govuk", "4.13.0" s.add_development_dependency "simplecov" end From 1cd59b93c8918bf10653397347530c62999b00d5 Mon Sep 17 00:00:00 2001 From: Joseph Kempster Date: Thu, 28 Dec 2023 12:48:12 +0000 Subject: [PATCH 2/3] Fix Rubocop Style/RedundantParentheses --- lib/govspeak/presenters/contact_presenter.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/govspeak/presenters/contact_presenter.rb b/lib/govspeak/presenters/contact_presenter.rb index 2264e3c4..c0893e66 100644 --- a/lib/govspeak/presenters/contact_presenter.rb +++ b/lib/govspeak/presenters/contact_presenter.rb @@ -59,7 +59,7 @@ def filter_post_addresses(addresses) # Not showing United Kingdom country is a "feature" lifted and shifted # from Whitehall: # https://github.com/alphagov/whitehall/blob/c67d53d80f9856549c2da1941a10dbb9170be494/lib/address_formatter/formatter.rb#L17 - (key == "world_location" && value.strip == "United Kingdom" || value == "") + key == "world_location" && value.strip == "United Kingdom" || value == "" end end From fe89a6a589eecca831f3069b9be313442a9bc4bc Mon Sep 17 00:00:00 2001 From: Joseph Kempster Date: Thu, 28 Dec 2023 12:51:30 +0000 Subject: [PATCH 3/3] Fix Rubocop Style/HashEachMethods We have a false positive here from the unsafe Style/HashEachMethods cop. Rubocop thinks that we are calling `each` on a hash, but we are actually calling it on an array of two-element arrays. By putting parentheses around the block arguments we can indicate that we're not working with a hash, and suppress RuboCop offenses. See https://docs.rubocop.org/rubocop/cops_style.html#stylehasheachmethods --- lib/govspeak/post_processor.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/govspeak/post_processor.rb b/lib/govspeak/post_processor.rb index 2e477d9c..1da22de5 100644 --- a/lib/govspeak/post_processor.rb +++ b/lib/govspeak/post_processor.rb @@ -167,7 +167,7 @@ def initialize(html, govspeak_document) def output document = nokogiri_document - self.class.extensions.each do |_, block| + self.class.extensions.each do |(_, block)| instance_exec(document, &block) end document.to_html