From 1baf40077b53a850ffe58d60aa2781f0972cf52d Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Tue, 30 May 2023 10:21:53 -0400 Subject: [PATCH] Fix FormatStringToken cop in CLI (#25122) --- .rubocop_todo.yml | 1 - lib/mastodon/cli/maintenance.rb | 11 ++++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index db65c1455..59186681c 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -951,7 +951,6 @@ Style/FormatStringToken: Exclude: - 'app/models/privacy_policy.rb' - 'config/initializers/devise.rb' - - 'lib/mastodon/cli/maintenance.rb' - 'lib/paperclip/color_extractor.rb' # This cop supports unsafe autocorrection (--autocorrect-all). diff --git a/lib/mastodon/cli/maintenance.rb b/lib/mastodon/cli/maintenance.rb index a0d0547a0..d60497332 100644 --- a/lib/mastodon/cli/maintenance.rb +++ b/lib/mastodon/cli/maintenance.rb @@ -551,7 +551,16 @@ module Mastodon::CLI @prompt.warn 'All those accounts are distinct accounts but only the most recently-created one is fully-functional.' accounts.each_with_index do |account, idx| - @prompt.say format('%2d. %s: created at: %s; updated at: %s; last logged in at: %s; statuses: %5d; last status at: %s', idx, account.username, account.created_at, account.updated_at, account.user&.last_sign_in_at&.to_s || 'N/A', account.account_stat&.statuses_count || 0, account.account_stat&.last_status_at || 'N/A') + @prompt.say format( + '%2d. %s: created at: %s; updated at: %s; last logged in at: %s; statuses: %5d; last status at: %s', + index: idx, + username: account.username, + created_at: account.created_at, + updated_at: account.updated_at, + last_log_in_at: account.user&.last_sign_in_at&.to_s || 'N/A', + status_count: account.account_stat&.statuses_count || 0, + last_status_at: account.account_stat&.last_status_at || 'N/A' + ) end @prompt.say 'Please chose the one to keep unchanged, other ones will be automatically renamed.'