Browse Source

Enable Rubocop Performance/DeleteSuffix (#24077)

closed-social-glitch-2
Nick Schonning 1 year ago
committed by GitHub
parent
commit
e762a14c0a
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 9 deletions
  1. +0
    -7
      .rubocop_todo.yml
  2. +2
    -2
      lib/tasks/repo.rake

+ 0
- 7
.rubocop_todo.yml View File

@ -301,13 +301,6 @@ Performance/DeletePrefix:
- 'app/services/resolve_account_service.rb' - 'app/services/resolve_account_service.rb'
- 'app/services/tag_search_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 # Offense count: 19
# This cop supports unsafe autocorrection (--autocorrect-all). # This cop supports unsafe autocorrection (--autocorrect-all).
Performance/MapCompact: Performance/MapCompact:

+ 2
- 2
lib/tasks/repo.rake View File

@ -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? } 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| 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 end.uniq.compact
missing_available_locales = locales_in_files - I18n.available_locales missing_available_locales = locales_in_files - I18n.available_locales

Loading…
Cancel
Save