Project

General

Profile

Actions

Defect #43195

open

5.1-stable fails with RuboCop error Layout/EmptyLineAfterGuardClause

Added by Katsuya HIDAKA 4 days ago. Updated 3 days ago.

Status:
Resolved
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 4 days 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 4 days ago

  • File file.so added
Actions #3

Updated by Holger Just 4 days ago

  • File deleted (file.so)
Actions #4

Updated by Marius BĂLTEANU 3 days ago

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

Fixed, thanks

Actions

Also available in: Atom PDF