Skip to content

Commit 04d5a3b

Browse files
authored
Merge pull request #199 from skryukov/allow-passing-props
Allow omitting the component name with props on render
2 parents 057556d + 380f9dc commit 04d5a3b

File tree

7 files changed

+203
-205
lines changed

7 files changed

+203
-205
lines changed

.rubocop_todo.yml

Lines changed: 13 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# This configuration was generated by
22
# `rubocop --auto-gen-config --exclude-limit 10000`
3-
# on 2025-03-01 10:06:34 UTC using RuboCop version 1.73.1.
3+
# on 2025-03-04 09:53:10 UTC using RuboCop version 1.73.2.
44
# The point is for the user to remove these configuration records
55
# one by one as the offenses are removed from the code base.
66
# Note that changes in the inspected code, or installation of new
@@ -15,20 +15,6 @@ Layout/ArgumentAlignment:
1515
- 'bin/console'
1616
- 'spec/inertia/response_spec.rb'
1717

18-
# Offense count: 9
19-
# This cop supports safe autocorrection (--autocorrect).
20-
Layout/BlockEndNewline:
21-
Exclude:
22-
- 'spec/inertia/rendering_spec.rb'
23-
24-
# Offense count: 2
25-
# This cop supports safe autocorrection (--autocorrect).
26-
# Configuration parameters: EnforcedStyle, IndentOneStep, IndentationWidth.
27-
# SupportedStyles: case, end
28-
Layout/CaseIndentation:
29-
Exclude:
30-
- 'lib/inertia_rails/renderer.rb'
31-
3218
# Offense count: 1
3319
# This cop supports safe autocorrection (--autocorrect).
3420
Layout/EmptyLineAfterGuardClause:
@@ -49,14 +35,6 @@ Layout/EmptyLinesAroundBlockBody:
4935
Exclude:
5036
- 'spec/inertia/rails_mimic_spec.rb'
5137

52-
# Offense count: 1
53-
# This cop supports safe autocorrection (--autocorrect).
54-
# Configuration parameters: EnforcedStyleAlignWith, Severity.
55-
# SupportedStylesAlignWith: keyword, variable, start_of_line
56-
Layout/EndAlignment:
57-
Exclude:
58-
- 'lib/inertia_rails/renderer.rb'
59-
6038
# Offense count: 3
6139
# This cop supports safe autocorrection (--autocorrect).
6240
# Configuration parameters: AllowForAlignment, AllowBeforeTrailingComments, ForceEqualSignAlignment.
@@ -76,16 +54,11 @@ Layout/FirstArgumentIndentation:
7654

7755
# Offense count: 2
7856
# This cop supports safe autocorrection (--autocorrect).
79-
# Configuration parameters: IndentationWidth.
57+
# Configuration parameters: EnforcedStyle, IndentationWidth.
8058
# SupportedStyles: special_inside_parentheses, consistent, align_braces
8159
Layout/FirstHashElementIndentation:
82-
EnforcedStyle: consistent
83-
84-
# Offense count: 9
85-
# This cop supports safe autocorrection (--autocorrect).
86-
Layout/MultilineBlockLayout:
8760
Exclude:
88-
- 'spec/inertia/rendering_spec.rb'
61+
- 'spec/inertia/rspec_helper_spec.rb'
8962

9063
# Offense count: 4
9164
# This cop supports safe autocorrection (--autocorrect).
@@ -116,18 +89,17 @@ Layout/SpaceInsideArrayLiteralBrackets:
11689
- 'spec/dummy/app/controllers/inertia_test_controller.rb'
11790
- 'spec/dummy/config/environments/production.rb'
11891

119-
# Offense count: 13
92+
# Offense count: 5
12093
# This cop supports safe autocorrection (--autocorrect).
12194
# Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBraces, SpaceBeforeBlockParameters.
12295
# SupportedStyles: space, no_space
12396
# SupportedStylesForEmptyBraces: space, no_space
12497
Layout/SpaceInsideBlockBraces:
12598
Exclude:
12699
- 'spec/inertia/error_sharing_spec.rb'
127-
- 'spec/inertia/rendering_spec.rb'
128100
- 'spec/inertia/request_spec.rb'
129101

130-
# Offense count: 122
102+
# Offense count: 106
131103
# This cop supports safe autocorrection (--autocorrect).
132104
# Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBraces.
133105
# SupportedStyles: space, no_space, compact
@@ -141,7 +113,6 @@ Layout/SpaceInsideHashLiteralBraces:
141113
- 'spec/inertia/conditional_sharing_spec.rb'
142114
- 'spec/inertia/middleware_spec.rb'
143115
- 'spec/inertia/rails_mimic_spec.rb'
144-
- 'spec/inertia/rendering_spec.rb'
145116
- 'spec/inertia/request_spec.rb'
146117
- 'spec/inertia/rspec_helper_spec.rb'
147118
- 'spec/inertia/sharing_spec.rb'
@@ -193,12 +164,6 @@ Lint/SymbolConversion:
193164
Exclude:
194165
- 'spec/inertia/rails_mimic_spec.rb'
195166

196-
# Offense count: 1
197-
# Configuration parameters: AllowKeywordBlockArguments.
198-
Lint/UnderscorePrefixedVariableName:
199-
Exclude:
200-
- 'lib/inertia_rails/renderer.rb'
201-
202167
# Offense count: 1
203168
# This cop supports safe autocorrection (--autocorrect).
204169
# Configuration parameters: AutoCorrect, AllowUnusedKeywordArguments, IgnoreEmptyMethods, IgnoreNotImplementedMethods, NotImplementedExceptions.
@@ -230,7 +195,7 @@ Naming/VariableNumber:
230195
Exclude:
231196
- 'spec/dummy/app/controllers/inertia_test_controller.rb'
232197

233-
# Offense count: 25
198+
# Offense count: 10
234199
# This cop supports safe autocorrection (--autocorrect).
235200
# Configuration parameters: EnforcedStyle, ProceduralMethods, FunctionalMethods, AllowedMethods, AllowedPatterns, AllowBracesOnProceduralOneLiners, BracesRequiredMethods.
236201
# SupportedStyles: line_count_based, semantic, braces_for_chaining, always_braces
@@ -242,7 +207,7 @@ Style/BlockDelimiters:
242207
- 'lib/inertia_rails/controller.rb'
243208
- 'spec/inertia/action_filter_spec.rb'
244209
- 'spec/inertia/conditional_sharing_spec.rb'
245-
- 'spec/inertia/rendering_spec.rb'
210+
- 'spec/inertia/rails_mimic_spec.rb'
246211
- 'spec/inertia/request_spec.rb'
247212
- 'spec/inertia/rspec_helper_spec.rb'
248213
- 'spec/inertia/sharing_spec.rb'
@@ -255,26 +220,11 @@ Style/ClassAndModuleChildren:
255220
Exclude:
256221
- 'lib/inertia_rails/helper.rb'
257222

258-
# Offense count: 2
223+
# Offense count: 1
259224
# This cop supports safe autocorrection (--autocorrect).
260225
Style/ColonMethodCall:
261226
Exclude:
262227
- 'spec/inertia/error_sharing_spec.rb'
263-
- 'spec/inertia/rendering_spec.rb'
264-
265-
# Offense count: 1
266-
# This cop supports safe autocorrection (--autocorrect).
267-
# Configuration parameters: EnforcedStyle, SingleLineConditionsOnly, IncludeTernaryExpressions.
268-
# SupportedStyles: assign_to_condition, assign_inside_condition
269-
Style/ConditionalAssignment:
270-
Exclude:
271-
- 'lib/inertia_rails/renderer.rb'
272-
273-
# Offense count: 1
274-
# This cop supports safe autocorrection (--autocorrect).
275-
Style/EachWithObject:
276-
Exclude:
277-
- 'lib/inertia_rails/renderer.rb'
278228

279229
# Offense count: 1
280230
# This cop supports safe autocorrection (--autocorrect).
@@ -305,7 +255,7 @@ Style/ExpandPathArguments:
305255
Exclude:
306256
- 'spec/rails_helper.rb'
307257

308-
# Offense count: 71
258+
# Offense count: 69
309259
# This cop supports unsafe autocorrection (--autocorrect-all).
310260
# Configuration parameters: EnforcedStyle.
311261
# SupportedStyles: always, always_true, never
@@ -314,7 +264,6 @@ Style/FrozenStringLiteralComment:
314264
- '**/*.arb'
315265
- 'app/controllers/inertia_rails/static_controller.rb'
316266
- 'bin/console'
317-
- 'lib/inertia_rails.rb'
318267
- 'lib/inertia_rails/controller.rb'
319268
- 'lib/inertia_rails/engine.rb'
320269
- 'lib/inertia_rails/helper.rb'
@@ -374,7 +323,6 @@ Style/FrozenStringLiteralComment:
374323
- 'spec/inertia/lazy_prop_spec.rb'
375324
- 'spec/inertia/middleware_spec.rb'
376325
- 'spec/inertia/rails_mimic_spec.rb'
377-
- 'spec/inertia/rendering_spec.rb'
378326
- 'spec/inertia/request_spec.rb'
379327
- 'spec/inertia/response_spec.rb'
380328
- 'spec/inertia/rspec_helper_spec.rb'
@@ -445,12 +393,6 @@ Style/MutableConstant:
445393
Exclude:
446394
- 'lib/inertia_rails/version.rb'
447395

448-
# Offense count: 2
449-
# This cop supports safe autocorrection (--autocorrect).
450-
Style/NegatedIfElseCondition:
451-
Exclude:
452-
- 'lib/inertia_rails/renderer.rb'
453-
454396
# Offense count: 2
455397
# This cop supports safe autocorrection (--autocorrect).
456398
Style/NestedModifier:
@@ -490,12 +432,6 @@ Style/RedundantReturn:
490432
Exclude:
491433
- 'spec/dummy/app/controllers/inertia_session_continuity_test_controller.rb'
492434

493-
# Offense count: 1
494-
# This cop supports safe autocorrection (--autocorrect).
495-
Style/RescueModifier:
496-
Exclude:
497-
- 'lib/inertia_rails/renderer.rb'
498-
499435
# Offense count: 1
500436
# This cop supports safe autocorrection (--autocorrect).
501437
# Configuration parameters: AllowIfMethodIsEmpty.
@@ -510,7 +446,7 @@ Style/SoleNestedConditional:
510446
Exclude:
511447
- 'lib/inertia_rails/controller.rb'
512448

513-
# Offense count: 82
449+
# Offense count: 78
514450
# This cop supports safe autocorrection (--autocorrect).
515451
# Configuration parameters: EnforcedStyle, ConsistentQuotesInMultiline.
516452
# SupportedStyles: single_quotes, double_quotes
@@ -521,7 +457,6 @@ Style/StringLiterals:
521457
- 'lib/inertia_rails/engine.rb'
522458
- 'lib/inertia_rails/helper.rb'
523459
- 'lib/inertia_rails/middleware.rb'
524-
- 'lib/inertia_rails/renderer.rb'
525460
- 'lib/inertia_rails/rspec.rb'
526461
- 'lib/inertia_rails/version.rb'
527462
- 'lib/patches/better_errors.rb'
@@ -543,14 +478,6 @@ Style/StringLiterals:
543478
- 'spec/rails_helper.rb'
544479
- 'spec/spec_helper.rb'
545480

546-
# Offense count: 1
547-
# This cop supports safe autocorrection (--autocorrect).
548-
# Configuration parameters: EnforcedStyle.
549-
# SupportedStyles: single_quotes, double_quotes
550-
Style/StringLiteralsInInterpolation:
551-
Exclude:
552-
- 'lib/inertia_rails/renderer.rb'
553-
554481
# Offense count: 2
555482
# This cop supports safe autocorrection (--autocorrect).
556483
# Configuration parameters: .
@@ -559,16 +486,14 @@ Style/SymbolArray:
559486
EnforcedStyle: percent
560487
MinSize: 3
561488

562-
# Offense count: 14
489+
# Offense count: 3
563490
# This cop supports safe autocorrection (--autocorrect).
564491
# Configuration parameters: EnforcedStyleForMultiline.
565492
# SupportedStylesForMultiline: comma, consistent_comma, no_comma
566493
Style/TrailingCommaInArguments:
567494
Exclude:
568-
- 'lib/inertia_rails.rb'
569495
- 'spec/dummy/app/controllers/inertia_config_test_controller.rb'
570496
- 'spec/dummy/app/controllers/inertia_rails_mimic_controller.rb'
571-
- 'spec/inertia/rendering_spec.rb'
572497

573498
# Offense count: 22
574499
# This cop supports safe autocorrection (--autocorrect).
@@ -586,16 +511,15 @@ Style/TrailingCommaInHashLiteral:
586511
- 'spec/inertia/response_spec.rb'
587512
- 'spec/inertia/rspec_helper_spec.rb'
588513

589-
# Offense count: 2
514+
# Offense count: 1
590515
# This cop supports safe autocorrection (--autocorrect).
591516
# Configuration parameters: EnforcedStyle, MinSize, WordRegex.
592517
# SupportedStyles: percent, brackets
593518
Style/WordArray:
594519
Exclude:
595520
- 'lib/inertia_rails/middleware.rb'
596-
- 'spec/inertia/rendering_spec.rb'
597521

598-
# Offense count: 26
522+
# Offense count: 17
599523
# This cop supports safe autocorrection (--autocorrect).
600524
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns, SplitStrings.
601525
# URISchemes: http, https

lib/inertia_rails.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
require 'inertia_rails/renderer'
24
require 'inertia_rails/engine'
35

@@ -17,7 +19,7 @@
1719
view_data: options[:view_data],
1820
deep_merge: options[:deep_merge],
1921
encrypt_history: options[:encrypt_history],
20-
clear_history: options[:clear_history],
22+
clear_history: options[:clear_history]
2123
).render
2224
end
2325

0 commit comments

Comments
 (0)