Skip to content

Commit 6be07a8

Browse files
authored
Merge branch 'dev' into merge-release/17.0-20251204132109
2 parents d55c55e + d8ee971 commit 6be07a8

86 files changed

Lines changed: 2426 additions & 1162 deletions

File tree

Some content is hidden

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

.rubocop.yml

Lines changed: 130 additions & 125 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ Layout/MultilineMethodCallIndentation:
5959
Layout/MultilineOperationIndentation:
6060
Enabled: false
6161

62+
Lint/AmbiguousBlockAssociation:
63+
AllowedMethods: [change]
64+
6265
Lint/AmbiguousOperator:
6366
Enabled: false
6467

@@ -98,19 +101,22 @@ Lint/UnderscorePrefixedVariableName:
98101
Lint/Void:
99102
Enabled: false
100103

101-
Lint/AmbiguousBlockAssociation:
102-
AllowedMethods: [change]
104+
Metrics/AbcSize:
105+
Enabled: true
106+
Exclude:
107+
- "spec/**/*.rb"
108+
- "modules/*/spec/**/*.rb"
103109

104-
Metrics/ClassLength:
110+
Metrics/BlockLength:
105111
Enabled: false
106112

107-
Metrics/CyclomaticComplexity:
113+
Metrics/BlockNesting:
108114
Enabled: false
109115

110-
Metrics/BlockLength:
116+
Metrics/ClassLength:
111117
Enabled: false
112118

113-
Metrics/BlockNesting:
119+
Metrics/CyclomaticComplexity:
114120
Enabled: false
115121

116122
Metrics/MethodLength:
@@ -122,12 +128,6 @@ Metrics/ModuleLength:
122128
Metrics/ParameterLists:
123129
Enabled: false
124130

125-
Metrics/AbcSize:
126-
Enabled: true
127-
Exclude:
128-
- "spec/**/*.rb"
129-
- "modules/*/spec/**/*.rb"
130-
131131
Naming/AccessorMethodName:
132132
Enabled: false
133133

@@ -150,36 +150,111 @@ Naming/VariableNumber:
150150
- '\w_20\d\d' # allow dates like christmas_2022 or date_2034_04_12
151151
- '\w\d++(_\d++)+' # allow hierarchical data like child1_2_5 (second + in regex is possessive qualifier)
152152
- 'custom_field_\d+' # allow custom field method names to be called with send :custom_field_1001
153-
# There are valid cases in which to use methods like:
154-
# * update_all
155-
# * touch_all
156-
Rails/SkipsModelValidations:
153+
154+
OpenProject/AddPreviewForViewComponent:
155+
Include:
156+
- app/components/op_turbo/**.rb
157+
- app/components/op_primer/**.rb
158+
- app/components/open_project/**.rb
159+
- app/components/concerns/**.rb
160+
161+
Performance/Casecmp:
157162
Enabled: false
158163

159164
# Don't force us to use tag instead of content_tag
160165
# as this breaks angular elements
161166
Rails/ContentTag:
162167
Enabled: false
163168

169+
# dynamic finders cop clashes with capybara ID cop
170+
Rails/DynamicFindBy:
171+
Enabled: true
172+
Exclude:
173+
- "spec/features/**/*.rb"
174+
- "spec/support/**/*.rb"
175+
- "modules/*/spec/features/**/*.rb"
176+
Whitelist:
177+
- find_by_login
178+
- find_by_mail
179+
180+
# Allow reorder to prevent find each cop triggering
181+
Rails/FindEach:
182+
AllowedMethods:
183+
- order
184+
- reorder
185+
- limit
186+
- select
187+
- lock
188+
189+
# The http verbs in Rack::Test do not accept named parameters (params: params)
190+
Rails/HttpPositionalArguments:
191+
Enabled: false
192+
164193
# Disable I18n.locale = in specs, where it is reset
165194
# by us explicitly
166195
Rails/I18nLocaleAssignment:
167196
Enabled: true
168197
Exclude:
169198
- "spec/**/*.rb"
170199

171-
# Do not bother if `let` statements use an index in their name
172-
RSpec/IndexedLet:
173-
Enabled: false
174-
175-
# The http verbs in Rack::Test do not accept named parameters (params: params)
176-
Rails/HttpPositionalArguments:
200+
# We have config.active_record.belongs_to_required_by_default = false ,
201+
# which means, we do have to declare presence validators on belongs_to relations.
202+
Rails/RedundantPresenceValidationOnBelongsTo:
177203
Enabled: false
178204

179205
# require_dependency is an obsolete method for Rails applications running in Zeitwerk mode.
180206
Rails/RequireDependency:
181207
Enabled: true
182208

209+
# Require save! to prevent saving without validation when saving outside of a condition.
210+
Rails/SaveBang:
211+
Enabled: true
212+
213+
# There are valid cases in which to use methods like:
214+
# * update_all
215+
# * touch_all
216+
Rails/SkipsModelValidations:
217+
Enabled: false
218+
219+
# Allow number HTTP status codes in specs
220+
RSpecRails/HttpStatus:
221+
Enabled: false
222+
223+
# expect not_to change is not working as expected
224+
# if you chain it with multiple expected changes
225+
RSpec/ChangeByZero:
226+
Enabled: false
227+
228+
RSpec/ContextWording:
229+
Prefixes:
230+
- and
231+
- as
232+
- even
233+
- for
234+
- given
235+
- having
236+
- if
237+
- in
238+
- "on"
239+
- to
240+
- unless
241+
- via
242+
- when
243+
- with
244+
- within
245+
- without
246+
247+
RSpec/DescribeClass:
248+
Enabled: true
249+
Exclude:
250+
- "spec/features/**/*.rb"
251+
- "modules/*/spec/features/**/*.rb"
252+
253+
# Don't force the second argument of describe
254+
# to be .class_method or #instance_method
255+
RSpec/DescribeMethod:
256+
Enabled: false
257+
183258
# For feature specs, we tend to have longer specs that cover a larger part of the functionality.
184259
# This is done for multiple reasons:
185260
# * performance, as setting up integration tests is costly
@@ -191,48 +266,29 @@ RSpec/ExampleLength:
191266
- "spec/features/**/*.rb"
192267
- "modules/*/spec/features/**/*.rb"
193268

194-
# We have specs that have no expect(..) syntax,
195-
# but only helper classes that expect themselves
196-
RSpec/NoExpectationExample:
197-
Enabled: false
198-
199-
RSpec/DescribeClass:
269+
# Prevent "fit" or similar to be committed
270+
RSpec/Focus:
200271
Enabled: true
201-
Exclude:
202-
- "spec/features/**/*.rb"
203-
- "modules/*/spec/features/**/*.rb"
204272

205273
# Nothing wrong with `include_examples` when used properly.
206274
RSpec/IncludeExamples:
207275
Enabled: false
208276

209-
# Allow number HTTP status codes in specs
210-
RSpecRails/HttpStatus:
277+
# Do not bother if `let` statements use an index in their name
278+
RSpec/IndexedLet:
211279
Enabled: false
212280

213-
# dynamic finders cop clashes with capybara ID cop
214-
Rails/DynamicFindBy:
215-
Enabled: true
216-
Exclude:
217-
- "spec/features/**/*.rb"
218-
- "spec/support/**/*.rb"
219-
- "modules/*/spec/features/**/*.rb"
220-
Whitelist:
221-
- find_by_login
222-
- find_by_mail
281+
RSpec/LeadingSubject:
282+
Enabled: false
223283

224-
# Allow reorder to prevent find each cop triggering
225-
Rails/FindEach:
226-
AllowedMethods:
227-
- order
228-
- reorder
229-
- limit
230-
- select
231-
- lock
284+
# We use let!() to ensure dependencies are created
285+
# instead of let() and referencing them explicitly
286+
RSpec/LetSetup:
287+
Enabled: false
232288

233-
# We have config.active_record.belongs_to_required_by_default = false ,
234-
# which means, we do have to declare presence validators on belongs_to relations.
235-
Rails/RedundantPresenceValidationOnBelongsTo:
289+
# We have specs that have no expect(..) syntax,
290+
# but only helper classes that expect themselves
291+
RSpec/NoExpectationExample:
236292
Enabled: false
237293

238294
# See RSpec/ExampleLength for why feature specs are excluded
@@ -249,11 +305,6 @@ RSpec/MultipleMemoizedHelpers:
249305
RSpec/NestedGroups:
250306
Enabled: false
251307

252-
# Don't force the second argument of describe
253-
# to be .class_method or #instance_method
254-
RSpec/DescribeMethod:
255-
Enabled: false
256-
257308
# Don't force the second argument of describe
258309
# to match the exact file name
259310
RSpec/SpecFilePathFormat:
@@ -264,45 +315,9 @@ RSpec/SpecFilePathFormat:
264315
ICal: ical
265316
IgnoreMethods: true
266317

267-
# Prevent "fit" or similar to be committed
268-
RSpec/Focus:
269-
Enabled: true
270-
271-
# We use let!() to ensure dependencies are created
272-
# instead of let() and referencing them explicitly
273-
RSpec/LetSetup:
274-
Enabled: false
275-
276-
RSpec/LeadingSubject:
277-
Enabled: false
278-
279318
RSpec/NamedSubject:
280319
Enabled: false
281320

282-
# expect not_to change is not working as expected
283-
# if you chain it with multiple expected changes
284-
RSpec/ChangeByZero:
285-
Enabled: false
286-
287-
RSpec/ContextWording:
288-
Prefixes:
289-
- and
290-
- as
291-
- even
292-
- for
293-
- given
294-
- having
295-
- if
296-
- in
297-
- "on"
298-
- to
299-
- unless
300-
- via
301-
- when
302-
- with
303-
- within
304-
- without
305-
306321
Style/Alias:
307322
Enabled: false
308323

@@ -367,6 +382,19 @@ Style/FormatString:
367382
Style/FormatStringToken:
368383
AllowedMethods: [redirect]
369384

385+
Style/FrozenStringLiteralComment:
386+
Enabled: true
387+
EnforcedStyle: always_true
388+
389+
Style/HashEachMethods:
390+
Enabled: true
391+
392+
Style/HashTransformKeys:
393+
Enabled: true
394+
395+
Style/HashTransformValues:
396+
Enabled: true
397+
370398
Style/GlobalVars:
371399
Enabled: false
372400

@@ -409,6 +437,13 @@ Style/NilComparison:
409437
Style/Not:
410438
Enabled: false
411439

440+
Style/NumericLiterals:
441+
Enabled: false
442+
443+
# Avoid enforcing "positive?"
444+
Style/NumericPredicate:
445+
Enabled: false
446+
412447
Style/OneLineConditional:
413448
Enabled: false
414449

@@ -471,33 +506,3 @@ Style/WhileUntilModifier:
471506

472507
Style/WordArray:
473508
Enabled: false
474-
475-
Style/FrozenStringLiteralComment:
476-
Enabled: true
477-
EnforcedStyle: always_true
478-
479-
Style/NumericLiterals:
480-
Enabled: false
481-
482-
# Avoid enforcing "positive?"
483-
Style/NumericPredicate:
484-
Enabled: false
485-
486-
Style/HashEachMethods:
487-
Enabled: true
488-
489-
Style/HashTransformKeys:
490-
Enabled: true
491-
492-
Style/HashTransformValues:
493-
Enabled: true
494-
495-
Performance/Casecmp:
496-
Enabled: false
497-
498-
OpenProject/AddPreviewForViewComponent:
499-
Include:
500-
- app/components/op_turbo/**.rb
501-
- app/components/op_primer/**.rb
502-
- app/components/open_project/**.rb
503-
- app/components/concerns/**.rb

Gemfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ gem "structured_warnings", "~> 0.5.0"
149149
# don't require by default, instead load on-demand when actually configured
150150
gem "airbrake", "~> 13.0.0", require: false
151151

152-
gem "markly", "~> 0.14" # another markdown parser like commonmarker, but with AST support used in PDF export
152+
gem "markly", "~> 0.15" # another markdown parser like commonmarker, but with AST support used in PDF export
153153
gem "md_to_pdf", git: "https://github.com/opf/md-to-pdf", ref: "6c565541bfa390c58d90d49aa9b487777704fc66"
154154
gem "prawn", "~> 2.4"
155155
gem "ttfunk", "~> 1.7.0" # remove after https://github.com/prawnpdf/prawn/issues/1346 resolved.
@@ -198,7 +198,7 @@ gem "aws-sdk-s3", "~> 1.205"
198198

199199
gem "openproject-token", "~> 8.2.0"
200200

201-
gem "plaintext", "~> 0.3.2"
201+
gem "plaintext", "~> 0.3.7"
202202

203203
gem "ruby-progressbar", "~> 1.13.0", require: false
204204

@@ -356,7 +356,7 @@ group :development, :test do
356356
gem "rubocop-factory_bot", require: false
357357
gem "rubocop-openproject", require: false
358358
gem "rubocop-performance", require: false
359-
gem "rubocop-rails", "= 2.33.3", require: false # 2.33.4 has issues with Rails/ActionControllerFlashBeforeRender
359+
gem "rubocop-rails", "2.34.2", require: false # 2.33.4 has issues with Rails/ActionControllerFlashBeforeRender
360360
gem "rubocop-rspec", require: false
361361
gem "rubocop-rspec_rails", require: false
362362

0 commit comments

Comments
 (0)