Project

General

Profile

Actions

Defect #43195

closed

5.1-stable fails with RuboCop error Layout/EmptyLineAfterGuardClause

Added by Katsuya HIDAKA about 2 months ago. Updated about 2 months ago.

Status:
Closed
Priority:
Normal
Category:
-
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed
Affected version:

Description

The CI fails in the 5.1-stable branch due to a RuboCop warning:
https://github.com/redmine/redmine/actions/runs/17564475662/job/49888343834

app/models/issue.rb:2083:5: C: [Correctable] Layout/EmptyLineAfterGuardClause: Add empty line after guard clause.
    return unless custom_field_values_changed?
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Actions #1

Updated by Katsuya HIDAKA about 2 months ago

Here is a patch to fix the warning:

diff --git a/app/models/issue.rb b/app/models/issue.rb
index 3f841cffc..66e8e2ccb 100644
--- a/app/models/issue.rb
+++ b/app/models/issue.rb
@@ -2081,6 +2081,7 @@ class Issue < ActiveRecord::Base
   # current user.
   def force_default_value_on_noneditable_custom_fields
     return unless custom_field_values_changed?
+
     editable_custom_field_ids = editable_custom_fields(author).map(&:id)
     custom_field_values.each do |field_value|
       unless editable_custom_field_ids.include?(field_value.custom_field_id)

Actions #2

Updated by Nanoke Nanoke about 2 months ago

  • File file.so added
Actions #3

Updated by Holger Just about 2 months ago

  • File deleted (file.so)
Actions #4

Updated by Marius BĂLTEANU about 2 months ago

  • Status changed from New to Resolved
  • Assignee set to Marius BĂLTEANU
  • Resolution set to Fixed

Fixed, thanks

Actions #5

Updated by Marius BĂLTEANU about 2 months ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF