Fix haml-lint Rubocop `Style/NumericPredicate` cop (#26040)

local
Matt Jankowski 10 months ago committed by GitHub
parent 586b1c9dca
commit df05ece265
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      .haml-lint_todo.yml
  2. 2
      app/views/notification_mailer/_status.html.haml
  3. 2
      app/views/statuses/_poll.html.haml

@ -1,13 +1,13 @@
# This configuration was generated by
# `haml-lint --auto-gen-config`
# on 2023-07-18 12:15:07 -0400 using Haml-Lint version 0.48.0.
# on 2023-07-19 06:41:20 -0400 using Haml-Lint version 0.48.0.
# The point is for the user to remove these configuration records
# one by one as the lints are removed from the code base.
# Note that changes in the inspected code, or installation of new
# versions of Haml-Lint, may require this file to be generated again.
linters:
# Offense count: 950
# Offense count: 951
LineLength:
enabled: false
@ -15,7 +15,7 @@ linters:
UnnecessaryStringOutput:
enabled: false
# Offense count: 62
# Offense count: 59
RuboCop:
enabled: false

@ -33,7 +33,7 @@
.auto-dir
= status_content_format(status)
- if status.ordered_media_attachments.size > 0
- if status.ordered_media_attachments.size.positive?
%p
- status.ordered_media_attachments.each do |a|
- if status.local?

@ -8,7 +8,7 @@
- poll.loaded_options.each_with_index do |option, index|
%li
- if show_results
- percent = total_votes_count > 0 ? 100 * option.votes_count / total_votes_count : 0
- percent = total_votes_count.positive? ? 100 * option.votes_count / total_votes_count : 0
%label.poll__option><
%span.poll__number><
= "#{percent.round}%"

Loading…
Cancel
Save