diff options
author | Nick Schonning <nschonni@gmail.com> | 2023-03-12 19:03:07 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-13 00:03:07 +0100 |
commit | e762a14c0ab235c337b3cddbef1eaf72b26faf58 (patch) | |
tree | b5484900a8d4d76605b506075e1df0bfae360e78 | |
parent | f432db7b9f54501269c6377faf85b1b4b1424239 (diff) |
Enable Rubocop Performance/DeleteSuffix (#24077)
-rw-r--r-- | .rubocop_todo.yml | 7 | ||||
-rw-r--r-- | lib/tasks/repo.rake | 4 |
2 files changed, 2 insertions, 9 deletions
diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index a9727f939..8a96e59f9 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -301,13 +301,6 @@ Performance/DeletePrefix: - 'app/services/resolve_account_service.rb' - 'app/services/tag_search_service.rb' -# Offense count: 1 -# This cop supports unsafe autocorrection (--autocorrect-all). -# Configuration parameters: SafeMultiline. -Performance/DeleteSuffix: - Exclude: - - 'lib/tasks/repo.rake' - # Offense count: 19 # This cop supports unsafe autocorrection (--autocorrect-all). Performance/MapCompact: diff --git a/lib/tasks/repo.rake b/lib/tasks/repo.rake index 5d1b4f754..888337b4f 100644 --- a/lib/tasks/repo.rake +++ b/lib/tasks/repo.rake @@ -91,8 +91,8 @@ namespace :repo do missing_json_files = I18n.available_locales.reject { |locale| Rails.root.join('app', 'javascript', 'mastodon', 'locales', "#{locale}.json").exist? } locales_in_files = Dir[Rails.root.join('config', 'locales', '*.yml')].map do |path| - file_name = File.basename(path) - file_name.gsub(/\A(doorkeeper|devise|activerecord|simple_form)\./, '').gsub(/\.yml\z/, '').to_sym + file_name = File.basename(path, '.yml') + file_name.gsub(/\A(doorkeeper|devise|activerecord|simple_form)\./, '').to_sym end.uniq.compact missing_available_locales = locales_in_files - I18n.available_locales |