Skip to content

Commit

Permalink
Merge pull request #7499 from fjordllc/feature/apply-slimlint-rule-7
Browse files Browse the repository at this point in the history
slim-lintへの「Rubocopのルール」追加の検討(追加:1ルール、除外:4ルール)
  • Loading branch information
komagata authored Mar 26, 2024
2 parents b58970e + 7fddd2d commit 033db0e
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 42 deletions.
14 changes: 5 additions & 9 deletions app/views/home/index.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,12 @@
= render 'welcome_message_for_adviser'

.page-body.is-dash-board
- if current_user.adviser?
.page-body__inner.has-side-nav
.page-body__inner.has-side-nav
- if current_user.adviser?
= render 'adviser_dashboard'
= render partial: 'recent_reports'
- elsif current_user.mentor?
.page-body__inner.has-side-nav
- elsif current_user.mentor?
= render 'mentor_dashboard'
= render partial: 'recent_reports'
- else
.page-body__inner.has-side-nav
- else
.columns
.container.is-xl
.row
Expand All @@ -47,4 +43,4 @@
= render 'users/github_grass', user: current_user
- if current_user.student_or_trainee?
#js-niconico_calendar(data-user-id="#{current_user.id}")
= render partial: 'recent_reports'
= render partial: 'recent_reports'
36 changes: 14 additions & 22 deletions app/views/surveys/show.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,12 @@ header.page-header
.survey-questions-item__radios.radios
ul.radios__items
- survey_question.radio_button.radio_button_choices.each do |choice|
- if choice.reason_for_choice_required
li.radios__item
li.radios__item
- if choice.reason_for_choice_required
= f.radio_button survey_question.id, choice.choices, id: "radio-#{choice.id}", class: 'a-toggle-checkbox js-questionnaire_choice js-answer_required_choice'
= f.label "#{choice.radio_button_id}_#{choice.choices}", choice.choices, for: "radio-#{choice.id}"
- else
li.radios__item
- else
= f.radio_button survey_question.id, choice.choices, id: "radio-#{choice.id}", class: 'a-toggle-checkbox js-questionnaire_choice'
= f.label "#{choice.radio_button_id}_#{choice.choices}", choice.choices, for: "radio-#{choice.id}"
= f.label "#{choice.radio_button_id}_#{choice.choices}", choice.choices, for: "radio-#{choice.id}"
- if survey_question.answer_required_choice_exists?(survey_question.id)
.survey-additional-question.is-hidden name="js-additional_question_#{survey_question.id}"
= f.label survey_question.radio_button.title_of_reason, class: 'a-form-label is-required'
Expand All @@ -73,14 +71,12 @@ header.page-header
.survey-questions-item__checkboxes.checkboxes
ul.checkboxes__items
- survey_question.check_box.check_box_choices.each do |choice|
- if choice.reason_for_choice_required
li.checkboxes__item
li.checkboxes__item
- if choice.reason_for_choice_required
= f.check_box choice.choices, id: "checkbox-#{choice.id}", class: 'a-toggle-checkbox js-questionnaire_choice js-answer_required_choice', name: survey_question.id
= f.label choice.choices, for: "checkbox-#{choice.id}"
- else
li.checkboxes__item
- else
= f.check_box choice.choices, id: "checkbox-#{choice.id}", class: 'a-toggle-checkbox js-questionnaire_choice', name: survey_question.id
= f.label choice.choices, for: "checkbox-#{choice.id}"
= f.label choice.choices, for: "checkbox-#{choice.id}"
- if survey_question.answer_required_choice_exists?(survey_question.id)
.survey-additional-question.is-hidden name="js-additional_question_#{survey_question.id}"
= f.label :title_of_reason_for_checkbox, survey_question.check_box.title_of_reason, class: 'a-form-label is-required'
Expand All @@ -97,20 +93,16 @@ header.page-header
.linear-scale__points
ul.linear-scale__points-items
- 10.times do |i|
- if survey_question.linear_scale.reason_for_choice_required
li.linear-scale__points-item
li.linear-scale__points-item
- if survey_question.linear_scale.reason_for_choice_required
= f.radio_button survey_question.id, i + 1, id: "linear-scale-#{survey_question.id}-#{i}",
class: 'a-toggle-checkbox js-questionnaire_choice js-answer_required_choice'
label.linear-scale__point for="linear-scale-#{survey_question.id}-#{i}"
.linear-scale__point-number
= i + 1
- else
li.linear-scale__points-item
- else
= f.radio_button survey_question.id, i + 1, id: "linear-scale-#{survey_question.id}-#{i}",
class: 'a-toggle-checkbox js-questionnaire_choice'
label.linear-scale__point for="linear-scale-#{survey_question.id}-#{i}"
.linear-scale__point-number
= i + 1
label.linear-scale__point for="linear-scale-#{survey_question.id}-#{i}"
.linear-scale__point-number
= i + 1
.linear-scale__label
= survey_question.linear_scale.last
- if survey_question.linear_scale.reason_for_choice_required
Expand Down
11 changes: 5 additions & 6 deletions app/views/users/index.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,12 @@ main.page-main
= link_to 'このタグを自分に追加', "/users/tags/#{params[:tag]}", method: 'post', class: 'a-button is-sm is-secondary is-block'
- else
h1.page-main-header__title
| #{t("target.#{@target}")}
- if @watch
| #{t("target.#{@target}")}:#{t("watch.#{@watch}")}(#{@users.total_count}
- else
| #{t("target.#{@target}")}
- if admin_or_mentor_login?
span.is-only-mentor
|(#{@users.total_count}
|:#{t("watch.#{@watch}")}(#{@users.total_count}
- elsif admin_or_mentor_login?
span.is-only-mentor
|(#{@users.total_count}
hr.a-border
.page-body.is-users
// TODO 暫定的な対応
Expand Down
9 changes: 4 additions & 5 deletions config/slim_lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ linters:
RuboCop:
enabled: true
ignored_cops:
- Layout/ArgumentAlignment
- Layout/ArgumentAlignment # 検討の結果、残す。(詳細は issue #7253 参照)
- Layout/EmptyLineAfterGuardClause
- Layout/EndAlignment
- Layout/FirstArrayElementIndentation
- Layout/FirstParameterIndentation
- Layout/HashAlignment
- Layout/HashAlignment # 検討の結果、残す。(詳細は issue #7253 参照)
- Layout/IndentationWidth
- Layout/InitialIndentation
- Layout/MultilineArrayBraceLayout
Expand All @@ -22,13 +22,12 @@ linters:
- Layout/MultilineMethodDefinitionBraceLayout
- Layout/MultilineOperationIndentation
- Layout/ParameterAlignment
- Layout/TrailingEmptyLines
- Layout/TrailingEmptyLines # 検討の結果、残す。(詳細は issue #7253 参照)
- Lint/Void # 除外検討したが見送り
- Metrics/BlockLength # 除外検討したが見送り
- Style/FrozenStringLiteralComment # 除外検討したが見送り
- Style/IdenticalConditionalBranches
- Style/IfUnlessModifier # 検討の結果、残す(詳細は#7252)
- Style/Next # 検討の結果、残す(詳細は#7252)
- Style/WhileUntilDo
- Style/WhileUntilModifier
- Style/HashSyntax
- Style/HashSyntax # 検討の結果、残す。(詳細は issue #7253 参照)

0 comments on commit 033db0e

Please sign in to comment.