Skip to content

Commit

Permalink
updating rubocop and fixing code style issues (#704)
Browse files Browse the repository at this point in the history
  • Loading branch information
brujeo authored Nov 28, 2023
1 parent c2bc3f1 commit 6cf36ec
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 15 deletions.
20 changes: 12 additions & 8 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ GEM
thor (>= 0.14, < 2.0)
json (2.6.3)
jwt (2.7.0)
language_server-protocol (3.17.0.3)
loofah (2.22.0)
crass (~> 1.0.2)
nokogiri (>= 1.12.0)
Expand Down Expand Up @@ -286,8 +287,9 @@ GEM
sawyer (~> 0.9)
os_map_ref (0.5.0)
parallel (1.23.0)
parser (3.2.2.1)
parser (3.2.2.4)
ast (~> 2.4.1)
racc
pg (1.5.4)
phonelib (0.8.5)
poltergeist (1.18.1)
Expand Down Expand Up @@ -344,7 +346,7 @@ GEM
rb-inotify (0.10.1)
ffi (~> 1.0)
rbtree3 (0.7.1)
regexp_parser (2.8.1)
regexp_parser (2.8.2)
rest-client (2.1.0)
http-accept (>= 1.7.0, < 2.0)
http-cookie (>= 1.0.2, < 2.0)
Expand Down Expand Up @@ -375,26 +377,28 @@ GEM
rspec-mocks (~> 3.10)
rspec-support (~> 3.10)
rspec-support (3.12.0)
rubocop (1.52.0)
rubocop (1.57.2)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
parser (>= 3.2.0.0)
parser (>= 3.2.2.4)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml (>= 3.2.5, < 4.0)
rubocop-ast (>= 1.28.0, < 2.0)
rubocop-ast (>= 1.28.1, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.29.0)
rubocop-ast (1.30.0)
parser (>= 3.2.1.0)
rubocop-capybara (2.18.0)
rubocop (~> 1.41)
rubocop-factory_bot (2.23.1)
rubocop (~> 1.33)
rubocop-rails (2.19.1)
rubocop-rails (2.22.2)
activesupport (>= 4.2.0)
rack (>= 1.1)
rubocop (>= 1.33.0, < 2.0)
rubocop-ast (>= 1.30.0, < 2.0)
rubocop-rspec (2.22.0)
rubocop (~> 1.33)
rubocop-capybara (~> 2.17)
Expand Down Expand Up @@ -441,7 +445,7 @@ GEM
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
uk_postcode (2.1.8)
unicode-display_width (2.4.2)
unicode-display_width (2.5.0)
uniform_notifier (1.16.0)
validates_email_format_of (1.7.2)
i18n
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/flood_risk_engine/forms_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def transient_registration_attributes
end

def validate_token
return redirect_to(page_path("invalid")) unless find_or_initialize_transient_registration(params[:token])
redirect_to(page_path("invalid")) unless find_or_initialize_transient_registration(params[:token])
end

# rubocop:disable Naming/MemoizedInstanceVariableName
Expand Down
2 changes: 1 addition & 1 deletion app/forms/flood_risk_engine/base_form.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def submit(attributes)
private

def transient_registration_valid?
return if transient_registration.valid?
return true if transient_registration.valid?

transient_registration.errors.each_value do |message|
errors[:base] << message
Expand Down
2 changes: 1 addition & 1 deletion app/helpers/flood_risk_engine/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def title_text
end

def error_title
return content_for :error_title if content_for?(:error_title)
content_for :error_title if content_for?(:error_title)
end
end
end
4 changes: 2 additions & 2 deletions app/helpers/flood_risk_engine/email_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module FloodRiskEngine
module EmailHelper

# Embed an image inline into html email
def email_image_tag(image, **options)
def email_image_tag(image, **)
path = File.join("/app/assets/images", image)

full_path = Rails.root.join path
Expand All @@ -13,7 +13,7 @@ def email_image_tag(image, **options)
full_path = File.join(Gem.loaded_specs["flood_risk_engine"].full_gem_path, path) unless File.exist? full_path

attachments[image] = File.read full_path
image_tag attachments[image].url, **options
image_tag(attachments[image].url, **)
end

end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ def skip_to_manual_address?
end

def company_address_was_manually_entered?
return if company_address.blank?
return false if company_address.blank?

company_address.manual?
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ def change

add_index :flood_risk_engine_exemptions, :code_number, unique: true

FloodRiskEngine::Exemption.all.each(&:save)
FloodRiskEngine::Exemption.find_each(&:save)
end
end

0 comments on commit 6cf36ec

Please sign in to comment.