Skip to content

Commit f8f873c

Browse files
authored
Merge pull request #187 from publify/dependabot/bundler/rubocop-tw-1.80.2
Update rubocop requirement from ~> 1.75.6 to ~> 1.80.2
2 parents 81b6ea7 + babb01e commit f8f873c

File tree

13 files changed

+30
-31
lines changed

13 files changed

+30
-31
lines changed

.rubocop_todo.yml

Lines changed: 18 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# This configuration was generated by
22
# `rubocop --auto-gen-config --no-offense-counts --no-auto-gen-timestamp`
3-
# using RuboCop version 1.57.2.
3+
# using RuboCop version 1.80.2.
44
# The point is for the user to remove these configuration records
55
# one by one as the offenses are removed from the code base.
66
# Note that changes in the inspected code, or installation of new
77
# versions of RuboCop, may require this file to be generated again.
88

9-
# Configuration parameters: IgnoreLiteralBranches, IgnoreConstantBranches.
9+
# Configuration parameters: IgnoreLiteralBranches, IgnoreConstantBranches, IgnoreDuplicateElseBranch.
1010
Lint/DuplicateBranch:
1111
Exclude:
1212
- 'app/models/feedback.rb'
@@ -45,12 +45,22 @@ Metrics/ParameterLists:
4545
Metrics/PerceivedComplexity:
4646
Max: 19
4747

48-
# Configuration parameters: NamePrefix, ForbiddenPrefixes, AllowedMethods, MethodDefinitionMacros.
49-
# NamePrefix: is_, has_, have_
50-
# ForbiddenPrefixes: is_, has_, have_
48+
# Configuration parameters: Mode, AllowedMethods, AllowedPatterns, AllowBangMethods, WaywardPredicates.
49+
# AllowedMethods: call
50+
# WaywardPredicates: nonzero?
51+
Naming/PredicateMethod:
52+
Exclude:
53+
- 'app/models/content_base.rb'
54+
- 'app/models/trigger.rb'
55+
- 'lib/sidebar_field.rb'
56+
- 'lib/spam_protection.rb'
57+
58+
# Configuration parameters: NamePrefix, ForbiddenPrefixes, AllowedMethods, MethodDefinitionMacros, UseSorbetSigs.
59+
# NamePrefix: is_, has_, have_, does_
60+
# ForbiddenPrefixes: is_, has_, have_, does_
5161
# AllowedMethods: is_a?
5262
# MethodDefinitionMacros: define_method, define_singleton_method
53-
Naming/PredicateName:
63+
Naming/PredicatePrefix:
5464
Exclude:
5565
- 'app/helpers/authors_helper.rb'
5666
- 'app/models/article.rb'
@@ -60,15 +70,14 @@ Naming/PredicateName:
6070

6171
# Configuration parameters: EnforcedStyle, CheckMethodNames, CheckSymbols, AllowedIdentifiers, AllowedPatterns.
6272
# SupportedStyles: snake_case, normalcase, non_integer
63-
# AllowedIdentifiers: capture3, iso8601, rfc1123_date, rfc822, rfc2822, rfc3339, x86_64
73+
# AllowedIdentifiers: TLS1_1, TLS1_2, capture3, iso8601, rfc1123_date, rfc822, rfc2822, rfc3339, x86_64
6474
Naming/VariableNumber:
6575
Exclude:
6676
- 'spec/controllers/authors_controller_spec.rb'
6777

6878
# Configuration parameters: MinSize.
6979
Performance/CollectionLiteralInLoop:
7080
Exclude:
71-
- 'lib/tasks/manifest.rake'
7281
- 'spec/models/blog_spec.rb'
7382

7483
RSpec/AnyInstance:
@@ -180,8 +189,6 @@ RSpec/VerifiedDoubles:
180189
- 'spec/helpers/base_helper_spec.rb'
181190
- 'spec/models/note_spec.rb'
182191

183-
# Configuration parameters: Include.
184-
# Include: db/**/*.rb
185192
Rails/CreateTableWithTimestamps:
186193
Exclude:
187194
- 'db/migrate/113_initial_schema.rb'
@@ -190,36 +197,27 @@ Rails/CreateTableWithTimestamps:
190197
- 'db/migrate/20190209160610_remove_text_filters.rb'
191198
- 'db/migrate/20221010092846_remove_page_caches_table.rb'
192199

193-
# Configuration parameters: Include.
194-
# Include: app/models/**/*.rb
195200
Rails/HasAndBelongsToMany:
196201
Exclude:
197202
- 'app/models/content.rb'
198203
- 'app/models/tag.rb'
199204

200-
# Configuration parameters: Include.
201-
# Include: app/models/**/*.rb
202205
Rails/HasManyOrHasOneDependent:
203206
Exclude:
204207
- 'app/models/article.rb'
205208
- 'app/models/blog.rb'
206209
- 'app/models/user.rb'
207210

208-
# Configuration parameters: Include.
209-
# Include: app/helpers/**/*.rb
210211
Rails/HelperInstanceVariable:
211212
Exclude:
212213
- 'app/helpers/base_helper.rb'
213214

214-
# Configuration parameters: IgnoreScopes, Include.
215-
# Include: app/models/**/*.rb
215+
# Configuration parameters: IgnoreScopes.
216216
Rails/InverseOf:
217217
Exclude:
218218
- 'app/models/blog.rb'
219219
- 'app/models/user.rb'
220220

221-
# Configuration parameters: Include.
222-
# Include: app/controllers/**/*.rb, app/mailers/**/*.rb
223221
Rails/LexicallyScopedActionFilter:
224222
Exclude:
225223
- 'app/controllers/admin/base_controller.rb'
@@ -235,8 +233,6 @@ Rails/RedundantReceiverInWithOptions:
235233
Exclude:
236234
- 'app/controllers/content_controller.rb'
237235

238-
# Configuration parameters: Include.
239-
# Include: db/**/*.rb
240236
Rails/ThreeStateBooleanColumn:
241237
Exclude:
242238
- 'db/migrate/113_initial_schema.rb'

app/controllers/admin/base_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def destroy_a(klass_to_destroy)
1818
@record = klass_to_destroy.find(params[:id])
1919
if @record.respond_to?(:access_by?) && !@record.access_by?(current_user)
2020
flash[:error] = I18n.t("admin.base.not_allowed")
21-
return(redirect_to action: "index")
21+
return redirect_to action: "index"
2222
end
2323
@record.destroy
2424
flash[:notice] = I18n.t("admin.base.successfully_deleted",

app/controllers/admin/users_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def update
3838
end
3939

4040
def destroy
41-
@user.destroy if User.where("profile = ? and id != ?", User::ADMIN, @user.id).count > 1
41+
@user.destroy if User.where("profile = ? and id != ?", User::ADMIN, @user.id).many?
4242
redirect_to admin_users_url
4343
end
4444

app/controllers/articles_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ def set_index_title_and_description(blog, parameters)
154154
def verify_config
155155
if !this_blog.configured?
156156
redirect_to controller: "setup", action: "index"
157-
elsif User.count == 0
157+
elsif User.none?
158158
redirect_to new_user_registration_path
159159
else
160160
true

app/controllers/setup_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def create
2525

2626
sign_in @user
2727

28-
if User.count == 1
28+
if User.one?
2929
create_first_post @user
3030
create_first_page @user
3131
end

app/controllers/users/registrations_controller.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
class Users::RegistrationsController < Devise::RegistrationsController
44
include BlogHelper
5+
56
before_action :require_signup_allowed
67

78
private

app/helpers/admin/base_helper.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def show_actions(item)
4343
end
4444

4545
def display_pagination(collection, cols, _first = "", _last = "")
46-
return if collection.count == 0
46+
return if collection.none?
4747

4848
tag.tr do
4949
tag.td(paginate(collection), class: "paginate", colspan: cols)

app/models/article.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ def publication_month
155155

156156
def self.publication_months
157157
result = select("published_at").where.not(published_at: nil).where(type: "Article")
158-
result.map { |it| [it.publication_month] }.uniq
158+
result.map { [_1.publication_month] }.uniq
159159
end
160160

161161
# Finds one article which was posted on a certain date and matches the

app/models/resource.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
class Resource < ApplicationRecord
77
include StringLengthLimit
8+
89
belongs_to :blog
910
belongs_to :content, optional: true
1011

app/models/user.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,6 @@ def has_twitter_configured?
139139
private
140140

141141
def set_default_profile
142-
self.profile ||= User.count.zero? ? "admin" : "contributor"
142+
self.profile ||= User.none? ? "admin" : "contributor"
143143
end
144144
end

0 commit comments

Comments
 (0)