Skip to content

Commit 45b80ad

Browse files
committed
Merge remote-tracking branch 'origin/develop' into task/1024
2 parents 4bfe403 + 684ba63 commit 45b80ad

File tree

254 files changed

+3836
-2502
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

254 files changed

+3836
-2502
lines changed

.rubocop.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,11 @@ Layout/SpaceBeforeBlockBraces:
4545
Enabled: false
4646

4747
Layout/SpaceInsideBlockBraces:
48-
Enabled: false
48+
EnforcedStyle: no_space
49+
SpaceBeforeBlockParameters: false
4950

5051
Layout/SpaceInsideHashLiteralBraces:
51-
Enabled: false
52+
EnforcedStyle: no_space
5253

5354
Lint/RaiseException:
5455
Enabled: true

.rubocop_todo.yml

Lines changed: 1 addition & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -564,27 +564,6 @@ Performance/RedundantMatch:
564564
- 'lib/redmine/wiki_formatting/textile/formatter.rb'
565565
- 'lib/redmine/wiki_formatting/textile/redcloth3.rb'
566566

567-
# Cop supports --auto-correct.
568-
# Configuration parameters: MaxKeyValuePairs.
569-
Performance/RedundantMerge:
570-
Exclude:
571-
- 'app/controllers/issues_controller.rb'
572-
- 'app/helpers/application_helper.rb'
573-
- 'app/helpers/avatars_helper.rb'
574-
- 'app/helpers/custom_fields_helper.rb'
575-
- 'app/helpers/workflows_helper.rb'
576-
- 'app/models/auth_source_ldap.rb'
577-
- 'app/models/principal.rb'
578-
- 'lib/redmine/access_control.rb'
579-
- 'test/functional/imports_controller_test.rb'
580-
- 'test/unit/issue_import_test.rb'
581-
- 'test/unit/time_entry_import_test.rb'
582-
583-
# Cop supports --auto-correct.
584-
Performance/Squeeze:
585-
Exclude:
586-
- 'test/unit/lib/redmine/scm/adapters/bazaar_adapter_test.rb'
587-
588567
# Cop supports --auto-correct.
589568
# Configuration parameters: AutoCorrect.
590569
Performance/StringInclude:
@@ -594,23 +573,6 @@ Performance/StringInclude:
594573
- 'test/unit/lib/redmine/scm/adapters/bazaar_adapter_test.rb'
595574
- 'test/unit/lib/redmine/wiki_formatting/macros_test.rb'
596575

597-
# Cop supports --auto-correct.
598-
Performance/StringReplacement:
599-
Exclude:
600-
- 'app/helpers/application_helper.rb'
601-
- 'app/helpers/imports_helper.rb'
602-
- 'app/helpers/settings_helper.rb'
603-
- 'lib/redmine/core_ext/string/conversions.rb'
604-
- 'lib/redmine/wiki_formatting/textile/redcloth3.rb'
605-
- 'test/functional/repositories_cvs_controller_test.rb'
606-
- 'test/functional/repositories_git_controller_test.rb'
607-
- 'test/helpers/application_helper_test.rb'
608-
- 'test/integration/repositories_git_test.rb'
609-
- 'test/unit/lib/redmine/scm/adapters/cvs_adapter_test.rb'
610-
- 'test/unit/lib/redmine/scm/adapters/mercurial_adapter_test.rb'
611-
- 'test/unit/repository_cvs_test.rb'
612-
- 'test/unit/repository_git_test.rb'
613-
614576
# Cop supports --auto-correct.
615577
Performance/Sum:
616578
Exclude:
@@ -1830,4 +1792,4 @@ Style/ZeroLengthPredicate:
18301792
# Configuration parameters: AutoCorrect, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
18311793
# URISchemes: http, https
18321794
Layout/LineLength:
1833-
Max: 461
1795+
Max: 461

Gemfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ gem 'bundler', '>= 1.12.0'
55

66
gem 'rails', '5.2.4.4'
77
gem 'sprockets', '~> 3.7.2' if RUBY_VERSION < '2.5'
8-
gem 'rouge', '~> 3.24.0'
8+
gem 'rouge', '~> 3.25.0'
99
gem 'request_store', '~> 1.5.0'
1010
gem "mini_mime", "~> 1.0.1"
1111
gem "actionpack-xml_parser"
@@ -39,7 +39,7 @@ end
3939

4040
# Optional gem for exporting the gantt to a PNG file
4141
group :minimagick do
42-
gem 'mini_magick', '~> 4.10.1'
42+
gem 'mini_magick', '~> 4.11.0'
4343
end
4444

4545
# Optional Markdown support, not for JRuby

app/controllers/activities_controller.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,19 +59,19 @@ def index
5959

6060
if events.empty? || stale?(:etag => [@activity.scope, @date_to, @date_from, @with_subprojects, @author, events.first, events.size, User.current, current_language])
6161
respond_to do |format|
62-
format.html {
62+
format.html do
6363
@events_by_day = events.group_by {|event| User.current.time_to_date(event.event_datetime)}
6464
render :layout => false if request.xhr?
65-
}
66-
format.atom {
65+
end
66+
format.atom do
6767
title = l(:label_activity)
6868
if @author
6969
title = @author.name
7070
elsif @activity.scope.size == 1
7171
title = l("label_#{@activity.scope.first.singularize}_plural")
7272
end
7373
render_feed(events, :title => "#{@project || Setting.app_title}: #{title}")
74-
}
74+
end
7575
end
7676
end
7777

app/controllers/application_controller.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -276,8 +276,8 @@ def require_login
276276
head(:forbidden)
277277
end
278278
end
279-
format.js { head :unauthorized, 'WWW-Authenticate' => 'Basic realm="Redmine API"' }
280-
format.any { head :unauthorized }
279+
format.js {head :unauthorized, 'WWW-Authenticate' => 'Basic realm="Redmine API"'}
280+
format.any {head :unauthorized}
281281
end
282282
return false
283283
end
@@ -565,7 +565,7 @@ def render_error(arg)
565565
format.html do
566566
render :template => 'common/error', :layout => use_layout, :status => @status
567567
end
568-
format.any { head @status }
568+
format.any {head @status}
569569
end
570570
end
571571

app/controllers/attachments_controller.rb

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class AttachmentsController < ApplicationController
3737

3838
def show
3939
respond_to do |format|
40-
format.html {
40+
format.html do
4141
if @attachment.container.respond_to?(:attachments)
4242
@attachments = @attachment.container.attachments.to_a
4343
if index = @attachments.index(@attachment)
@@ -64,7 +64,7 @@ def show
6464
else
6565
render :action => 'other'
6666
end
67-
}
67+
end
6868
format.api
6969
end
7070
end
@@ -113,13 +113,13 @@ def upload
113113

114114
respond_to do |format|
115115
format.js
116-
format.api {
116+
format.api do
117117
if saved
118118
render :action => 'upload', :status => :created
119119
else
120120
render_validation_errors(@attachment)
121121
end
122-
}
122+
end
123123
end
124124
end
125125

@@ -155,13 +155,13 @@ def update
155155
saved = @attachment.save
156156

157157
respond_to do |format|
158-
format.api {
158+
format.api do
159159
if saved
160160
render_api_ok
161161
else
162162
render_validation_errors(@attachment)
163163
end
164-
}
164+
end
165165
end
166166
end
167167

@@ -177,9 +177,9 @@ def destroy
177177
end
178178

179179
respond_to do |format|
180-
format.html { redirect_to_referer_or project_path(@project) }
180+
format.html {redirect_to_referer_or project_path(@project)}
181181
format.js
182-
format.api { render_api_ok }
182+
format.api {render_api_ok}
183183
end
184184
end
185185

@@ -207,6 +207,7 @@ def find_attachment
207207
@attachment = Attachment.find(params[:id])
208208
# Show 404 if the filename in the url is wrong
209209
raise ActiveRecord::RecordNotFound if params[:filename] && params[:filename] != @attachment.filename
210+
210211
@project = @attachment.project
211212
rescue ActiveRecord::RecordNotFound
212213
render_404

app/controllers/auth_sources_controller.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def destroy
7878

7979
def autocomplete_for_new_user
8080
results = AuthSource.search(params[:term])
81-
render :json => results.map {|result|
81+
json = results.map do |result|
8282
{
8383
'value' => result[:login],
8484
'label' => "#{result[:login]} (#{result[:firstname]} #{result[:lastname]})",
@@ -88,7 +88,8 @@ def autocomplete_for_new_user
8888
'mail' => result[:mail].to_s,
8989
'auth_source_id' => result[:auth_source_id].to_s
9090
}
91-
}
91+
end
92+
render :json => json
9293
end
9394

9495
private

app/controllers/auto_completes_controller.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,12 @@ def find_project
5353
end
5454

5555
def format_issues_json(issues)
56-
issues.map {|issue|
56+
issues.map do |issue|
5757
{
5858
'id' => issue.id,
5959
'label' => "#{issue.tracker} ##{issue.id}: #{issue.subject.to_s.truncate(255)}",
6060
'value' => issue.id
6161
}
62-
}
62+
end
6363
end
6464
end

app/controllers/boards_controller.rb

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def index
3737

3838
def show
3939
respond_to do |format|
40-
format.html {
40+
format.html do
4141
sort_init 'updated_on', 'desc'
4242
sort_update 'created_on' => "#{Message.table_name}.id",
4343
'replies' => "#{Message.table_name}.replies_count",
@@ -54,15 +54,15 @@ def show
5454
to_a
5555
@message = Message.new(:board => @board)
5656
render :action => 'show', :layout => !request.xhr?
57-
}
58-
format.atom {
57+
end
58+
format.atom do
5959
@messages = @board.messages.
6060
reorder(:id => :desc).
6161
includes(:author, :board).
6262
limit(Setting.feeds_limit.to_i).
6363
to_a
6464
render_feed(@messages, :title => "#{@project}: #{@board}")
65-
}
65+
end
6666
end
6767
end
6868

@@ -89,16 +89,16 @@ def update
8989
@board.safe_attributes = params[:board]
9090
if @board.save
9191
respond_to do |format|
92-
format.html {
92+
format.html do
9393
flash[:notice] = l(:notice_successful_update)
9494
redirect_to_settings_in_projects
95-
}
96-
format.js { head 200 }
95+
end
96+
format.js {head 200}
9797
end
9898
else
9999
respond_to do |format|
100-
format.html { render :action => 'edit' }
101-
format.js { head 422 }
100+
format.html {render :action => 'edit'}
101+
format.js {head 422}
102102
end
103103
end
104104
end

app/controllers/context_menus_controller.rb

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,13 @@ def issues
3131

3232
@allowed_statuses = @issues.map(&:new_statuses_allowed_to).reduce(:&)
3333

34-
@can = {:edit => @issues.all?(&:attributes_editable?),
35-
:log_time => (@project && User.current.allowed_to?(:log_time, @project)),
36-
:copy => User.current.allowed_to?(:copy_issues, @projects) && Issue.allowed_target_projects.any?,
37-
:add_watchers => User.current.allowed_to?(:add_issue_watchers, @projects),
38-
:delete => @issues.all?(&:deletable?)
39-
}
34+
@can = {
35+
:edit => @issues.all?(&:attributes_editable?),
36+
:log_time => (@project && User.current.allowed_to?(:log_time, @project)),
37+
:copy => User.current.allowed_to?(:copy_issues, @projects) && Issue.allowed_target_projects.any?,
38+
:add_watchers => User.current.allowed_to?(:add_issue_watchers, @projects),
39+
:delete => @issues.all?(&:deletable?)
40+
}
4041

4142
@assignables = @issues.map(&:assignable_users).reduce(:&)
4243
@trackers = @projects.map {|p| Issue.allowed_target_trackers(p)}.reduce(:&)

0 commit comments

Comments
 (0)