-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathrubocop.json
More file actions
7372 lines (7372 loc) · 289 KB
/
Copy pathrubocop.json
File metadata and controls
7372 lines (7372 loc) · 289 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://www.rubyschema.org/rubocop.json",
"title": "Rubocop Configuration",
"definitions": {
"cop": {
"properties": {
"Enabled": {
"type": "boolean",
"markdownDescription": "Enable or disable this cop. When set to `false`, the cop will not run. [Docs](https://docs.rubocop.org/rubocop/configuration.html#enabled)"
},
"Include": {
"type": "array",
"uniqueItems": true,
"items": {
"type": "string"
},
"markdownDescription": "File patterns (globs) to include for this cop. Files matching these patterns will be checked even if they would otherwise be excluded."
},
"Exclude": {
"type": "array",
"uniqueItems": true,
"items": {
"type": "string"
},
"markdownDescription": "File patterns (globs) to exclude from this cop. Files matching these patterns will not be checked."
},
"Severity": {
"enum": [
"info",
"refactor",
"convention",
"warning",
"error",
"fatal"
],
"markdownEnumDescriptions": [
"Informational severity. Does not cause RuboCop to return a non-zero exit code.",
"Refactoring suggestion. Indicates code that could be restructured.",
"Convention violation. Indicates a violation of coding conventions.",
"Warning level. Indicates a potential problem that should be reviewed.",
"Error level. Indicates a problem that should be fixed.",
"Fatal level. Indicates a critical issue that must be fixed."
],
"markdownDescription": "Severity level for offenses detected by this cop. Cops with `info` severity will not cause RuboCop to return a non-zero exit code. [Docs](https://docs.rubocop.org/rubocop/configuration.html#severity)"
},
"Details": {
"type": "string",
"markdownDescription": "Additional details about this cop that will be shown when RuboCop is run with the `--extra-details` flag or when `ExtraDetails` is set to `true` in your global configuration. [Docs](https://docs.rubocop.org/rubocop/configuration.html#details)"
},
"AutoCorrect": {
"markdownDescription": "Configure Rubocop’s autocorrection behavior. [Docs](https://docs.rubocop.org/rubocop/configuration.html#autocorrect)",
"oneOf": [
{
"type": "boolean"
},
{
"enum": ["always", "contextual", "disabled"],
"markdownEnumDescriptions": [
"Enables autocorrection",
"Enables autocorrection when launched from the `rubocop` command but not via the LSP.",
"Disables autocorrection"
]
}
]
},
"StyleGuide": {
"type": "string",
"markdownDescription": "URL fragment (hash) pointing to the style guide entry for this cop. Combined with `StyleGuideBaseURL` to form the complete URL."
},
"VersionAdded": {
"type": "string",
"pattern": "^\\d+\\.\\d+$",
"markdownDescription": "The RuboCop version in which this cop was added, in the format `major.minor`."
},
"VersionChanged": {
"type": "string",
"pattern": "^\\d+\\.\\d+$",
"markdownDescription": "The latest RuboCop version in which this cop was changed in a user-impacting way (new config, updated defaults, etc), in the format `major.minor`."
}
}
},
"department": {
"properties": {
"Enabled": {
"type": "boolean",
"markdownDescription": "Enable or disable all cops in this department. Individual cops can still override this setting."
},
"StyleGuideBaseURL": {
"type": "string",
"format": "uri",
"markdownDescription": "Base URL for the style guide. Combined with each cops `StyleGuide` value to form complete style guide URLs for this department. [Docs](https://docs.rubocop.org/rubocop/configuration.html#setting-the-style-guide-url)"
},
"DocumentationBaseURL": {
"type": "string",
"format": "uri",
"markdownDescription": "Base URL for the documentation. Used to generate documentation links for cops in this department. [Docs](https://docs.rubocop.org/rubocop/configuration.html#setting-the-documentation-url)"
},
"DocumentationExtension": {
"anyOf": [
{
"type": "string"
},
{
"enum": [".md", "", ".txt"],
"markdownEnumDescriptions": [
"Markdown documentation files",
"No file extension (bare files)",
"Plain text documentation files"
]
}
],
"markdownDescription": "File extension for documentation files (e.g., `.md` for Markdown, `.html` for HTML). Defaults to `.html` if not specified."
}
}
},
"constant": {
"type": "string",
"pattern": "^(?:::)?[A-Z][a-zA-Z0-9_]*(?:::[A-Z][a-zA-Z0-9_]*)*$"
},
"constants": {
"type": "array",
"uniqueItems": true,
"items": {
"$ref": "#/definitions/constant"
}
},
"hashAlignmentEnforcedColonStyleEnum": {
"enum": ["key", "separator", "table"],
"markdownEnumDescriptions": [
"Align hash values with the first key",
"Align hash values with the colon separator",
"Align hash values in table format"
]
},
"hashAlignmentEnforcedHashRocketStyleEnum": {
"enum": ["key", "separator", "table"],
"markdownEnumDescriptions": [
"Align hash values with the first key",
"Align hash values with the hash rocket (=>)",
"Align hash values in table format"
]
}
},
"properties": {
"inherit_gem": {
"type": "object",
"additionalProperties": {
"anyOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
},
"uniqueItems": true
}
]
},
"markdownDescription": "Inherit configuration from one or more gems. Allows you to share RuboCop configuration across multiple projects. The key is the gem name and the value is the relative path to the config file within the gem. [Docs](https://docs.rubocop.org/rubocop/configuration.html#inheriting-configuration-from-a-dependency-gem)"
},
"inherit_from": {
"anyOf": [
{
"type": "string"
},
{
"type": "array",
"uniqueItems": true,
"items": {
"type": "string"
}
}
],
"markdownDescription": "Inherit configuration from one or more files. Can be local file paths or remote URLs. Files can be given with absolute paths or paths relative to the file where they are referenced. Also accepts glob patterns. [Docs](https://docs.rubocop.org/rubocop/configuration.html#inheriting-from-another-configuration-file-in-the-project)"
},
"inherit_mode": {
"type": "object",
"properties": {
"merge": {
"type": "array",
"uniqueItems": true,
"items": {
"enum": ["Exclude", "Include"],
"markdownEnumDescriptions": [
"Merge `Exclude` arrays from inherited configs instead of overriding",
"Merge `Include` arrays from inherited configs instead of overriding"
]
},
"markdownDescription": "Array configuration keys that should be merged with inherited values rather than overriding them"
}
},
"markdownDescription": "Specifies which configuration keys with array values should be merged together instead of overriding the inherited value. This applies to both explicit inheritance via `inherit_from` and implicit inheritance from the default config. [Docs](https://docs.rubocop.org/rubocop/configuration.html#merging-arrays-using-inherit_mode)"
},
"AllCops": {
"type": "object",
"properties": {
"Exclude": {
"type": "array",
"uniqueItems": true,
"items": {
"type": "string"
},
"markdownDescription": "File patterns (globs) to exclude from all cops. Files matching these patterns will not be inspected. To apply exclusions when specific files are passed as arguments, use `--force-exclusion`. [Docs](https://docs.rubocop.org/rubocop/configuration.html#includingexcluding-files)"
},
"Include": {
"type": "array",
"uniqueItems": true,
"items": {
"type": "string"
},
"markdownDescription": "File patterns (globs) to include for all cops. Files matching these patterns will be inspected. Overrides the default patterns from RuboCop. [Docs](https://docs.rubocop.org/rubocop/configuration.html#includingexcluding-files)"
},
"DisabledByDefault": {
"type": "boolean",
"markdownDescription": "When `true`, all cops except `Lint/Syntax` are disabled by default. Only cops explicitly enabled in configuration files will run. Cannot be used with `EnabledByDefault`. [Docs](https://docs.rubocop.org/rubocop/configuration.html#enabled)"
},
"EnabledByDefault": {
"type": "boolean",
"markdownDescription": "When `true`, all cops are enabled by default, including those that are normally disabled. Cannot be used with `DisabledByDefault`. [Docs](https://docs.rubocop.org/rubocop/configuration.html#enabled)"
},
"TargetRubyVersion": {
"anyOf": [
{
"type": "number"
},
{
"enum": [2.7, 3.0, 3.1, 3.2, 3.3, 3.4],
"markdownEnumDescriptions": [
"Ruby 2.7",
"Ruby 3.0",
"Ruby 3.1",
"Ruby 3.2",
"Ruby 3.3",
"Ruby 3.4"
]
}
],
"markdownDescription": "The minimum Ruby version your code must support. Cops that detect version-specific features will adjust their behavior accordingly. If not specified, RuboCop will try to detect it from `.ruby-version`, `Gemfile.lock`, `*.gemspec`, or `.tool-versions`. [Docs](https://docs.rubocop.org/rubocop/configuration.html#setting-the-target-ruby-version)"
},
"ParserEngine": {
"enum": ["parser_whitequark", "parser_prism"],
"markdownEnumDescriptions": [
"Whitequark parser. Supports Ruby 2.0-3.4.",
"Prism parser. Supports Ruby 3.3+ and is typically faster."
],
"markdownDescription": "The parser backend to use. `parser_whitequark` supports Ruby 2.0-3.4, while `parser_prism` supports Ruby 3.3+ and is typically faster. Since RuboCop 1.75, the parser is chosen automatically if not specified. [Docs](https://docs.rubocop.org/rubocop/configuration.html#setting-the-parser-engine)"
},
"StyleGuideBaseURL": {
"type": "string",
"format": "uri",
"markdownDescription": "Base URL for the style guide. This is combined with individual cop `StyleGuide` values to generate complete URLs. [Docs](https://docs.rubocop.org/rubocop/configuration.html#setting-the-style-guide-url)"
},
"DocumentationBaseURL": {
"type": "string",
"format": "uri",
"markdownDescription": "Base URL for the documentation. Used to generate documentation links for all cops. [Docs](https://docs.rubocop.org/rubocop/configuration.html#setting-the-documentation-url)"
},
"DocumentationExtension": {
"anyOf": [
{
"type": "string"
},
{
"enum": [".md", "", ".txt"],
"markdownEnumDescriptions": [
"Markdown documentation files",
"No file extension (bare files)",
"Plain text documentation files"
]
}
],
"markdownDescription": "File extension for documentation files (e.g., `.md` for Markdown). Defaults to `.html` if not specified. [Docs](https://docs.rubocop.org/rubocop/configuration.html#setting-the-documentation-url)"
},
"ActiveSupportExtensionsEnabled": {
"type": "boolean",
"markdownDescription": "When `true`, enables checking of Active Support extensions in relevant cops (e.g., `Style/HashExcept`). This allows RuboCop to recognize Rails/ActiveSupport-specific methods. [Docs](https://docs.rubocop.org/rubocop/configuration.html#enable-checking-active-support-extensions)"
},
"StringLiteralsFrozenByDefault": {
"markdownDescription": "Set this to `true` if you enable frozen string literals globally with the `RUBYOPT` environment variable (e.g., `RUBYOPT=--enable=frozen-string-literal`). This affects how RuboCop analyzes string literals. [Docs](https://docs.rubocop.org/rubocop/configuration.html#opting-into-globally-frozen-string-literals)",
"type": "boolean"
},
"MaxFilesInCache": {
"anyOf": [
{
"type": "integer",
"minimum": 0
},
{
"const": false
}
],
"markdownDescription": "Maximum number of files RuboCop stores in its result cache before pruning. Set to `false` to disable cache pruning entirely. [Docs](https://docs.rubocop.org/rubocop/usage/caching.html)"
}
},
"not": {
"allOf": [
{
"required": ["DisabledByDefault"]
},
{
"required": ["EnabledByDefault"]
}
]
},
"markdownDescription": "Global configuration that applies to all cops. These settings affect RuboCops overall behavior. [Docs](https://docs.rubocop.org/rubocop/configuration.html)"
},
"Bundler": {
"$ref": "#/definitions/department"
},
"Gemspec": {
"$ref": "#/definitions/department"
},
"Layout": {
"$ref": "#/definitions/department"
},
"Lint": {
"$ref": "#/definitions/department"
},
"Metrics": {
"$ref": "#/definitions/department"
},
"Migration": {
"$ref": "#/definitions/department"
},
"Naming": {
"$ref": "#/definitions/department"
},
"Security": {
"$ref": "#/definitions/department"
},
"Style": {
"$ref": "#/definitions/department"
},
"Bundler/DuplicatedGem": {
"markdownDescription": "Detects duplicate gem declarations in Gemfile. Helps keep dependencies organized. [Docs](https://docs.rubocop.org/rubocop/cops_bundler#bundlerduplicatedgem)",
"$ref": "#/definitions/cop"
},
"Bundler/DuplicatedGroup": {
"markdownDescription": "Detects duplicate group declarations in Gemfile. Promotes cleaner Gemfile structure. [Docs](https://docs.rubocop.org/rubocop/cops_bundler#bundlerduplicatedgroup)",
"$ref": "#/definitions/cop"
},
"Bundler/GemComment": {
"markdownDescription": "Enforces comments above gem declarations for documentation. Improves gem intent clarity. [Docs](https://docs.rubocop.org/rubocop/cops_bundler#bundlergemcomment)",
"allOf": [
{
"$ref": "#/definitions/cop"
},
{
"properties": {
"OnlyFor": {
"type": "array",
"items": {
"anyOf": [
{
"type": "string"
},
{
"enum": [
"version_specifiers",
"restrictive_version_specifiers",
"bitbucket",
"gist",
"git",
"github",
"source"
],
"markdownEnumDescriptions": [
"Require comments for gems with version specifiers",
"Require comments for gems with restrictive version specifiers (e.g., exact versions)",
"Require comments for gems sourced from Bitbucket",
"Require comments for gems sourced from GitHub Gist",
"Require comments for gems sourced from git repositories",
"Require comments for gems sourced from GitHub",
"Require comments for gems with custom source specifications"
]
}
]
}
}
}
}
]
},
"Bundler/GemFilename": {
"markdownDescription": "Enforces naming convention for Gemfile. Keeps project structure consistent. [Docs](https://docs.rubocop.org/rubocop/cops_bundler#bundlergemfilename)",
"allOf": [
{
"$ref": "#/definitions/cop"
},
{
"properties": {
"EnforcedStyle": {
"enum": ["Gemfile", "gems.rb"],
"markdownEnumDescriptions": [
"Use `Gemfile` as the filename",
"Use `gems.rb` as the filename"
]
}
}
}
]
},
"Bundler/GemVersion": {
"markdownDescription": "Enforces use of version specifiers in gem declarations. Improves dependency management. [Docs](https://docs.rubocop.org/rubocop/cops_bundler#bundlergemversion)",
"allOf": [
{
"$ref": "#/definitions/cop"
},
{
"properties": {
"EnforcedStyle": {
"enum": ["required", "forbidden"],
"markdownEnumDescriptions": [
"Require version specifiers for all gems",
"Forbid version specifiers for all gems"
]
},
"AllowedGems": {
"type": "array",
"items": {
"type": "string"
}
}
}
}
]
},
"Bundler/InsecureProtocolSource": {
"markdownDescription": "Warns against insecure gem sources (http instead of https). Improves security. [Docs](https://docs.rubocop.org/rubocop/cops_bundler#bundlerinsecureprotocolsource)",
"allOf": [
{
"$ref": "#/definitions/cop"
},
{
"properties": {
"AllowHttpProtocol": {
"type": "boolean"
}
}
}
]
},
"Bundler/OrderedGems": {
"markdownDescription": "Enforces alphabetical ordering of gems in groups. Improves readability. [Docs](https://docs.rubocop.org/rubocop/cops_bundler#bundlerorderedgems)",
"allOf": [
{
"$ref": "#/definitions/cop"
},
{
"properties": {
"TreatCommentsAsGroupSeparators": {
"type": "boolean"
},
"ConsiderPunctuation": {
"type": "boolean"
}
}
}
]
},
"Gemspec/AddRuntimeDependency": {
"markdownDescription": "Detects add_runtime_dependency in gemspec files. Suggests using gem dependencies. [Docs](https://docs.rubocop.org/rubocop/cops_gemspec#gemspecaddruntimedependency)",
"$ref": "#/definitions/cop"
},
"Gemspec/AttributeAssignment": {
"markdownDescription": "Detects attribute assignments that should use methods. Improves code clarity. [Docs](https://docs.rubocop.org/rubocop/cops_gemspec.html#gemspecattributeassignment)",
"$ref": "#/definitions/cop"
},
"Gemspec/DependencyVersion": {
"markdownDescription": "Enforces explicit version specifications in gem dependencies. Improves clarity. [Docs](https://docs.rubocop.org/rubocop/cops_gemspec#gemspecdependencyversion)",
"allOf": [
{
"$ref": "#/definitions/cop"
},
{
"properties": {
"EnforcedStyle": {
"enum": ["required", "forbidden"],
"markdownEnumDescriptions": [
"Require version specifications for dependencies",
"Forbid version specifications for dependencies"
]
}
}
}
]
},
"Gemspec/DeprecatedAttributeAssignment": {
"markdownDescription": "Detects deprecated gemspec attribute assignment patterns. Encourages modern syntax. [Docs](https://docs.rubocop.org/rubocop/cops_gemspec#gemspecdeprecatedattributeassignment)",
"$ref": "#/definitions/cop"
},
"Gemspec/DevelopmentDependencies": {
"markdownDescription": "Enforces that development dependencies are in development group. Improves gem organization. [Docs](https://docs.rubocop.org/rubocop/cops_gemspec#gemspecdevelopmentdependencies)",
"allOf": [
{
"$ref": "#/definitions/cop"
},
{
"properties": {
"EnforcedStyle": {
"enum": ["Gemfile", "gems.rb", "gemspec"],
"markdownEnumDescriptions": [
"Place development dependencies in `Gemfile`",
"Place development dependencies in `gems.rb`",
"Place development dependencies in gemspec file"
]
}
}
}
]
},
"Gemspec/DuplicatedAssignment": {
"markdownDescription": "Detects duplicate attribute assignments in gemspec. Helps keep gemspec clean. [Docs](https://docs.rubocop.org/rubocop/cops_gemspec#gemspecduplicatedassignment)",
"$ref": "#/definitions/cop"
},
"Gemspec/OrderedDependencies": {
"markdownDescription": "Enforces alphabetical ordering of dependencies in gemspec. Improves readability. [Docs](https://docs.rubocop.org/rubocop/cops_gemspec#gemspecordereddependencies)",
"allOf": [
{
"$ref": "#/definitions/cop"
},
{
"properties": {
"TreatCommentsAsGroupSeparators": {
"type": "boolean"
},
"ConsiderPunctuation": {
"type": "boolean"
}
}
}
]
},
"Gemspec/RequireMFA": {
"markdownDescription": "Recommends enabling MFA for gem publishing. Improves security. [Docs](https://docs.rubocop.org/rubocop/cops_gemspec#gemspecrequiremfa)",
"$ref": "#/definitions/cop"
},
"Gemspec/RequiredRubyVersion": {
"markdownDescription": "Enforces explicitly specifying required Ruby version. Improves clarity. [Docs](https://docs.rubocop.org/rubocop/cops_gemspec#gemspecrequiredrubyversion)",
"$ref": "#/definitions/cop"
},
"Gemspec/RubyVersionGlobalsUsage": {
"markdownDescription": "Discourages using Ruby version globals in gemspec. Use version methods instead. [Docs](https://docs.rubocop.org/rubocop/cops_gemspec#gemspecrubyversionglobalsusage)",
"$ref": "#/definitions/cop"
},
"Layout/AccessModifierIndentation": {
"markdownDescription": "Checks the indentation of `private`, `protected`, and `public` access modifiers. You can choose to indent them to the same level as the class/module definition or one level deeper. [Docs](https://docs.rubocop.org/rubocop/cops_layout#layoutaccessmodifierindentation)",
"allOf": [
{
"$ref": "#/definitions/cop"
},
{
"properties": {
"EnforcedStyle": {
"enum": ["indent", "outdent"],
"markdownEnumDescriptions": [
"Indent access modifiers one level deeper than the class/module definition",
"Align access modifiers with the class/module definition (no indentation)"
]
},
"IndentationWidth": {
"type": ["integer", "null"]
}
}
}
]
},
"Layout/ArgumentAlignment": {
"markdownDescription": "Enforces consistent indentation for method arguments. Improves readability. [Docs](https://docs.rubocop.org/rubocop/cops_layout#layoutargumentalignment)",
"allOf": [
{
"$ref": "#/definitions/cop"
},
{
"properties": {
"EnforcedStyle": {
"enum": ["with_first_argument", "with_fixed_indentation"],
"markdownEnumDescriptions": [
"Align subsequent arguments with the first argument",
"Use fixed indentation for all arguments"
]
},
"IndentationWidth": {
"type": ["integer", "null"]
}
}
}
]
},
"Layout/ArrayAlignment": {
"markdownDescription": "Enforces consistent alignment of array elements. Improves code formatting. [Docs](https://docs.rubocop.org/rubocop/cops_layout#layoutarrayalignment)",
"allOf": [
{
"$ref": "#/definitions/cop"
},
{
"properties": {
"EnforcedStyle": {
"enum": ["with_first_element", "with_fixed_indentation"],
"markdownEnumDescriptions": [
"Align subsequent elements with the first element",
"Use fixed indentation for all elements"
]
},
"IndentationWidth": {
"type": ["integer", "null"]
}
}
}
]
},
"Layout/AssignmentIndentation": {
"markdownDescription": "Enforces consistent indentation for assignment statements. Improves code clarity. [Docs](https://docs.rubocop.org/rubocop/cops_layout#layoutassignmentindentation)",
"allOf": [
{
"$ref": "#/definitions/cop"
},
{
"properties": {
"IndentationWidth": {
"type": ["integer", "null"]
}
}
}
]
},
"Layout/BeginEndAlignment": {
"markdownDescription": "Enforces alignment of begin/end blocks. Improves code readability. [Docs](https://docs.rubocop.org/rubocop/cops_layout#layoutbeginendalignment)",
"allOf": [
{
"$ref": "#/definitions/cop"
},
{
"properties": {
"EnforcedStyleAlignWith": {
"enum": ["start_of_line", "begin"],
"markdownEnumDescriptions": [
"Align `end` with the start of the line containing `begin`",
"Align `end` with the `begin` keyword"
]
}
}
}
]
},
"Layout/BlockAlignment": {
"markdownDescription": "Enforces alignment of block elements. Improves code structure. [Docs](https://docs.rubocop.org/rubocop/cops_layout#layoutblockalignment)",
"allOf": [
{
"$ref": "#/definitions/cop"
},
{
"properties": {
"EnforcedStyleAlignWith": {
"enum": ["either", "start_of_block", "start_of_line"],
"markdownEnumDescriptions": [
"Allow either alignment style",
"Align block `end` with the start of the block expression",
"Align block `end` with the start of the line"
]
}
}
}
]
},
"Layout/BlockEndNewline": {
"markdownDescription": "Enforces placing closing brace on new line for multi-line blocks. Improves formatting. [Docs](https://docs.rubocop.org/rubocop/cops_layout#layoutblockendnewline)",
"$ref": "#/definitions/cop"
},
"Layout/CaseIndentation": {
"markdownDescription": "Enforces consistent indentation in case statements. Improves code clarity. [Docs](https://docs.rubocop.org/rubocop/cops_layout#layoutcaseindentation)",
"allOf": [
{
"$ref": "#/definitions/cop"
},
{
"properties": {
"EnforcedStyle": {
"enum": ["case", "end"],
"markdownEnumDescriptions": [
"Indent `when` clauses one level relative to `case`",
"Indent `when` clauses one level relative to `end`"
]
},
"IndentOneStep": {
"type": "boolean"
},
"IndentationWidth": {
"type": ["integer", "null"]
}
}
}
]
},
"Layout/ClassStructure": {
"markdownDescription": "Enforces consistent ordering of class methods and attributes. Improves code organization. [Docs](https://docs.rubocop.org/rubocop/cops_layout#layoutclassstructure)",
"allOf": [
{
"$ref": "#/definitions/cop"
},
{
"properties": {
"ExpectedOrder": {
"uniqueItems": true,
"type": "array",
"items": {
"enum": [
"module_inclusion",
"constants",
"association",
"public_attribute_macros",
"public_delegate",
"macros",
"public_class_methods",
"initializer",
"public_methods",
"protected_attribute_macros",
"protected_methods",
"private_attribute_macros",
"private_delegate",
"private_methods"
],
"markdownEnumDescriptions": [
"Module inclusion (`include`, `prepend`, `extend`)",
"Constant definitions",
"ActiveRecord associations",
"Public attribute macros (`attr_accessor`, etc.)",
"Public delegate definitions",
"General macros (validations, etc.)",
"Public class methods",
"`initialize` method",
"Public instance methods",
"Protected attribute macros",
"Protected instance methods",
"Private attribute macros",
"Private delegate definitions",
"Private instance methods"
]
}
},
"Categories": {
"type": "object",
"properties": {
"association": {
"type": "array",
"uniqueItems": true,
"items": {
"anyOf": [
{
"type": "string"
},
{
"enum": [
"belongs_to",
"has_one",
"has_many",
"has_and_belongs_to_many"
],
"markdownEnumDescriptions": [
"ActiveRecord `belongs_to` associations",
"ActiveRecord `has_one` associations",
"ActiveRecord `has_many` associations",
"ActiveRecord `has_and_belongs_to_many` associations"
]
}
]
}
},
"attribute_macros": {
"type": "array",
"uniqueItems": true,
"items": {
"anyOf": [
{
"type": "string"
},
{
"enum": ["attr_accessor", "attr_reader", "attr_writer"],
"markdownEnumDescriptions": [
"Attribute accessor macros (both getter and setter)",
"Attribute reader macros (getter only)",
"Attribute writer macros (setter only)"
]
}
]
}
},
"macros": {
"type": "array",
"uniqueItems": true,
"items": {
"anyOf": [
{
"type": "string"
},
{
"enum": ["validates", "validate"],
"markdownEnumDescriptions": [
"ActiveModel `validates` declarations",
"ActiveModel custom `validate` declarations"
]
}
]
}
},
"module_inclusion": {
"type": "array",
"uniqueItems": true,
"items": {
"anyOf": [
{
"type": "string"
},
{
"enum": ["include", "prepend", "extend"],
"markdownEnumDescriptions": [
"Module `include` statements",
"Module `prepend` statements",
"Module `extend` statements"
]
}
]
}
}
}
}
}
}
]
},
"Layout/ClosingHeredocIndentation": {
"markdownDescription": "Enforces indentation of heredoc closing delimiter. Improves code formatting. [Docs](https://docs.rubocop.org/rubocop/cops_layout#layoutclosingheredocindentation)",
"$ref": "#/definitions/cop"
},
"Layout/ClosingParenthesisIndentation": {
"markdownDescription": "Enforces indentation of closing parenthesis. Improves code formatting. [Docs](https://docs.rubocop.org/rubocop/cops_layout#layoutclosingparenthesisindentation)",
"$ref": "#/definitions/cop"
},
"Layout/CommentIndentation": {
"markdownDescription": "Enforces consistent indentation of comments. Improves code readability. [Docs](https://docs.rubocop.org/rubocop/cops_layout#layoutcommentindentation)",
"allOf": [
{
"$ref": "#/definitions/cop"
},
{
"properties": {
"AllowForAlignment": {
"type": "boolean"
}
}
}
]
},
"Layout/ConditionPosition": {
"markdownDescription": "Enforces consistent position of condition in if/unless statements. Improves clarity. [Docs](https://docs.rubocop.org/rubocop/cops_layout#layoutconditionposition)",
"$ref": "#/definitions/cop"
},
"Layout/DefEndAlignment": {
"markdownDescription": "Enforces alignment of def/end blocks. Improves code structure. [Docs](https://docs.rubocop.org/rubocop/cops_layout#layoutdefendalignment)",
"allOf": [
{
"$ref": "#/definitions/cop"
},
{
"properties": {
"EnforcedStyleAlignWith": {
"enum": ["start_of_line", "def"],
"markdownEnumDescriptions": [
"Align `end` with the start of the line containing `def`",
"Align `end` with the `def` keyword"
]
}
}
}
]
},
"Layout/DotPosition": {
"markdownDescription": "Enforces consistent position of dot in method chains. Improves code formatting. [Docs](https://docs.rubocop.org/rubocop/cops_layout#layoutdotposition)",
"allOf": [
{
"$ref": "#/definitions/cop"
},
{
"properties": {
"EnforcedStyle": {
"enum": ["leading", "trailing"],
"markdownEnumDescriptions": [
"Place dots at the beginning of continuation lines",
"Place dots at the end of lines being continued"
]
}
}
}
]
},
"Layout/ElseAlignment": {
"markdownDescription": "Enforces alignment of else keyword with if. Improves code readability. [Docs](https://docs.rubocop.org/rubocop/cops_layout#layoutelsealignment)",
"$ref": "#/definitions/cop"
},
"Layout/EmptyComment": {
"markdownDescription": "Detects empty comments. Suggests removing unused comments. [Docs](https://docs.rubocop.org/rubocop/cops_layout#layoutemptycomment)",
"allOf": [
{
"$ref": "#/definitions/cop"
},
{
"properties": {
"AllowBorderComment": {
"type": "boolean"
},
"AllowMarginComment": {
"type": "boolean"
}
}
}
]
},
"Layout/EmptyLineAfterGuardClause": {
"markdownDescription": "Enforces blank line after guard clauses. Improves code spacing. [Docs](https://docs.rubocop.org/rubocop/cops_layout#layoutemptylineafterguardclause)",
"$ref": "#/definitions/cop"
},
"Layout/EmptyLineAfterMagicComment": {
"markdownDescription": "Enforces blank line after magic comments. Improves code formatting. [Docs](https://docs.rubocop.org/rubocop/cops_layout#layoutemptylineaftermagiccomment)",
"$ref": "#/definitions/cop"
},
"Layout/EmptyLinesAfterModuleInclusion": {
"markdownDescription": "Enforces blank lines after module inclusions. Improves code spacing. [Docs](https://docs.rubocop.org/rubocop/cops_layout#layoutemptylinesaftermoduleinclusion)",
"$ref": "#/definitions/cop"
},
"Layout/EmptyLineAfterMultilineCondition": {
"markdownDescription": "Enforces blank line after multi-line conditions. Improves readability. [Docs](https://docs.rubocop.org/rubocop/cops_layout#layoutemptylineaftermultilinecondition)",
"$ref": "#/definitions/cop"
},
"Layout/EmptyLineBetweenDefs": {
"markdownDescription": "Enforces blank line between method definitions. Improves code spacing. [Docs](https://docs.rubocop.org/rubocop/cops_layout#layoutemptylinebetweendefs)",
"allOf": [
{
"$ref": "#/definitions/cop"
},
{
"properties": {
"EmptyLineBetweenMethodDefs": {
"type": "boolean"
},
"EmptyLineBetweenClassDefs": {
"type": "boolean"
},
"EmptyLineBetweenModuleDefs": {
"type": "boolean"
},
"DefLikeMacros": {
"type": "array",
"items": {
"type": "string"
},
"uniqueItems": true
},
"AllowAdjacentOneLineDefs": {
"type": "boolean"
},
"NumberOfEmptyLines": {
"type": "integer"
}
}
}
]
},
"Layout/EmptyLines": {
"markdownDescription": "Enforces consistent number of blank lines. Improves code formatting. [Docs](https://docs.rubocop.org/rubocop/cops_layout#layoutemptylines)",
"$ref": "#/definitions/cop"
},
"Layout/EmptyLinesAroundAccessModifier": {
"markdownDescription": "Enforces blank lines around access modifiers. Improves code spacing. [Docs](https://docs.rubocop.org/rubocop/cops_layout#layoutemptylinesaroundaccessmodifier)",
"allOf": [
{
"$ref": "#/definitions/cop"
},
{
"properties": {
"EnforcedStyle": {
"enum": ["around", "only_before"],
"markdownEnumDescriptions": [
"Require blank lines both before and after access modifiers",
"Require blank lines only before access modifiers"
]
}
}
}
]
},
"Layout/EmptyLinesAroundArguments": {
"markdownDescription": "Enforces blank lines around method arguments. Improves code formatting. [Docs](https://docs.rubocop.org/rubocop/cops_layout#layoutemptylinesaroundarguments)",
"$ref": "#/definitions/cop"
},
"Layout/EmptyLinesAroundAttributeAccessor": {
"markdownDescription": "Enforces blank lines around attribute accessors. Improves code spacing. [Docs](https://docs.rubocop.org/rubocop/cops_layout#layoutemptylinesaroundattributeaccessor)",
"allOf": [