Skip to content

Commit 2aff835

Browse files
committed
Lint: Use parentheses for method calls in views
This commit adds parentheses for various method calls in Slim: - render - button_tag - button_to - link_to - link_to_if
1 parent c2560d7 commit 2aff835

File tree

24 files changed

+48
-48
lines changed

24 files changed

+48
-48
lines changed

app/views/codeharbor_links/_form.html.slim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
.input-group
1212
= f.text_field(:api_key, data: {'bs-toggle': 'tooltip', 'bs-placement': 'bottom'}, title: t('codeharbor_link.info.api_key'), class: 'form-control api_key')
1313
.input-group-btn
14-
= button_tag t('codeharbor_link.generate'), type: 'button', class: 'generate-api_key btn btn-default'
14+
= button_tag(t('codeharbor_link.generate'), type: 'button', class: 'generate-api_key btn btn-default')
1515
.actions
1616
= render('shared/submit_button', f:, object: @codeharbor_link)
1717
- if @codeharbor_link.persisted?
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
== render 'form'
1+
== render('form')

app/views/community_solutions/index.html.slim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ h1 = CommunitySolution.model_name.human(count: :other)
1111
- @community_solutions.each do |community_solution|
1212
tr
1313
td = community_solution.exercise.title
14-
td = link_to 'Edit', edit_community_solution_path(community_solution)
14+
td = link_to('Edit', edit_community_solution_path(community_solution))
1515

1616
= render('shared/pagination', collection: @community_solutions)

app/views/execution_environments/statistics.html.slim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ h1 = @execution_environment
2121
- if wts then average_time = wts['average_time'] else 0 # rubocop:disable Lint/ElseLayout
2222
- if wts then stddev_time = wts['stddev_time'] else 0 # rubocop:disable Lint/ElseLayout
2323
tr
24-
td = link_to_if policy(exercise).statistics?, exercise.title, controller: 'exercises', action: 'statistics', id: exercise.id, 'data-turbo': 'false'
24+
td = link_to_if(policy(exercise).statistics?, exercise.title, controller: 'exercises', action: 'statistics', id: exercise.id, 'data-turbo': 'false')
2525
td = us['contributors']
2626
td = us['average_score'].to_f.round(4)
2727
td = us['maximum_score'].to_f.round(2)

app/views/exercise_collections/_form.html.slim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535

3636
.actions = render('shared/submit_button', f:, object: @exercise_collection)
3737

38-
= render 'shared/modal',
38+
= render('shared/modal',
3939
title: t('.add_exercises'),
4040
modal_root_attributes: {id: 'add-exercise-modal'},
41-
template: 'exercise_collections/_add_exercise_modal'
41+
template: 'exercise_collections/_add_exercise_modal')
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.mb-3
22
= form.label(attribute, class: 'form-label')
33
= form.text_area(attribute, class: 'code-field form-control', rows: 16, style: 'display:none;')
4-
= render partial: 'editor_edit', locals: {exercise: @exercise}
4+
= render(partial: 'editor_edit', locals: {exercise: @exercise})
55
.card.border-warning.p-2.my-2
66
= form.file_field(attribute, class: 'form-control', style: 'display: inline-block;')
77
.help-block.form-text = t('exercises.file_form.hints.upload')

app/views/exercises/_editor.html.slim

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,19 +64,19 @@
6464
.output-col-collapsed#output_sidebar = render('exercises/editor_output')
6565

6666
- unless @embed_options[:disable_rfc]
67-
= render 'shared/modal',
67+
= render('shared/modal',
6868
title: t('exercises.implement.comment.request'),
6969
modal_root_attributes: {id: 'comment-modal'},
70-
template: 'exercises/_request_comment_dialogcontent'
70+
template: 'exercises/_request_comment_dialogcontent')
7171

7272
- unless @embed_options[:disable_interventions]
73-
= render 'shared/modal',
73+
= render('shared/modal',
7474
title: t('exercises.implement.break_intervention.title'),
7575
modal_root_attributes: {id: 'break-intervention-modal'},
76-
template: 'interventions/_break_intervention_modal'
76+
template: 'interventions/_break_intervention_modal')
7777

7878
- unless @embed_options[:disable_hints] || @tips.blank?
79-
= render 'shared/modal',
79+
= render('shared/modal',
8080
title: t('exercises.implement.tips.heading'),
8181
modal_root_attributes: {id: 'tips-intervention-modal'},
82-
template: 'interventions/_tips_intervention_modal'
82+
template: 'interventions/_tips_intervention_modal')

app/views/exercises/_editor_file_tree.html.slim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
= render(partial: 'tips_content')
3131

3232
- if @exercise.allow_file_creation?
33-
= render 'shared/modal',
33+
= render('shared/modal',
3434
title: t('exercises.editor.create_file'),
3535
modal_root_attributes: {id: 'modal-file'},
36-
template: 'code_ocean/files/_form'
36+
template: 'code_ocean/files/_form')
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
- if error
2-
= button_tag type: 'button', class: 'btn btn-primary float-end export-button export-retry-button', data: {exercise_id: exercise.id} do
2+
= button_tag(type: 'button', class: 'btn btn-primary float-end export-button export-retry-button', data: {exercise_id: exercise.id}) do
33
i.fa-solid.fa-arrows-rotate.confirm-icon
44
= t('exercises.export_codeharbor.buttons.retry')
55
- elsif !exported && (!uuid_found || update_right)
6-
= button_tag type: 'button', class: 'btn btn-primary float-end export-action export-button', data: {exercise_id: exercise.id} do
6+
= button_tag(type: 'button', class: 'btn btn-primary float-end export-action export-button', data: {exercise_id: exercise.id}) do
77
i.fa-solid.fa-check.confirm-icon
88
= t('exercises.export_codeharbor.buttons.export')
99

10-
= button_tag type: 'submit', class: 'btn btn-secondary float-end export-button', data: {bs_dismiss: 'modal'} do
10+
= button_tag(type: 'submit', class: 'btn btn-secondary float-end export-button', data: {bs_dismiss: 'modal'}) do
1111
i.fa-solid.fa-xmark.abort-icon
1212
= exported ? t('shared.close') : t('exercises.export_codeharbor.buttons.abort')

app/views/exercises/_form.html.slim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@
104104

105105
.actions = render('shared/submit_button', f:, object: @exercise)
106106

107-
= render 'shared/modal',
107+
= render('shared/modal',
108108
title: t('.add_tips'),
109109
modal_root_attributes: {id: 'add-tips-modal'},
110-
template: 'exercises/_add_tip_modal'
110+
template: 'exercises/_add_tip_modal')

0 commit comments

Comments
 (0)