diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 4ec92f34121..9e69426fcf7 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,6 +1,6 @@ # This configuration was generated by # `rubocop --auto-gen-config --auto-gen-only-exclude --no-offense-counts --no-auto-gen-timestamp` -# using RuboCop version 1.77.0. +# using RuboCop version 1.79.0. # The point is for the user to remove these configuration records # one by one as the offenses are removed from the code base. # Note that changes in the inspected code, or installation of new diff --git a/Gemfile.lock b/Gemfile.lock index ca95bbfdcf7..d0472d538c0 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -765,7 +765,7 @@ GEM rspec-mocks (~> 3.0) sidekiq (>= 5, < 9) rspec-support (3.13.4) - rubocop (1.78.0) + rubocop (1.79.0) json (~> 2.3) language_server-protocol (~> 3.17.0.2) lint_roller (~> 1.1.0) @@ -773,8 +773,9 @@ GEM parser (>= 3.3.0.2) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 2.9.3, < 3.0) - rubocop-ast (>= 1.45.1, < 2.0) + rubocop-ast (>= 1.46.0, < 2.0) ruby-progressbar (~> 1.7) + tsort (>= 0.2.0) unicode-display_width (>= 2.4.0, < 4.0) rubocop-ast (1.46.0) parser (>= 3.3.7.2) @@ -880,6 +881,7 @@ GEM bindata (~> 2.4) openssl (> 2.0) openssl-signature_algorithm (~> 1.0) + tsort (0.2.0) tty-color (0.6.0) tty-cursor (0.7.1) tty-prompt (0.23.1) diff --git a/app/controllers/api/v1/admin/tags_controller.rb b/app/controllers/api/v1/admin/tags_controller.rb index 283383acb4a..dd272120e21 100644 --- a/app/controllers/api/v1/admin/tags_controller.rb +++ b/app/controllers/api/v1/admin/tags_controller.rb @@ -2,6 +2,7 @@ class Api::V1::Admin::TagsController < Api::BaseController include Authorization + before_action -> { authorize_if_got_token! :'admin:read' }, only: [:index, :show] before_action -> { authorize_if_got_token! :'admin:write' }, only: :update diff --git a/app/lib/emoji_formatter.rb b/app/lib/emoji_formatter.rb index c193df9bb65..a5f5103fffd 100644 --- a/app/lib/emoji_formatter.rb +++ b/app/lib/emoji_formatter.rb @@ -45,7 +45,9 @@ class EmojiFormatter i += 1 if inside_shortname && text[i] == ':' - inside_shortname = false + # https://github.com/rubocop/rubocop/issues/14383 + # False positive in line below, remove disable when resolved + inside_shortname = false # rubocop:disable Lint/UselessAssignment shortcode = text[(shortname_start_index + 1)..(i - 1)] char_after = text[i + 1] diff --git a/spec/controllers/concerns/accountable_concern_spec.rb b/spec/controllers/concerns/accountable_concern_spec.rb index cd06d872bb5..e68090fdc2f 100644 --- a/spec/controllers/concerns/accountable_concern_spec.rb +++ b/spec/controllers/concerns/accountable_concern_spec.rb @@ -6,6 +6,7 @@ RSpec.describe AccountableConcern do let(:hoge_class) do Class.new do include AccountableConcern + attr_reader :current_account def initialize(current_account) diff --git a/spec/routing/accounts_routing_spec.rb b/spec/routing/accounts_routing_spec.rb index 8ff711a681e..bb0bf082bde 100644 --- a/spec/routing/accounts_routing_spec.rb +++ b/spec/routing/accounts_routing_spec.rb @@ -49,6 +49,7 @@ RSpec.describe 'Routes under accounts/' do context 'with local username encoded at' do include RSpec::Rails::RequestExampleGroup + let(:username) { 'alice' } it 'routes /%40:username' do @@ -140,6 +141,7 @@ RSpec.describe 'Routes under accounts/' do context 'with remote username encoded at' do include RSpec::Rails::RequestExampleGroup + let(:username) { 'alice%40example.com' } let(:username_decoded) { 'alice@example.com' } diff --git a/spec/validators/existing_username_validator_spec.rb b/spec/validators/existing_username_validator_spec.rb index 25ecb1fbcde..ab5be524534 100644 --- a/spec/validators/existing_username_validator_spec.rb +++ b/spec/validators/existing_username_validator_spec.rb @@ -6,6 +6,7 @@ RSpec.describe ExistingUsernameValidator do let(:record_class) do Class.new do include ActiveModel::Validations + attr_accessor :contact, :friends def self.name diff --git a/spec/validators/language_validator_spec.rb b/spec/validators/language_validator_spec.rb index 19e55f34672..d19b33f27f8 100644 --- a/spec/validators/language_validator_spec.rb +++ b/spec/validators/language_validator_spec.rb @@ -6,6 +6,7 @@ RSpec.describe LanguageValidator do let(:record_class) do Class.new do include ActiveModel::Validations + attr_accessor :locale validates :locale, language: true diff --git a/spec/validators/unreserved_username_validator_spec.rb b/spec/validators/unreserved_username_validator_spec.rb index ad1092109db..67a2921885e 100644 --- a/spec/validators/unreserved_username_validator_spec.rb +++ b/spec/validators/unreserved_username_validator_spec.rb @@ -6,6 +6,7 @@ RSpec.describe UnreservedUsernameValidator do let(:record_class) do Class.new do include ActiveModel::Validations + attr_accessor :username validates_with UnreservedUsernameValidator diff --git a/spec/validators/url_validator_spec.rb b/spec/validators/url_validator_spec.rb index 2297dddaa01..55c0347d18e 100644 --- a/spec/validators/url_validator_spec.rb +++ b/spec/validators/url_validator_spec.rb @@ -6,6 +6,7 @@ RSpec.describe URLValidator do let(:record_class) do Class.new do include ActiveModel::Validations + attr_accessor :profile validates :profile, url: true