Fix Whitespace Based Lint Errors

Christopher Vollick created

This is a combination of strings not lining up, "when" statements that
were indented, extra blank lines, missing blank lines, etc.

Change summary

bin/check_electrum_wallet_completeness |  4 ++--
bin/correct_duplicate_addrs            |  6 +++---
bin/process_pending_btc_transactions   | 16 ++++++++--------
bin/reassert_electrum_notification     |  4 ++--
lib/interac_email.rb                   |  6 ++++--
test/test_helper.rb                    |  1 -
6 files changed, 19 insertions(+), 18 deletions(-)

Detailed changes

bin/check_electrum_wallet_completeness 🔗

@@ -19,7 +19,7 @@ electrum_addrs = electrum.listaddresses
 addrs = RedisAddresses.new(redis, config[:currency])
 addrs.get_addresses_with_users.each do |addr, keys|
 	unless electrum_addrs.include?(addr)
-		puts "The address #{addr} (included in #{keys.join(', ')}) "\
-			"isn't included in electrum's list"
+		puts "The address #{addr} (included in #{keys.join(', ')}) " \
+		     "isn't included in electrum's list"
 	end
 end

bin/correct_duplicate_addrs 🔗

@@ -13,9 +13,9 @@ redis = Redis.new
 customer_id = ENV["DEFAULT_CUSTOMER_ID"]
 unless customer_id
 	puts "The env-var DEFAULT_CUSTOMER_ID must be set to the ID " \
-		"of the customer who will receive the duplicated addrs, preferably " \
-		"a support customer or something linked to notifications when " \
-		"stray money is sent to these addresses"
+	     "of the customer who will receive the duplicated addrs, preferably " \
+	     "a support customer or something linked to notifications when " \
+	     "stray money is sent to these addresses"
 	exit 1
 end
 

bin/process_pending_btc_transactions 🔗

@@ -57,14 +57,14 @@ canadianbitcoins = Nokogiri::HTML.parse(
 )
 
 case CONFIG[:electrum][:currency]
-	when "btc"
-		exchange_row = canadianbitcoins.at("#ticker > table > tbody > tr")
-		raise "Bitcoin row has moved" unless exchange_row.at("td").text == "Bitcoin"
-	when "bch"
-		exchange_row = canadianbitcoins.at("#ticker > table > tbody > tr:nth-child(2)")
-		raise "Bitcoin Cash row has moved" unless exchange_row.at("td").text == "Bitcoin Cash"
-	else
-		raise "Unknown currency #{CONFIG[:electrum][:currency]}"
+when "btc"
+	exchange_row = canadianbitcoins.at("#ticker > table > tbody > tr")
+	raise "Bitcoin row has moved" unless exchange_row.at("td").text == "Bitcoin"
+when "bch"
+	exchange_row = canadianbitcoins.at("#ticker > table > tbody > tr:nth-child(2)")
+	raise "Bitcoin Cash row has moved" unless exchange_row.at("td").text == "Bitcoin Cash"
+else
+	raise "Unknown currency #{CONFIG[:electrum][:currency]}"
 end
 
 sell_price = {}

bin/reassert_electrum_notification 🔗

@@ -24,8 +24,8 @@ addrs.get_addresses_with_users(redis).each do |addr, keys|
 
 	customer_id = match[1]
 	url = "https://pay.jmp.chat/electrum_notify?" \
-		"address=#{addr}&customer_id=#{customer_id}" \
-		"&currency=#{config[:currency]}"
+	      "address=#{addr}&customer_id=#{customer_id}" \
+	      "&currency=#{config[:currency]}"
 
 	unless electrum.notify(addr, url)
 		puts "Failed to setup #{addr} to notify #{url}. Skipping"

lib/interac_email.rb 🔗

@@ -143,7 +143,7 @@ class InteracEmail
 		def dkim_headers
 			# Apparently there can sometimes be multiple DKIM sigs
 			# And this library returns a scalar if there's one, or array otherwise
-			[@m["DKIM-Signature"]].flatten.compact.map {|h|
+			[@m["DKIM-Signature"]].flatten.compact.map { |h|
 				h.value
 				&.split(/;\s*/)
 				&.each_with_object({}) { |f, h|
@@ -157,6 +157,7 @@ class InteracEmail
 			dkim = dkim_headers
 
 			raise Error::DKIM, @m if dkim.empty?
+
 			raise Error::WrongDKIM, @m unless dkim.any? {|v| v[:d] == "payments.interac.ca" }
 		end
 	end
@@ -202,6 +203,7 @@ class InteracEmail
 		# other fields I'd be more worried about
 		ms = paragraphs.select { |p| p.start_with?("Message:") }
 		raise Error::NoMessage, self if ms.empty?
+
 		ms.first.sub(/^Message:\s*/, "")
 	end
 
@@ -314,7 +316,7 @@ class InteracEmail
 		end
 
 		def to_s
-			"A manual E-Transfer has been received from \"%s\" for "\
+			"A manual E-Transfer has been received from \"%s\" for " \
 			"$%0.2f. Message: %s\nTo deposit go to %s" % [
 				sender_name,
 				dollars,

test/test_helper.rb 🔗

@@ -9,7 +9,6 @@ require "minitest/autorun"
 ## still uses the old casing
 MiniTest = Minitest unless defined?(MiniTest)
 
-
 require "rantly/minitest_extensions"
 require "webmock/minitest"
 begin