Fix haml-lint `InstanceVariables` rule for admin/reports/actions (#27339)

This commit is contained in:
Matt Jankowski 2023-10-11 09:58:33 -04:00 committed by GitHub
parent 7d2cd7195b
commit 66becf9a1e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 9 deletions

View File

@ -1,13 +1,13 @@
# This configuration was generated by
# `haml-lint --auto-gen-config`
# on 2023-10-03 08:32:28 -0400 using Haml-Lint version 0.51.0.
# on 2023-10-09 10:24:59 -0400 using Haml-Lint version 0.51.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: 944
# Offense count: 945
LineLength:
enabled: false
@ -26,10 +26,9 @@ linters:
- 'app/views/admin/reports/show.html.haml'
- 'app/views/disputes/strikes/show.html.haml'
# Offense count: 15
# Offense count: 11
InstanceVariables:
exclude:
- 'app/views/admin/reports/_actions.html.haml'
- 'app/views/auth/registrations/_status.html.haml'
- 'app/views/auth/sessions/two_factor/_otp_authentication_form.html.haml'
- 'app/views/relationships/_account.html.haml'

View File

@ -1,11 +1,11 @@
= form_tag preview_admin_report_actions_path(@report), method: :post do
= form_tag preview_admin_report_actions_path(report), method: :post do
.report-actions
.report-actions__item
.report-actions__item__button
= link_to t('admin.reports.mark_as_resolved'), resolve_admin_report_path(@report), method: :post, class: 'button'
= link_to t('admin.reports.mark_as_resolved'), resolve_admin_report_path(report), method: :post, class: 'button'
.report-actions__item__description
= t('admin.reports.actions.resolve_description_html')
- if @statuses.any? { |status| (status.with_media? || status.with_preview_card?) && !status.discarded? }
- if statuses.any? { |status| (status.with_media? || status.with_preview_card?) && !status.discarded? }
.report-actions__item
.report-actions__item__button
= button_tag t('admin.reports.mark_as_sensitive'), name: :mark_as_sensitive, class: 'button'
@ -28,6 +28,6 @@
= t('admin.reports.actions.suspend_description_html')
.report-actions__item
.report-actions__item__button
= link_to t('admin.accounts.custom'), new_admin_account_action_path(@report.target_account_id, report_id: @report.id), class: 'button'
= link_to t('admin.accounts.custom'), new_admin_account_action_path(report.target_account_id, report_id: report.id), class: 'button'
.report-actions__item__description
= t('admin.reports.actions.other_description_html')

View File

@ -179,7 +179,7 @@
%p#actions= t(@report.target_account.local? ? 'admin.reports.actions_description_html' : 'admin.reports.actions_description_remote_html')
= render partial: 'admin/reports/actions'
= render partial: 'admin/reports/actions', locals: { report: @report, statuses: @statuses }
- unless @action_logs.empty?
%hr.spacer/