Commit b5f78ed8 authored by Sean McGivern's avatar Sean McGivern

Merge branch 'rs-haml-lint-useless-assignment-ee' into 'master'

Enable `Lint/UselessAssignment` for haml-lint

See merge request gitlab-org/gitlab-ee!7156
parents 180c091c 9a6cf234
...@@ -113,7 +113,6 @@ linters: ...@@ -113,7 +113,6 @@ linters:
- Lint/ParenthesesAsGroupedExpression - Lint/ParenthesesAsGroupedExpression
- Lint/RedundantWithIndex - Lint/RedundantWithIndex
- Lint/Syntax - Lint/Syntax
- Lint/UselessAssignment
- Metrics/BlockNesting - Metrics/BlockNesting
- Naming/VariableName - Naming/VariableName
- Performance/RedundantMatch - Performance/RedundantMatch
......
- grouped_emojis = awardable.grouped_awards(with_thumbs: inline) - grouped_emojis = awardable.grouped_awards(with_thumbs: inline)
- user_authored = awardable.user_authored?(current_user)
.awards.js-awards-block{ class: ("hidden" if !inline && grouped_emojis.empty?), data: { award_url: toggle_award_url(awardable) } } .awards.js-awards-block{ class: ("hidden" if !inline && grouped_emojis.empty?), data: { award_url: toggle_award_url(awardable) } }
- awards_sort(grouped_emojis).each do |emoji, awards| - awards_sort(grouped_emojis).each do |emoji, awards|
%button.btn.award-control.js-emoji-btn.has-tooltip{ type: "button", %button.btn.award-control.js-emoji-btn.has-tooltip{ type: "button",
......
- diff_file = discussion.diff_file - diff_file = discussion.diff_file
- blob = discussion.blob
- discussions = { discussion.original_line_code => [discussion] }
- diff_file_class = diff_file.text? ? 'text-file' : 'js-image-file' - diff_file_class = diff_file.text? ? 'text-file' : 'js-image-file'
- diff_data = {} - diff_data = {}
- expanded = discussion.expanded? || local_assigns.fetch(:expanded, nil) - expanded = discussion.expanded? || local_assigns.fetch(:expanded, nil)
......
- submit_btn_css ||= 'btn btn-link btn-remove'
- if defined?(token) - if defined?(token)
- path = oauth_authorized_application_path(0, token_id: token) - path = oauth_authorized_application_path(0, token_id: token)
- else - else
......
- if controller.controller_path =~ /^groups/ && @group.persisted?
- label = _('This group')
- if controller.controller_path =~ /^projects/ && @project.persisted?
- label = _('This project')
- if @group && @group.persisted? && @group.path - if @group && @group.persisted? && @group.path
- group_data_attrs = { group_path: j(@group.path), name: @group.name, issues_path: issues_group_path(j(@group.path)), mr_path: merge_requests_group_path(j(@group.path)) } - group_data_attrs = { group_path: j(@group.path), name: @group.name, issues_path: issues_group_path(j(@group.path)), mr_path: merge_requests_group_path(j(@group.path)) }
- if @project && @project.persisted? - if @project && @project.persisted?
......
- page_title = _("Explore") - page_title _("Explore")
- unless current_user - unless current_user
- header_title = _("Explore GitLab"), explore_root_path - header_title _("Explore GitLab"), explore_root_path
= render template: "layouts/application" = render template: "layouts/application"
- page_title = _("Settings") - page_title _("Settings")
- nav "group" - nav "group"
= render template: "layouts/group" = render template: "layouts/group"
- empty_repo = @project.empty_repo? - empty_repo = @project.empty_repo?
- fork_network = @project.fork_network
.project-home-panel.text-center{ class: ("empty-project" if empty_repo) } .project-home-panel.text-center{ class: ("empty-project" if empty_repo) }
.limit-container-width{ class: container_class } .limit-container-width{ class: container_class }
.avatar-container.s70.project-avatar .avatar-container.s70.project-avatar
......
- form = local_assigns.fetch(:form) - form = local_assigns.fetch(:form)
- project = local_assigns.fetch(:project)
.form-group .form-group
= label_tag :merge_method_merge, class: 'label-bold' do = label_tag :merge_method_merge, class: 'label-bold' do
......
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
- diff_file.parallel_diff_lines.each do |line| - diff_file.parallel_diff_lines.each do |line|
- left = line[:left] - left = line[:left]
- right = line[:right] - right = line[:right]
- last_line = right.new_pos if right
- discussions_left, discussions_right = parallel_diff_discussions(left, right, diff_file) - discussions_left, discussions_right = parallel_diff_discussions(left, right, diff_file)
%tr.line_holder.parallel %tr.line_holder.parallel
- if left - if left
......
- blob = diff_file.blob - blob = diff_file.blob
- old_blob = diff_file.old_blob
- blob_raw_url = diff_file_blob_raw_url(diff_file) - blob_raw_url = diff_file_blob_raw_url(diff_file)
- old_blob_raw_url = diff_file_old_blob_raw_url(diff_file)
- click_to_comment = local_assigns.fetch(:click_to_comment, true) - click_to_comment = local_assigns.fetch(:click_to_comment, true)
- diff_view_data = local_assigns.fetch(:diff_view_data, '') - diff_view_data = local_assigns.fetch(:diff_view_data, '')
- class_name = '' - class_name = ''
......
- @no_container = true - @no_container = true
- page_title "Labels" - page_title "Labels"
- can_admin_label = can?(current_user, :admin_label, @project) - can_admin_label = can?(current_user, :admin_label, @project)
- hide_class = ''
- search = params[:search] - search = params[:search]
- if can_admin_label - if can_admin_label
......
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
- @hide_top_links = true - @hide_top_links = true
- page_title 'New Project' - page_title 'New Project'
- header_title "Projects", dashboard_projects_path - header_title "Projects", dashboard_projects_path
- visibility_level = params.dig(:project, :visibility_level) || default_project_visibility
- active_tab = local_assigns.fetch(:active_tab, 'blank') - active_tab = local_assigns.fetch(:active_tab, 'blank')
.project-edit-container .project-edit-container
......
...@@ -38,7 +38,6 @@ ...@@ -38,7 +38,6 @@
- if can?(current_user, :award_emoji, note) - if can?(current_user, :award_emoji, note)
- if note.emoji_awardable? - if note.emoji_awardable?
- user_authored = note.user_authored?(current_user)
.note-actions-item .note-actions-item
= button_tag title: 'Add reaction', class: "note-action-button note-emoji-button js-add-award js-note-emoji} has-tooltip btn btn-transparent", data: { position: 'right', container: 'body' } do = button_tag title: 'Add reaction', class: "note-action-button note-emoji-button js-add-award js-note-emoji} has-tooltip btn btn-transparent", data: { position: 'right', container: 'body' } do
= icon('spinner spin') = icon('spinner spin')
......
- breadcrumb_title "Pipelines" - breadcrumb_title "Pipelines"
- page_title = s_("Pipeline|Run Pipeline") - page_title s_("Pipeline|Run Pipeline")
- settings_link = link_to _('CI/CD settings'), project_settings_ci_cd_path(@project) - settings_link = link_to _('CI/CD settings'), project_settings_ci_cd_path(@project)
%h3.page-title %h3.page-title
......
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
%fieldset.builds-feature.js-auto-devops-settings %fieldset.builds-feature.js-auto-devops-settings
.form-group .form-group
- message = auto_devops_warning_message(@project) - message = auto_devops_warning_message(@project)
- ci_file_formatted = '<code>.gitlab-ci.yml</code>'.html_safe
- if message - if message
%p.auto-devops-warning-message.settings-message.text-center %p.auto-devops-warning-message.settings-message.text-center
= message.html_safe = message.html_safe
......
...@@ -4,9 +4,6 @@ ...@@ -4,9 +4,6 @@
- use_label_priority = local_assigns.fetch(:use_label_priority, false) - use_label_priority = local_assigns.fetch(:use_label_priority, false)
- force_priority = local_assigns.fetch(:force_priority, use_label_priority ? label.priority.present? : false) - force_priority = local_assigns.fetch(:force_priority, use_label_priority ? label.priority.present? : false)
- toggle_subscription_path = toggle_subscription_label_path(label, @project) if current_user - toggle_subscription_path = toggle_subscription_label_path(label, @project) if current_user
- show_label_epics_link = @group&.feature_available?(:epics)
- show_label_merge_requests_link = show_label_issuables_link?(label, :merge_requests, project: @project)
- show_label_issues_link = show_label_issuables_link?(label, :issues, project: @project)
- tooltip_title = label_status_tooltip(label, status) if status - tooltip_title = label_status_tooltip(label, status) if status
%li.label-list-item{ id: label_css_id, data: { id: label.id } } %li.label-list-item{ id: label_css_id, data: { id: label.id } }
......
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
- if stage.status - if stage.status
- detailed_status = stage.detailed_status(current_user) - detailed_status = stage.detailed_status(current_user)
- icon_status = "#{detailed_status.icon}_borderless" - icon_status = "#{detailed_status.icon}_borderless"
- status_klass = "ci-status-icon ci-status-icon-#{detailed_status.group}"
.stage-container.dropdown{ class: klass } .stage-container.dropdown{ class: klass }
%button.mini-pipeline-graph-dropdown-toggle.has-tooltip.js-builds-dropdown-button{ class: "ci-status-icon-#{detailed_status.group}", type: 'button', data: { toggle: 'dropdown', title: "#{stage.name}: #{detailed_status.label}", placement: 'top', "stage-endpoint" => stage_ajax_project_pipeline_path(pipeline.project, pipeline, stage: stage.name) } } %button.mini-pipeline-graph-dropdown-toggle.has-tooltip.js-builds-dropdown-button{ class: "ci-status-icon-#{detailed_status.group}", type: 'button', data: { toggle: 'dropdown', title: "#{stage.name}: #{detailed_status.label}", placement: 'top', "stage-endpoint" => stage_ajax_project_pipeline_path(pipeline.project, pipeline, stage: stage.name) } }
......
- show_create = local_assigns.fetch(:show_create, false)
- dropdown_toggle_text = @ref || @project.default_branch - dropdown_toggle_text = @ref || @project.default_branch
= form_tag switch_project_refs_path(@project), method: :get, class: "project-refs-form" do = form_tag switch_project_refs_path(@project), method: :get, class: "project-refs-form" do
= hidden_field_tag :destination, destination = hidden_field_tag :destination, destination
......
- boards_page = controller.controller_name == 'boards'
.issues-filters .issues-filters
.issues-details-filters.row-content-block.second-block .issues-details-filters.row-content-block.second-block
= form_tag page_filter_path(without: [:assignee_id, :author_id, :milestone_title, :label_name, :search]), method: :get, class: 'filter-form js-filter-form' do = form_tag page_filter_path(without: [:assignee_id, :author_id, :milestone_title, :label_name, :search]), method: :get, class: 'filter-form js-filter-form' do
......
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
- data_options = local_assigns.fetch(:data_options, {}) - data_options = local_assigns.fetch(:data_options, {})
- classes = local_assigns.fetch(:classes, []) - classes = local_assigns.fetch(:classes, [])
- selected = local_assigns.fetch(:selected, nil) - selected = local_assigns.fetch(:selected, nil)
- selected_toggle = local_assigns.fetch(:selected_toggle, nil)
- dropdown_title = local_assigns.fetch(:dropdown_title, "Filter by label") - dropdown_title = local_assigns.fetch(:dropdown_title, "Filter by label")
- dropdown_data = {toggle: 'dropdown', field_name: "label_name[]", show_no: "true", show_any: "true", namespace_path: @project.try(:namespace).try(:full_path), project_path: @project.try(:path), labels: labels_filter_path, default_label: "Labels"} - dropdown_data = {toggle: 'dropdown', field_name: "label_name[]", show_no: "true", show_any: "true", namespace_path: @project.try(:namespace).try(:full_path), project_path: @project.try(:path), labels: labels_filter_path, default_label: "Labels"}
- dropdown_data.merge!(data_options) - dropdown_data.merge!(data_options)
......
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
- return unless can?(current_user, :"admin_#{issuable.to_ability_name}", issuable.project) - return unless can?(current_user, :"admin_#{issuable.to_ability_name}", issuable.project)
- has_due_date = issuable.has_attribute?(:due_date) - has_due_date = issuable.has_attribute?(:due_date)
- has_labels = @labels && @labels.any?
- form = local_assigns.fetch(:form) - form = local_assigns.fetch(:form)
%hr %hr
......
- avatar = true unless local_assigns[:avatar] == false - avatar = true unless local_assigns[:avatar] == false
- stars = true unless local_assigns[:stars] == false - stars = true unless local_assigns[:stars] == false
- forks = false unless local_assigns[:forks] == true - forks = false unless local_assigns[:forks] == true
- ci = false unless local_assigns[:ci] == true
- skip_namespace = false unless local_assigns[:skip_namespace] == true - skip_namespace = false unless local_assigns[:skip_namespace] == true
- user = local_assigns[:user]
- access = max_project_member_access(project) - access = max_project_member_access(project)
- css_class = '' unless local_assigns[:css_class] - css_class = '' unless local_assigns[:css_class]
- show_last_commit_as_description = false unless local_assigns[:show_last_commit_as_description] == true && can_show_last_commit_in_list?(project) - show_last_commit_as_description = false unless local_assigns[:show_last_commit_as_description] == true && can_show_last_commit_in_list?(project)
......
- if current_user - if current_user
- if note.emoji_awardable? - if note.emoji_awardable?
- user_authored = note.user_authored?(current_user)
.note-actions-item .note-actions-item
= link_to '#', title: 'Add reaction', class: "note-action-button note-emoji-button js-add-award js-note-emoji has-tooltip", data: { position: 'right' } do = link_to '#', title: 'Add reaction', class: "note-action-button note-emoji-button js-add-award js-note-emoji has-tooltip", data: { position: 'right' } do
= icon('spinner spin') = icon('spinner spin')
......
- page_title = _('SAML SSO for %{group_name}') % { group_name: @group_name } - page_title _('SAML SSO for %{group_name}') % { group_name: @group_name }
= render 'devise/shared/tab_single', tab_title: _('SAML SSO') = render 'devise/shared/tab_single', tab_title: _('SAML SSO')
.login-box .login-box
......
- import_data = f.object - import_data = f.object
- regen_data = { auth_method: 'ssh_public_key', regenerate_ssh_private_key: true } - regen_data = { auth_method: 'ssh_public_key', regenerate_ssh_private_key: true }
- ssh_key_auth = import_data.ssh_key_auth?
- ssh_public_key_present = import_data.ssh_public_key.present? - ssh_public_key_present = import_data.ssh_public_key.present?
.form-group .form-group
......
- add_to_breadcrumbs _("Settings"), edit_project_path(@project) - add_to_breadcrumbs _("Settings"), edit_project_path(@project)
- add_to_breadcrumbs _("Integrations"), project_settings_integrations_path(@project) - add_to_breadcrumbs _("Integrations"), project_settings_integrations_path(@project)
- add_to_breadcrumbs "Prometheus", edit_project_service_path(@project, PrometheusService) - add_to_breadcrumbs "Prometheus", edit_project_service_path(@project, PrometheusService)
- breadcrumb_title = s_('Metrics|Edit metric') - breadcrumb_title s_('Metrics|Edit metric')
- page_title @metric.title, s_('Metrics|Edit metric') - page_title @metric.title, s_('Metrics|Edit metric')
= render 'form', project: @project, metric: @metric = render 'form', project: @project, metric: @metric
- add_to_breadcrumbs _("Settings"), edit_project_path(@project) - add_to_breadcrumbs _("Settings"), edit_project_path(@project)
- add_to_breadcrumbs _("Integrations"), project_settings_integrations_path(@project) - add_to_breadcrumbs _("Integrations"), project_settings_integrations_path(@project)
- add_to_breadcrumbs "Prometheus", edit_project_service_path(@project, PrometheusService) - add_to_breadcrumbs "Prometheus", edit_project_service_path(@project, PrometheusService)
- breadcrumb_title = s_('Metrics|New metric') - breadcrumb_title s_('Metrics|New metric')
- page_title s_('Metrics|New metric') - page_title s_('Metrics|New metric')
= render 'form', project: @project, metric: @metric = render 'form', project: @project, metric: @metric
- pretty_name = defined?(@project) ? @project.full_name : 'namespace / path'
- run_actions_text = "Perform common operations on GitLab project: #{pretty_name}"
.card .card
%p %p
This service allows users to perform common operations on this This service allows users to perform common operations on this
......
...@@ -23,5 +23,4 @@ ...@@ -23,5 +23,4 @@
= render 'shared/billings/trial_status', namespace: namespace = render 'shared/billings/trial_status', namespace: namespace
- if namespace.eligible_for_trial? - if namespace.eligible_for_trial?
- namespace_billing_url = namespace.is_a?(Group) ? group_billings_url(namespace) : profile_billings_url
%p= link_to 'Start your free trial', new_gitlab_com_trial_url, class: 'btn btn-primary btn-inverted' %p= link_to 'Start your free trial', new_gitlab_com_trial_url, class: 'btn btn-primary btn-inverted'
- filter_placeholder = local_assigns.fetch(:filter_placeholder, 'Search')
.dropdown-page-one .dropdown-page-one
.issue-board-dropdown-content .issue-board-dropdown-content
%p %p
......
- milestone = local_assigns[:milestone] - milestone = local_assigns[:milestone]
- project = local_assigns[:project]
- burndown = burndown_chart(milestone) - burndown = burndown_chart(milestone)
- warning = data_warning_for(burndown) - warning = data_warning_for(burndown)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment