Rubocop

Christopher Vollick created

Since these files didn't have shebangs, rubocop didn't look at them.
Once it started looking it found a bunch of stuff it didn't like, but
the original commit where they were written is already merged, so I'm
fixing those issues here.

Change summary

bin/check_electrum_wallet_completeness | 11 ++++++-----
bin/correct_duplicate_addrs            | 10 ++++++----
bin/detect_duplicate_addrs             |  6 +++---
bin/reassert_electrum_notification     | 11 ++++++-----
4 files changed, 21 insertions(+), 17 deletions(-)

Detailed changes

bin/check_electrum_wallet_completeness 🔗

@@ -1,10 +1,10 @@
 #!/usr/bin/ruby
 # frozen_string_literal: true
 
-require 'redis'
-require 'dhall'
-require_relative '../lib/redis_addresses'
-require_relative '../lib/electrum'
+require "redis"
+require "dhall"
+require_relative "../lib/redis_addresses"
+require_relative "../lib/electrum"
 
 config =
 	Dhall::Coder
@@ -18,6 +18,7 @@ electrum_addrs = electrum.listaddresses
 
 get_addresses_with_users(redis).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 🔗

@@ -6,17 +6,19 @@
 # run this after looking into why
 # Theoretically they could be piped together directly for automated fixing
 
-require 'redis'
+require "redis"
 
 redis = Redis.new
 
-customer_id = ENV['DEFAULT_CUSTOMER_ID']
+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"
+	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"
 	exit 1
 end
 
-
 STDIN.each_line do |line|
 	match = line.match(/^(\w+) is used by the following \d+ keys: (.*)/)
 	unless match

bin/detect_duplicate_addrs 🔗

@@ -1,13 +1,13 @@
 #!/usr/bin/ruby
 # frozen_string_literal: true
 
-require 'redis'
-require_relative '../lib/redis_addresses'
+require "redis"
+require_relative "../lib/redis_addresses"
 
 redis = Redis.new
 
 get_addresses_with_users(redis).each do |addr, keys|
 	if keys.length > 1
-		puts "#{addr} is used by the following #{keys.length} keys: #{keys.join(" ")}"
+		puts "#{addr} is used by the following #{keys.length} keys: #{keys.join(' ')}"
 	end
 end

bin/reassert_electrum_notification 🔗

@@ -1,10 +1,10 @@
 #!/usr/bin/ruby
 # frozen_string_literal: true
 
-require 'redis'
-require 'dhall'
-require_relative '../lib/redis_addresses'
-require_relative '../lib/electrum'
+require "redis"
+require "dhall"
+require_relative "../lib/redis_addresses"
+require_relative "../lib/electrum"
 
 config =
 	Dhall::Coder
@@ -22,7 +22,8 @@ get_addresses_with_users(redis).each do |addr, keys|
 	end
 
 	customer_id = match[1]
-	url = "https://pay.jmp.chat/electrum_notify?address=#{addr}&customer_id=#{customer_id}"
+	url = "https://pay.jmp.chat/electrum_notify?"\
+		"address=#{addr}&customer_id=#{customer_id}"
 
 	unless electrum.notify(addr, url)
 		puts "Failed to setup #{addr} to notify #{url}. Skipping"