DEV: Fix various rubocop lints (#24749)

These (21 + 3 from previous PRs) are soon to be enabled in rubocop-discourse:

Capybara/VisibilityMatcher
Lint/DeprecatedOpenSSLConstant
Lint/DisjunctiveAssignmentInConstructor
Lint/EmptyConditionalBody
Lint/EmptyEnsure
Lint/LiteralInInterpolation
Lint/NonLocalExitFromIterator
Lint/ParenthesesAsGroupedExpression
Lint/RedundantCopDisableDirective
Lint/RedundantRequireStatement
Lint/RedundantSafeNavigation
Lint/RedundantStringCoercion
Lint/RedundantWithIndex
Lint/RedundantWithObject
Lint/SafeNavigationChain
Lint/SafeNavigationConsistency
Lint/SelfAssignment
Lint/UnreachableCode
Lint/UselessMethodDefinition
Lint/Void

Previous PRs:
Lint/ShadowedArgument
Lint/DuplicateMethods
Lint/BooleanSymbol
RSpec/SpecFilePathSuffix
This commit is contained in:
Jarek Radosz
2023-12-06 23:25:00 +01:00
committed by GitHub
parent 47f298b2f4
commit 694b5f108b
129 changed files with 196 additions and 274 deletions
@@ -111,7 +111,7 @@ module Chat
def should_create_revision(new_message, prev_message, guardian)
max_seconds = SiteSetting.chat_editing_grace_period
seconds_since_created = Time.now.to_i - new_message&.created_at.iso8601.to_time.to_i
seconds_since_created = Time.now.to_i - new_message&.created_at&.iso8601&.to_time.to_i
return true if seconds_since_created > max_seconds
max_edited_chars =
+1 -1
View File
@@ -38,7 +38,7 @@ module Service
# context.fail!("failure": "something went wrong")
# @return [Context]
def fail!(context = {})
fail(context)
self.fail(context)
raise Failure, self
end