Skip to content

Commit

Permalink
Fix haml-lint ConsecutiveSilentScripts rule (#26043)
Browse files Browse the repository at this point in the history
  • Loading branch information
mjankowski committed Jul 18, 2023
1 parent 6245cec commit e663e6d
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 20 deletions.
9 changes: 1 addition & 8 deletions .haml-lint_todo.yml
@@ -1,6 +1,6 @@
# This configuration was generated by
# `haml-lint --auto-gen-config`
# on 2023-07-17 12:00:21 -0400 using Haml-Lint version 0.48.0.
# on 2023-07-17 15:30:11 -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
Expand Down Expand Up @@ -41,13 +41,6 @@ linters:
- 'app/views/shared/_og.html.haml'
- 'app/views/statuses/_status.html.haml'

# Offense count: 6
ConsecutiveSilentScripts:
exclude:
- 'app/views/admin/settings/shared/_links.html.haml'
- 'app/views/settings/login_activities/_login_activity.html.haml'
- 'app/views/statuses/_poll.html.haml'

# Offense count: 3
IdNames:
exclude:
Expand Down
13 changes: 7 additions & 6 deletions app/views/admin/settings/shared/_links.html.haml
@@ -1,8 +1,9 @@
.content__heading__tabs
= render_navigation renderer: :links do |primary|
- primary.item :branding, safe_join([fa_icon('pencil fw'), t('admin.settings.branding.title')]), admin_settings_branding_path
- primary.item :about, safe_join([fa_icon('file-text fw'), t('admin.settings.about.title')]), admin_settings_about_path
- primary.item :registrations, safe_join([fa_icon('users fw'), t('admin.settings.registrations.title')]), admin_settings_registrations_path
- primary.item :discovery, safe_join([fa_icon('search fw'), t('admin.settings.discovery.title')]), admin_settings_discovery_path
- primary.item :content_retention, safe_join([fa_icon('history fw'), t('admin.settings.content_retention.title')]), admin_settings_content_retention_path
- primary.item :appearance, safe_join([fa_icon('desktop fw'), t('admin.settings.appearance.title')]), admin_settings_appearance_path
:ruby
primary.item :branding, safe_join([fa_icon('pencil fw'), t('admin.settings.branding.title')]), admin_settings_branding_path
primary.item :about, safe_join([fa_icon('file-text fw'), t('admin.settings.about.title')]), admin_settings_about_path
primary.item :registrations, safe_join([fa_icon('users fw'), t('admin.settings.registrations.title')]), admin_settings_registrations_path
primary.item :discovery, safe_join([fa_icon('search fw'), t('admin.settings.discovery.title')]), admin_settings_discovery_path
primary.item :content_retention, safe_join([fa_icon('history fw'), t('admin.settings.content_retention.title')]), admin_settings_content_retention_path
primary.item :appearance, safe_join([fa_icon('desktop fw'), t('admin.settings.appearance.title')]), admin_settings_appearance_path
7 changes: 4 additions & 3 deletions app/views/settings/login_activities/_login_activity.html.haml
@@ -1,6 +1,7 @@
- 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')
- 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_s)), class: 'target', title: login_activity.user_agent)
:ruby
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')
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_s)), class: 'target', title: login_activity.user_agent)

.log-entry
.log-entry__header
Expand Down
7 changes: 4 additions & 3 deletions app/views/statuses/_poll.html.haml
@@ -1,6 +1,7 @@
- show_results = (user_signed_in? && poll.voted?(current_account)) || poll.expired?
- own_votes = user_signed_in? ? poll.own_votes(current_account) : []
- total_votes_count = poll.voters_count || poll.votes_count
:ruby
show_results = (user_signed_in? && poll.voted?(current_account)) || poll.expired?
own_votes = user_signed_in? ? poll.own_votes(current_account) : []
total_votes_count = poll.voters_count || poll.votes_count

.poll
%ul
Expand Down

0 comments on commit e663e6d

Please sign in to comment.