Fix more haml-lint Rubocop (#24107)
This commit is contained in:
		
							parent
							
								
									0b8b0ef652
								
							
						
					
					
						commit
						65669d3c57
					
				| 
						 | 
					@ -1,26 +1,21 @@
 | 
				
			||||||
# This configuration was generated by
 | 
					# This configuration was generated by
 | 
				
			||||||
# `haml-lint --auto-gen-config`
 | 
					# `haml-lint --auto-gen-config`
 | 
				
			||||||
# on 2023-02-11 02:16:03 -0500 using Haml-Lint version 0.45.0.
 | 
					# on 2023-03-15 00:55:01 -0400 using Haml-Lint version 0.45.0.
 | 
				
			||||||
# The point is for the user to remove these configuration records
 | 
					# The point is for the user to remove these configuration records
 | 
				
			||||||
# one by one as the lints are removed from the code base.
 | 
					# one by one as the lints are removed from the code base.
 | 
				
			||||||
# Note that changes in the inspected code, or installation of new
 | 
					# Note that changes in the inspected code, or installation of new
 | 
				
			||||||
# versions of Haml-Lint, may require this file to be generated again.
 | 
					# versions of Haml-Lint, may require this file to be generated again.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
linters:
 | 
					linters:
 | 
				
			||||||
  # Offense count: 76
 | 
					  # Offense count: 63
 | 
				
			||||||
  RuboCop:
 | 
					  RuboCop:
 | 
				
			||||||
    exclude:
 | 
					    exclude:
 | 
				
			||||||
      - 'app/views/accounts/_og.html.haml'
 | 
					      - 'app/views/accounts/_og.html.haml'
 | 
				
			||||||
      - 'app/views/admin/account_actions/new.html.haml'
 | 
					 | 
				
			||||||
      - 'app/views/admin/account_warnings/_account_warning.html.haml'
 | 
					      - 'app/views/admin/account_warnings/_account_warning.html.haml'
 | 
				
			||||||
      - 'app/views/admin/accounts/index.html.haml'
 | 
					      - 'app/views/admin/accounts/index.html.haml'
 | 
				
			||||||
      - 'app/views/admin/accounts/show.html.haml'
 | 
					      - 'app/views/admin/accounts/show.html.haml'
 | 
				
			||||||
      - 'app/views/admin/action_logs/index.html.haml'
 | 
					 | 
				
			||||||
      - 'app/views/admin/announcements/edit.html.haml'
 | 
					      - 'app/views/admin/announcements/edit.html.haml'
 | 
				
			||||||
      - 'app/views/admin/announcements/new.html.haml'
 | 
					      - 'app/views/admin/announcements/new.html.haml'
 | 
				
			||||||
      - 'app/views/admin/change_emails/show.html.haml'
 | 
					 | 
				
			||||||
      - 'app/views/admin/custom_emojis/index.html.haml'
 | 
					 | 
				
			||||||
      - 'app/views/admin/dashboard/index.html.haml'
 | 
					 | 
				
			||||||
      - 'app/views/admin/disputes/appeals/_appeal.html.haml'
 | 
					      - 'app/views/admin/disputes/appeals/_appeal.html.haml'
 | 
				
			||||||
      - 'app/views/admin/domain_blocks/edit.html.haml'
 | 
					      - 'app/views/admin/domain_blocks/edit.html.haml'
 | 
				
			||||||
      - 'app/views/admin/domain_blocks/new.html.haml'
 | 
					      - 'app/views/admin/domain_blocks/new.html.haml'
 | 
				
			||||||
| 
						 | 
					@ -33,40 +28,24 @@ linters:
 | 
				
			||||||
      - 'app/views/admin/settings/appearance/show.html.haml'
 | 
					      - 'app/views/admin/settings/appearance/show.html.haml'
 | 
				
			||||||
      - 'app/views/admin/settings/registrations/show.html.haml'
 | 
					      - 'app/views/admin/settings/registrations/show.html.haml'
 | 
				
			||||||
      - 'app/views/admin/statuses/show.html.haml'
 | 
					      - 'app/views/admin/statuses/show.html.haml'
 | 
				
			||||||
      - 'app/views/application/_card.html.haml'
 | 
					 | 
				
			||||||
      - 'app/views/application/_sidebar.html.haml'
 | 
					 | 
				
			||||||
      - 'app/views/auth/registrations/_sessions.html.haml'
 | 
					 | 
				
			||||||
      - 'app/views/auth/registrations/new.html.haml'
 | 
					      - 'app/views/auth/registrations/new.html.haml'
 | 
				
			||||||
      - 'app/views/auth/sessions/new.html.haml'
 | 
					 | 
				
			||||||
      - 'app/views/disputes/strikes/show.html.haml'
 | 
					      - 'app/views/disputes/strikes/show.html.haml'
 | 
				
			||||||
      - 'app/views/filters/_filter_fields.html.haml'
 | 
					      - 'app/views/filters/_filter_fields.html.haml'
 | 
				
			||||||
      - 'app/views/invites/_form.html.haml'
 | 
					      - 'app/views/invites/_form.html.haml'
 | 
				
			||||||
      - 'app/views/layouts/application.html.haml'
 | 
					      - 'app/views/layouts/application.html.haml'
 | 
				
			||||||
      - 'app/views/layouts/error.html.haml'
 | 
					      - 'app/views/layouts/error.html.haml'
 | 
				
			||||||
      - 'app/views/layouts/mailer.html.haml'
 | 
					 | 
				
			||||||
      - 'app/views/notification_mailer/_status.html.haml'
 | 
					      - 'app/views/notification_mailer/_status.html.haml'
 | 
				
			||||||
      - 'app/views/notification_mailer/favourite.html.haml'
 | 
					 | 
				
			||||||
      - 'app/views/notification_mailer/follow_request.html.haml'
 | 
					 | 
				
			||||||
      - 'app/views/oauth/authorizations/new.html.haml'
 | 
					 | 
				
			||||||
      - 'app/views/oauth/authorized_applications/index.html.haml'
 | 
					 | 
				
			||||||
      - 'app/views/settings/applications/_fields.html.haml'
 | 
					      - 'app/views/settings/applications/_fields.html.haml'
 | 
				
			||||||
      - 'app/views/settings/imports/show.html.haml'
 | 
					      - 'app/views/settings/imports/show.html.haml'
 | 
				
			||||||
      - 'app/views/settings/login_activities/_login_activity.html.haml'
 | 
					 | 
				
			||||||
      - 'app/views/settings/preferences/appearance/show.html.haml'
 | 
					      - 'app/views/settings/preferences/appearance/show.html.haml'
 | 
				
			||||||
      - 'app/views/settings/preferences/other/show.html.haml'
 | 
					      - 'app/views/settings/preferences/other/show.html.haml'
 | 
				
			||||||
      - 'app/views/settings/preferences/other/show.html.haml'
 | 
					 | 
				
			||||||
      - 'app/views/statuses_cleanup/show.html.haml'
 | 
					 | 
				
			||||||
      - 'app/views/statuses/_detailed_status.html.haml'
 | 
					      - 'app/views/statuses/_detailed_status.html.haml'
 | 
				
			||||||
      - 'app/views/statuses/_og_image.html.haml'
 | 
					 | 
				
			||||||
      - 'app/views/statuses/_poll.html.haml'
 | 
					      - 'app/views/statuses/_poll.html.haml'
 | 
				
			||||||
      - 'app/views/statuses/_status.html.haml'
 | 
					 | 
				
			||||||
      - 'app/views/statuses/show.html.haml'
 | 
					      - 'app/views/statuses/show.html.haml'
 | 
				
			||||||
      - 'app/views/user_mailer/suspicious_sign_in.html.haml'
 | 
					      - 'app/views/statuses_cleanup/show.html.haml'
 | 
				
			||||||
      - 'app/views/user_mailer/warning.html.haml'
 | 
					      - 'app/views/user_mailer/warning.html.haml'
 | 
				
			||||||
      - 'app/views/user_mailer/webauthn_credential_added.html.haml'
 | 
					 | 
				
			||||||
      - 'app/views/user_mailer/webauthn_credential_deleted.html.haml'
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
  # Offense count: 918
 | 
					  # Offense count: 913
 | 
				
			||||||
  LineLength:
 | 
					  LineLength:
 | 
				
			||||||
    enabled: false
 | 
					    enabled: false
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -97,13 +76,12 @@ linters:
 | 
				
			||||||
      - 'app/views/admin/reports/show.html.haml'
 | 
					      - 'app/views/admin/reports/show.html.haml'
 | 
				
			||||||
      - 'app/views/disputes/strikes/show.html.haml'
 | 
					      - 'app/views/disputes/strikes/show.html.haml'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  # Offense count: 43
 | 
					  # Offense count: 41
 | 
				
			||||||
  InstanceVariables:
 | 
					  InstanceVariables:
 | 
				
			||||||
    exclude:
 | 
					    exclude:
 | 
				
			||||||
      - 'app/views/admin/reports/_actions.html.haml'
 | 
					      - 'app/views/admin/reports/_actions.html.haml'
 | 
				
			||||||
      - 'app/views/admin/roles/_form.html.haml'
 | 
					      - 'app/views/admin/roles/_form.html.haml'
 | 
				
			||||||
      - 'app/views/admin/webhooks/_form.html.haml'
 | 
					      - 'app/views/admin/webhooks/_form.html.haml'
 | 
				
			||||||
      - 'app/views/application/_sidebar.html.haml'
 | 
					 | 
				
			||||||
      - 'app/views/auth/registrations/_sessions.html.haml'
 | 
					      - 'app/views/auth/registrations/_sessions.html.haml'
 | 
				
			||||||
      - 'app/views/auth/registrations/_status.html.haml'
 | 
					      - 'app/views/auth/registrations/_status.html.haml'
 | 
				
			||||||
      - 'app/views/auth/sessions/two_factor/_otp_authentication_form.html.haml'
 | 
					      - 'app/views/auth/sessions/two_factor/_otp_authentication_form.html.haml'
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -9,4 +9,4 @@
 | 
				
			||||||
    = f.input :unconfirmed_email, wrapper: :with_label, label: t('admin.accounts.change_email.new_email')
 | 
					    = f.input :unconfirmed_email, wrapper: :with_label, label: t('admin.accounts.change_email.new_email')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  .actions
 | 
					  .actions
 | 
				
			||||||
    = f.button :submit, class: "button", value: t('admin.accounts.change_email.submit')
 | 
					    = f.button :submit, class: 'button', value: t('admin.accounts.change_email.submit')
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -20,7 +20,7 @@
 | 
				
			||||||
            %span{ title: session.user_agent }<
 | 
					            %span{ title: session.user_agent }<
 | 
				
			||||||
              = fa_icon "#{session_device_icon(session)} fw", 'aria-label': session_device_icon(session)
 | 
					              = fa_icon "#{session_device_icon(session)} fw", 'aria-label': session_device_icon(session)
 | 
				
			||||||
              = ' '
 | 
					              = ' '
 | 
				
			||||||
              = t 'sessions.description', browser: t("sessions.browsers.#{session.browser}", default: "#{session.browser}"), platform: t("sessions.platforms.#{session.platform}", default: "#{session.platform}")
 | 
					              = t 'sessions.description', browser: t("sessions.browsers.#{session.browser}", default: session.browser.to_s), platform: t("sessions.platforms.#{session.platform}", default: session.platform.to_s)
 | 
				
			||||||
          %td
 | 
					          %td
 | 
				
			||||||
            %samp= session.ip
 | 
					            %samp= session.ip
 | 
				
			||||||
          %td
 | 
					          %td
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -19,7 +19,7 @@
 | 
				
			||||||
    .actions
 | 
					    .actions
 | 
				
			||||||
      = f.button :button, t('auth.login'), type: :submit
 | 
					      = f.button :button, t('auth.login'), type: :submit
 | 
				
			||||||
 | 
					
 | 
				
			||||||
- if devise_mapping.omniauthable? and resource_class.omniauth_providers.any?
 | 
					- if devise_mapping.omniauthable? && resource_class.omniauth_providers.any?
 | 
				
			||||||
  .simple_form.alternative-login
 | 
					  .simple_form.alternative-login
 | 
				
			||||||
    %h4= omniauth_only? ? t('auth.log_in_with') : t('auth.or_log_in_with')
 | 
					    %h4= omniauth_only? ? t('auth.log_in_with') : t('auth.or_log_in_with')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -35,7 +35,7 @@
 | 
				
			||||||
                %tbody
 | 
					                %tbody
 | 
				
			||||||
                  %tr
 | 
					                  %tr
 | 
				
			||||||
                    %td.content-cell.content-end
 | 
					                    %td.content-cell.content-end
 | 
				
			||||||
                      != "  "
 | 
					                      != '  '
 | 
				
			||||||
                  %tr
 | 
					                  %tr
 | 
				
			||||||
                    %td.blank-cell.footer
 | 
					                    %td.blank-cell.footer
 | 
				
			||||||
                      .email-row
 | 
					                      .email-row
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -39,5 +39,5 @@
 | 
				
			||||||
                            %tbody
 | 
					                            %tbody
 | 
				
			||||||
                              %tr
 | 
					                              %tr
 | 
				
			||||||
                                %td.button-primary
 | 
					                                %td.button-primary
 | 
				
			||||||
                                  = link_to web_url("follow_requests") do
 | 
					                                  = link_to web_url('follow_requests') do
 | 
				
			||||||
                                    %span= t 'notification_mailer.follow_request.action'
 | 
					                                    %span= t 'notification_mailer.follow_request.action'
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,6 @@
 | 
				
			||||||
- method_str = content_tag(:span, login_activity.omniauth? ? t(login_activity.provider, scope: 'auth.providers') : t(login_activity.authentication_method, scope: 'login_activities.authentication_methods'), class: 'target')
 | 
					- method_str = content_tag(:span, login_activity.omniauth? ? t(login_activity.provider, scope: 'auth.providers') : t(login_activity.authentication_method, scope: 'login_activities.authentication_methods'), class: 'target')
 | 
				
			||||||
- ip_str = content_tag(:span, login_activity.ip, class: 'target')
 | 
					- ip_str = content_tag(:span, login_activity.ip, class: 'target')
 | 
				
			||||||
- browser_str = content_tag(:span, t('sessions.description', browser: t("sessions.browsers.#{login_activity.browser}", default: "#{login_activity.browser}"), platform: t("sessions.platforms.#{login_activity.platform}", default: "#{login_activity.platform}")), class: 'target', title: login_activity.user_agent)
 | 
					- browser_str = content_tag(:span, t('sessions.description', browser: t("sessions.browsers.#{login_activity.browser}", default: login_activity.browser.to_s), platform: t("sessions.platforms.#{login_activity.platform}", default: login_activity.platform.to_)), class: 'target', title: login_activity.user_agent)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
.log-entry
 | 
					.log-entry
 | 
				
			||||||
  .log-entry__header
 | 
					  .log-entry__header
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -13,7 +13,7 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  - unless I18n.locale == :en
 | 
					  - unless I18n.locale == :en
 | 
				
			||||||
    .flash-message.translation-prompt
 | 
					    .flash-message.translation-prompt
 | 
				
			||||||
      #{t 'appearance.localization.body'} #{content_tag(:a, t('appearance.localization.guide_link_text'), href: t('appearance.localization.guide_link'), target: "_blank", rel: "noopener")}
 | 
					      #{t 'appearance.localization.body'} #{content_tag(:a, t('appearance.localization.guide_link_text'), href: t('appearance.localization.guide_link'), target: '_blank', rel: 'noopener')}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  %h4= t 'appearance.advanced_web_interface'
 | 
					  %h4= t 'appearance.advanced_web_interface'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -62,18 +62,18 @@
 | 
				
			||||||
      - else
 | 
					      - else
 | 
				
			||||||
        = fa_icon('reply-all')
 | 
					        = fa_icon('reply-all')
 | 
				
			||||||
      %span.detailed-status__reblogs>= friendly_number_to_human status.replies_count
 | 
					      %span.detailed-status__reblogs>= friendly_number_to_human status.replies_count
 | 
				
			||||||
      = " "
 | 
					      = ' '
 | 
				
			||||||
    ·
 | 
					    ·
 | 
				
			||||||
    - if status.public_visibility? || status.unlisted_visibility?
 | 
					    - if status.public_visibility? || status.unlisted_visibility?
 | 
				
			||||||
      %span.detailed-status__link
 | 
					      %span.detailed-status__link
 | 
				
			||||||
        = fa_icon('retweet')
 | 
					        = fa_icon('retweet')
 | 
				
			||||||
        %span.detailed-status__reblogs>= friendly_number_to_human status.reblogs_count
 | 
					        %span.detailed-status__reblogs>= friendly_number_to_human status.reblogs_count
 | 
				
			||||||
        = " "
 | 
					        = ' '
 | 
				
			||||||
      ·
 | 
					      ·
 | 
				
			||||||
    %span.detailed-status__link
 | 
					    %span.detailed-status__link
 | 
				
			||||||
      = fa_icon('star')
 | 
					      = fa_icon('star')
 | 
				
			||||||
      %span.detailed-status__favorites>= friendly_number_to_human status.favourites_count
 | 
					      %span.detailed-status__favorites>= friendly_number_to_human status.favourites_count
 | 
				
			||||||
      = " "
 | 
					      = ' '
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    - if user_signed_in?
 | 
					    - if user_signed_in?
 | 
				
			||||||
      ·
 | 
					      ·
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -11,7 +11,7 @@
 | 
				
			||||||
  h_class           = microformats_h_class(status, is_predecessor, is_successor, include_threads)
 | 
					  h_class           = microformats_h_class(status, is_predecessor, is_successor, include_threads)
 | 
				
			||||||
  style_classes     = style_classes(status, is_predecessor, is_successor, include_threads)
 | 
					  style_classes     = style_classes(status, is_predecessor, is_successor, include_threads)
 | 
				
			||||||
  mf_classes        = microformats_classes(status, is_direct_parent, is_direct_child)
 | 
					  mf_classes        = microformats_classes(status, is_direct_parent, is_direct_child)
 | 
				
			||||||
  entry_classes     = h_class + ' ' + mf_classes + ' ' + style_classes
 | 
					  entry_classes     = "#{h_class} #{mf_classes} #{style_classes}"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
- if status.reply? && include_threads
 | 
					- if status.reply? && include_threads
 | 
				
			||||||
  - if @next_ancestor
 | 
					  - if @next_ancestor
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -45,7 +45,7 @@
 | 
				
			||||||
                                = @remote_ip
 | 
					                                = @remote_ip
 | 
				
			||||||
                                %br/
 | 
					                                %br/
 | 
				
			||||||
                                %strong= "#{t('sessions.browser')}:"
 | 
					                                %strong= "#{t('sessions.browser')}:"
 | 
				
			||||||
                                %span{ title: @user_agent }= t 'sessions.description', browser: t("sessions.browsers.#{@detection.id}", default: "#{@detection.id}"), platform: t("sessions.platforms.#{@detection.platform.id}", default: "#{@detection.platform.id}")
 | 
					                                %span{ title: @user_agent }= t 'sessions.description', browser: t("sessions.browsers.#{@detection.id}", default: @detection.id.to_s), platform: t("sessions.platforms.#{@detection.platform.id}", default: @detection.platform.id.to_s)
 | 
				
			||||||
                                %br/
 | 
					                                %br/
 | 
				
			||||||
                                = l(@timestamp)
 | 
					                                = l(@timestamp)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -20,7 +20,7 @@
 | 
				
			||||||
                                      = image_tag full_pack_url('media/images/mailer/icon_lock_open.png'), alt: ''
 | 
					                                      = image_tag full_pack_url('media/images/mailer/icon_lock_open.png'), alt: ''
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                              %h1= t 'devise.mailer.webauthn_credential.added.title'
 | 
					                              %h1= t 'devise.mailer.webauthn_credential.added.title'
 | 
				
			||||||
                              %p.lead= "#{t 'devise.mailer.webauthn_credential.added.explanation' }:"
 | 
					                              %p.lead= "#{t('devise.mailer.webauthn_credential.added.explanation')}:"
 | 
				
			||||||
                              %p.lead= @webauthn_credential.nickname
 | 
					                              %p.lead= @webauthn_credential.nickname
 | 
				
			||||||
 | 
					
 | 
				
			||||||
%table.email-table{ cellspacing: 0, cellpadding: 0 }
 | 
					%table.email-table{ cellspacing: 0, cellpadding: 0 }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -20,7 +20,7 @@
 | 
				
			||||||
                                      = image_tag full_pack_url('media/images/mailer/icon_lock_open.png'), alt: ''
 | 
					                                      = image_tag full_pack_url('media/images/mailer/icon_lock_open.png'), alt: ''
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                              %h1= t 'devise.mailer.webauthn_credential.deleted.title'
 | 
					                              %h1= t 'devise.mailer.webauthn_credential.deleted.title'
 | 
				
			||||||
                              %p.lead= "#{t 'devise.mailer.webauthn_credential.deleted.explanation' }:"
 | 
					                              %p.lead= "#{t('devise.mailer.webauthn_credential.deleted.explanation')}:"
 | 
				
			||||||
                              %p.lead= @webauthn_credential.nickname
 | 
					                              %p.lead= @webauthn_credential.nickname
 | 
				
			||||||
 | 
					
 | 
				
			||||||
%table.email-table{ cellspacing: 0, cellpadding: 0 }
 | 
					%table.email-table{ cellspacing: 0, cellpadding: 0 }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue