Skip to content

Commit

Permalink
残りには全部rubocop:todoを付ける
Browse files Browse the repository at this point in the history
bundle ex rubocop --parallel -A --disable-uncorrectable
  • Loading branch information
takayamaki committed Jan 3, 2025
1 parent 43f417e commit d6319ee
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions app/models/statuses_tag.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def update_trend_tags

private

def get_data
def get_data # rubocop:todo Naming/AccessorMethodName
redis.hset('trend_tags_management_data', 'updated_at', Time.now.utc.as_json) unless redis.exists('trend_tags_management_data')
[
aggregate_tags_in,
Expand Down Expand Up @@ -81,7 +81,7 @@ def score_trend(level: 0, level_last: 0.0, trend_last: 0.0, gamma: 0.3)
[(gamma * (level - level_last)) + ((1 - gamma) * trend_last), 0].max # return 0 if trend is negative
end

def aggregate_tags_in(t: 10.minutes, until_t: Time.now.utc)
def aggregate_tags_in(t: 10.minutes, until_t: Time.now.utc) # rubocop:todo Naming/MethodParameterName
status_ids = status_ids_in((until_t - t)..until_t)
StatusesTag.where(status_id: status_ids).group(:tag_id).count.transform_keys(&:to_s)
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ class AddVisibilityToFavouriteTags < ActiveRecord::Migration[5.1]
def change
add_column :favourite_tags, :visibility, :integer, null: false, default: 0

FavouriteTag.update_all(visibility: FavouriteTag.visibilities[:public])
FavouriteTag.update_all(visibility: FavouriteTag.visibilities[:public]) # rubocop:todo Rails/SkipsModelValidations
end
end
2 changes: 1 addition & 1 deletion db/migrate/20180213223419_add_order_to_favourite_tags.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require Rails.root.join('lib', 'mastodon', 'migration_helpers')
require Rails.root.join('lib', 'mastodon', 'migration_helpers') # rubocop:todo Rails/FilePath

class AddOrderToFavouriteTags < ActiveRecord::Migration[5.1]
include Mastodon::MigrationHelpers
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

before do
@user = Fabricate(:user)
sign_in @user, scope: :user
sign_in @user, scope: :user # rubocop:todo RSpec/InstanceVariable
end

describe 'GET #index' do
Expand All @@ -24,7 +24,7 @@

describe 'GET #edit' do
let(:tag) { Fabricate(:tag, name: 'dummy_tag') }
let!(:favourite_tag) { Fabricate(:favourite_tag, account: @user.account, tag: tag) }
let!(:favourite_tag) { Fabricate(:favourite_tag, account: @user.account, tag: tag) } # rubocop:todo RSpec/InstanceVariable

context 'when the favourite tag is found.' do
before do
Expand Down Expand Up @@ -81,7 +81,7 @@

context 'when the tag has already been favourite.' do
before do
Fabricate(:favourite_tag, account: @user.account, tag: tag)
Fabricate(:favourite_tag, account: @user.account, tag: tag) # rubocop:todo RSpec/InstanceVariable
end

it 'does not create any tags and should render index template' do
Expand All @@ -93,7 +93,7 @@

describe 'PUT #update' do
let(:tag) { Fabricate(:tag, name: 'dummy_tag') }
let!(:favourite_tag) { Fabricate(:favourite_tag, account: @user.account, tag: tag) }
let!(:favourite_tag) { Fabricate(:favourite_tag, account: @user.account, tag: tag) } # rubocop:todo RSpec/InstanceVariable

context 'The favourite tag can update.' do
subject { put :update, params: params }
Expand Down Expand Up @@ -144,7 +144,7 @@
let(:tag2) { Fabricate(:tag, name: tag_name) }

before do
Fabricate(:favourite_tag, account: @user.account, tag: tag2)
Fabricate(:favourite_tag, account: @user.account, tag: tag2) # rubocop:todo RSpec/InstanceVariable
end

it 'does not update any tags and should render edit template' do
Expand All @@ -158,7 +158,7 @@
subject { delete :destroy, params: params }

let(:tag) { Fabricate(:tag, name: 'dummy_tag') }
let!(:favourite_tag) { Fabricate(:favourite_tag, account: @user.account, tag: tag) }
let!(:favourite_tag) { Fabricate(:favourite_tag, account: @user.account, tag: tag) } # rubocop:todo RSpec/InstanceVariable
let(:params) do
{
id: favourite_tag.id,
Expand Down

0 comments on commit d6319ee

Please sign in to comment.