rubocop-sorbet 0.6.2 → 0.6.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. checksums.yaml +4 -4
  2. data/.github/release.yml +23 -0
  3. data/Gemfile.lock +21 -39
  4. data/README.md +15 -0
  5. data/Rakefile +12 -16
  6. data/bin/console +3 -3
  7. data/bin/rspec +6 -6
  8. data/config/default.yml +48 -12
  9. data/config/rbi.yml +262 -0
  10. data/lib/rubocop/cop/sorbet/binding_constants_without_type_alias.rb +4 -4
  11. data/lib/rubocop/cop/sorbet/callback_conditionals_binding.rb +62 -58
  12. data/lib/rubocop/cop/sorbet/constants_from_strings.rb +1 -1
  13. data/lib/rubocop/cop/sorbet/forbid_include_const_literal.rb +11 -2
  14. data/lib/rubocop/cop/sorbet/forbid_superclass_const_literal.rb +2 -2
  15. data/lib/rubocop/cop/sorbet/forbid_t_unsafe.rb +2 -2
  16. data/lib/rubocop/cop/sorbet/forbid_untyped_struct_props.rb +2 -2
  17. data/lib/rubocop/cop/sorbet/one_ancestor_per_line.rb +2 -2
  18. data/lib/rubocop/cop/sorbet/rbi/forbid_extend_t_sig_helpers_in_shims.rb +1 -1
  19. data/lib/rubocop/cop/sorbet/rbi/forbid_rbi_outside_of_allowed_paths.rb +47 -0
  20. data/lib/rubocop/cop/sorbet/rbi/single_line_rbi_class_module_definitions.rb +1 -1
  21. data/lib/rubocop/cop/sorbet/sigils/enforce_sigil_order.rb +6 -6
  22. data/lib/rubocop/cop/sorbet/sigils/enforce_single_sigil.rb +63 -0
  23. data/lib/rubocop/cop/sorbet/sigils/false_sigil.rb +3 -3
  24. data/lib/rubocop/cop/sorbet/sigils/has_sigil.rb +2 -2
  25. data/lib/rubocop/cop/sorbet/sigils/ignore_sigil.rb +3 -3
  26. data/lib/rubocop/cop/sorbet/sigils/strict_sigil.rb +3 -3
  27. data/lib/rubocop/cop/sorbet/sigils/strong_sigil.rb +3 -3
  28. data/lib/rubocop/cop/sorbet/sigils/true_sigil.rb +3 -3
  29. data/lib/rubocop/cop/sorbet/sigils/valid_sigil.rb +9 -9
  30. data/lib/rubocop/cop/sorbet/signatures/allow_incompatible_override.rb +3 -3
  31. data/lib/rubocop/cop/sorbet/signatures/checked_true_in_signature.rb +6 -6
  32. data/lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb +13 -13
  33. data/lib/rubocop/cop/sorbet/signatures/keyword_argument_ordering.rb +3 -3
  34. data/lib/rubocop/cop/sorbet/signatures/signature_build_order.rb +6 -6
  35. data/lib/rubocop/cop/sorbet/signatures/signature_cop.rb +17 -2
  36. data/lib/rubocop/cop/sorbet_cops.rb +25 -25
  37. data/lib/rubocop/sorbet/version.rb +1 -1
  38. data/lib/rubocop/sorbet.rb +1 -1
  39. data/lib/rubocop-sorbet.rb +5 -5
  40. data/manual/cops.md +2 -2
  41. data/manual/cops_sorbet.md +60 -31
  42. data/rubocop-sorbet.gemspec +2 -2
  43. data/service.yml +0 -2
  44. data/tasks/cops_documentation.rake +60 -62
  45. metadata +13 -11
  46. data/lib/rubocop/cop/sorbet/rbi/forbid_rbi_outside_of_sorbet_dir.rb +0 -31
  47. data/lib/rubocop/cop/sorbet/signatures/parameters_ordering_in_signature.rb +0 -70
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 309687789d8de94ff0cc8c0d64361cd227ab332ffdd16ab0248d588639dfcd80
4
- data.tar.gz: ca39d50843f2e577ed0a0328c9707e21af175daacd8c92b9b4403bc2195c4cff
3
+ metadata.gz: bd3fcc1ddd15ba9418aeb852d83149b3594fb315c7aa77ab4641c9046466d109
4
+ data.tar.gz: 2b446c026647ebb8d312e8be0034af253f61dc5ac8903c2b75bf42c11be903fe
5
5
  SHA512:
6
- metadata.gz: f774385eec35af24755af1cc5e7f5de554bedf0f6a475e3235879aee61a2c68a818ea87ca4663daa17bb807c862d911264284d1f3270e852166c3e84cde32e7d
7
- data.tar.gz: d6d91114e9c70bc64fa5adf6679a689c12263caa352f7f38b6d96d36609a81e90bc18f369e42b1605259262626114aac6fd5d50f7c91bced3e2f24e2f606fbc4
6
+ metadata.gz: dd23c876c6224baf1a3888c169291b6260286326329d9b48650d1c4113571257837e0fa96d12b4357d4aee62e78b20e1be6373295b0d1e7d065c139e8cf3e25f
7
+ data.tar.gz: 12c3c8aae878c4474284fd41f79da1f4671399bb8e1f01403fe556d36e25274d951f42771ecd0dfc0c3527686b0f3aa1a0d3a22db9b7287c802adf9c43cbc718
@@ -0,0 +1,23 @@
1
+ # release.yml
2
+
3
+ changelog:
4
+ exclude:
5
+ labels:
6
+ - dependencies
7
+ - chore
8
+ authors:
9
+ - dependabot
10
+ categories:
11
+ - title: 🚧 Breaking Changes
12
+ labels:
13
+ - breaking-change
14
+ - title: ✨ Enhancements
15
+ labels:
16
+ - enhancement
17
+ - feature
18
+ - title: 🐛 Bug Fixes
19
+ labels:
20
+ - bugfix
21
+ - title: 🛠 Other Changes
22
+ labels:
23
+ - "*"
data/Gemfile.lock CHANGED
@@ -1,33 +1,21 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rubocop-sorbet (0.6.2)
5
- rubocop
4
+ rubocop-sorbet (0.6.3)
5
+ rubocop (>= 0.90.0)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- abstract_type (0.0.7)
11
- adamantium (0.2.0)
12
- ice_nine (~> 0.11.0)
13
- memoizable (~> 0.4.0)
14
- ast (2.4.0)
10
+ ast (2.4.2)
15
11
  byebug (11.1.3)
16
- concord (0.1.5)
17
- adamantium (~> 0.2.0)
18
- equalizer (~> 0.0.9)
19
12
  diff-lcs (1.3)
20
- equalizer (0.0.11)
21
- ice_nine (0.11.2)
22
- memoizable (0.4.2)
23
- thread_safe (~> 0.3, >= 0.3.1)
24
- parallel (1.19.1)
25
- parser (2.7.1.3)
26
- ast (~> 2.4.0)
27
- procto (0.0.3)
13
+ parallel (1.20.1)
14
+ parser (3.0.1.1)
15
+ ast (~> 2.4.1)
28
16
  rainbow (3.0.0)
29
17
  rake (13.0.1)
30
- regexp_parser (1.7.0)
18
+ regexp_parser (2.1.1)
31
19
  rexml (3.2.5)
32
20
  rspec (3.8.0)
33
21
  rspec-core (~> 3.8.0)
@@ -42,30 +30,24 @@ GEM
42
30
  diff-lcs (>= 1.2.0, < 2.0)
43
31
  rspec-support (~> 3.8.0)
44
32
  rspec-support (3.8.2)
45
- rubocop (0.85.0)
33
+ rubocop (1.16.0)
46
34
  parallel (~> 1.10)
47
- parser (>= 2.7.0.1)
35
+ parser (>= 3.0.0.0)
48
36
  rainbow (>= 2.2.2, < 4.0)
49
- regexp_parser (>= 1.7)
37
+ regexp_parser (>= 1.8, < 3.0)
50
38
  rexml
51
- rubocop-ast (>= 0.0.3)
39
+ rubocop-ast (>= 1.7.0, < 2.0)
52
40
  ruby-progressbar (~> 1.7)
53
- unicode-display_width (>= 1.4.0, < 2.0)
54
- rubocop-ast (0.0.3)
55
- parser (>= 2.7.0.1)
56
- rubocop-shopify (1.0.3)
57
- rubocop (~> 0.85.0)
58
- ruby-progressbar (1.10.1)
59
- thread_safe (0.3.6)
60
- unicode-display_width (1.7.0)
61
- unparser (0.4.7)
62
- abstract_type (~> 0.0.7)
63
- adamantium (~> 0.2.0)
64
- concord (~> 0.1.5)
41
+ unicode-display_width (>= 1.4.0, < 3.0)
42
+ rubocop-ast (1.7.0)
43
+ parser (>= 3.0.1.1)
44
+ rubocop-shopify (2.1.0)
45
+ rubocop (~> 1.13)
46
+ ruby-progressbar (1.11.0)
47
+ unicode-display_width (2.0.0)
48
+ unparser (0.6.0)
65
49
  diff-lcs (~> 1.3)
66
- equalizer (~> 0.0.9)
67
- parser (>= 2.6.5)
68
- procto (~> 0.0.2)
50
+ parser (>= 3.0.0)
69
51
  yard (0.9.25)
70
52
 
71
53
  PLATFORMS
@@ -77,7 +59,7 @@ DEPENDENCIES
77
59
  rspec
78
60
  rubocop-shopify
79
61
  rubocop-sorbet!
80
- unparser
62
+ unparser (~> 0.6)
81
63
  yard (~> 0.9)
82
64
 
83
65
  BUNDLED WITH
data/README.md CHANGED
@@ -60,6 +60,15 @@ RuboCop::RakeTask.new do |task|
60
60
  end
61
61
  ```
62
62
 
63
+ ### Rubocop rules for RBI files
64
+
65
+ Put this into your `.rubocop.yml`:
66
+
67
+ ```yaml
68
+ inherit_gem:
69
+ rubocop-sorbet: config/rbi.yml
70
+ ```
71
+
63
72
  ## The Cops
64
73
  All cops are located under [`lib/rubocop/cop/sorbet`](lib/rubocop/cop/sorbet), and contain examples/documentation.
65
74
 
@@ -94,6 +103,12 @@ bundle exec rake new_cop[Sorbet/NewCopName]
94
103
 
95
104
  which will create a skeleton cop, a skeleton spec, an entry in the default config file and will require the new cop so that it is properly exported from the gem.
96
105
 
106
+ Don't forget to update the documentation with:
107
+
108
+ ```sh
109
+ bundle exec rake generate_cops_documentation
110
+ ```
111
+
97
112
  ## License
98
113
 
99
114
  The gem is available as open source under the terms of the [MIT License](https://github.com/Shopify/rubocop-sorbet/blob/master/LICENSE.txt).
data/Rakefile CHANGED
@@ -1,40 +1,36 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require('bundler/gem_tasks')
3
+ require("bundler/gem_tasks")
4
4
 
5
- Dir['tasks/**/*.rake'].each { |t| load t }
5
+ Dir["tasks/**/*.rake"].each { |t| load t }
6
6
 
7
- require 'rubocop/rake_task'
8
- require 'rspec/core/rake_task'
7
+ require "rubocop/rake_task"
8
+ require "rspec/core/rake_task"
9
9
 
10
10
  RSpec::Core::RakeTask.new(:spec) do |spec|
11
- spec.pattern = FileList['spec/**/*_spec.rb']
11
+ spec.pattern = FileList["spec/**/*_spec.rb"]
12
12
  end
13
13
 
14
- task(default: %i[
15
- documentation_syntax_check
16
- generate_cops_documentation
17
- spec
18
- ])
14
+ task(default: [:documentation_syntax_check, :generate_cops_documentation, :spec])
19
15
 
20
- desc('Generate a new cop with a template')
16
+ desc("Generate a new cop with a template")
21
17
  task :new_cop, [:cop] do |_task, args|
22
- require 'rubocop'
18
+ require "rubocop"
23
19
 
24
20
  cop_name = args.fetch(:cop) do
25
- warn 'usage: bundle exec rake new_cop[Department/Name]'
21
+ warn("usage: bundle exec rake new_cop[Department/Name]")
26
22
  exit!
27
23
  end
28
24
 
29
25
  github_user = %x(git config github.user).chop
30
- github_user = 'Shopify' if github_user.empty?
26
+ github_user = "Shopify" if github_user.empty?
31
27
 
32
28
  generator = RuboCop::Cop::Generator.new(cop_name, github_user)
33
29
 
34
30
  generator.write_source
35
31
  generator.write_spec
36
- generator.inject_require(root_file_path: 'lib/rubocop/cop/sorbet_cops.rb')
37
- generator.inject_config(config_file_path: 'config/default.yml')
32
+ generator.inject_require(root_file_path: "lib/rubocop/cop/sorbet_cops.rb")
33
+ generator.inject_config(config_file_path: "config/default.yml")
38
34
 
39
35
  puts generator.todo
40
36
  end
data/bin/console CHANGED
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env ruby
2
2
  # frozen_string_literal: true
3
3
 
4
- require 'bundler/setup'
5
- require 'rubocop/sorbet'
4
+ require "bundler/setup"
5
+ require "rubocop/sorbet"
6
6
 
7
7
  # You can add fixtures and/or initialization code here to make experimenting
8
8
  # with your gem easier. You can also use a different console, if you like.
@@ -11,5 +11,5 @@ require 'rubocop/sorbet'
11
11
  # require "pry"
12
12
  # Pry.start
13
13
 
14
- require 'irb'
14
+ require "irb"
15
15
  IRB.start(__FILE__)
data/bin/rspec CHANGED
@@ -8,11 +8,11 @@
8
8
  # this file is here to facilitate running it.
9
9
  #
10
10
 
11
- require 'pathname'
12
- ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile',
11
+ require "pathname"
12
+ ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
13
13
  Pathname.new(__FILE__).realpath)
14
14
 
15
- bundle_binstub = File.expand_path('../bundle', __FILE__)
15
+ bundle_binstub = File.expand_path("../bundle", __FILE__)
16
16
 
17
17
  if File.file?(bundle_binstub)
18
18
  if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
@@ -23,7 +23,7 @@ Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this
23
23
  end
24
24
  end
25
25
 
26
- require 'rubygems'
27
- require 'bundler/setup'
26
+ require "rubygems"
27
+ require "bundler/setup"
28
28
 
29
- load(Gem.bin_path('rspec-core', 'rspec'))
29
+ load(Gem.bin_path("rspec-core", "rspec"))
data/config/default.yml CHANGED
@@ -16,7 +16,8 @@ Sorbet/BindingConstantWithoutTypeAlias:
16
16
 
17
17
  Sorbet/CallbackConditionalsBinding:
18
18
  Description: 'Ensures callback conditionals are bound to the right type.'
19
- Enabled: true
19
+ Enabled: false
20
+ Safe: false
20
21
  VersionAdded: 0.7.0
21
22
 
22
23
  Sorbet/CheckedTrueInSignature:
@@ -38,6 +39,11 @@ Sorbet/EnforceSigilOrder:
38
39
  Enabled: true
39
40
  VersionAdded: 0.3.4
40
41
 
42
+ Sorbet/sigils/EnforceSingleSigil:
43
+ Description: 'Ensures that there is only one Sorbet sigil in a file.'
44
+ Enabled: true
45
+ VersionAdded: '<<next>>'
46
+
41
47
  Sorbet/EnforceSignatures:
42
48
  Description: 'Ensures all methods have a valid signature.'
43
49
  Enabled: false
@@ -49,10 +55,7 @@ Sorbet/FalseSigil:
49
55
  VersionAdded: 0.3.3
50
56
  SuggestedStrictness: "false"
51
57
  Include:
52
- - "**/*.rb"
53
- - "**/*.rbi"
54
- - "**/*.rake"
55
- - "**/*.ru"
58
+ - "**/*.{rb,rbi,rake,ru}"
56
59
  Exclude:
57
60
  - bin/**/*
58
61
  - db/**/*.rb
@@ -65,10 +68,12 @@ Sorbet/ForbidExtendTSigHelpersInShims:
65
68
  Include:
66
69
  - "**/*.rbi"
67
70
 
68
- Sorbet/ForbidRBIOutsideOfSorbetDir:
69
- Description: 'Forbids RBI files outside of the sorbet/ directory.'
71
+ Sorbet/ForbidRBIOutsideOfAllowedPaths:
72
+ Description: 'Forbids RBI files outside of the allowed paths'
70
73
  Enabled: true
71
74
  VersionAdded: 0.6.1
75
+ AllowedPaths:
76
+ - "sorbet/rbi/**"
72
77
  Include:
73
78
  - "**/*.rbi"
74
79
 
@@ -105,12 +110,24 @@ Sorbet/HasSigil:
105
110
  SuggestedStrictness: "false"
106
111
  MinimumStrictness: "false"
107
112
  VersionAdded: 0.3.3
113
+ Include:
114
+ - "**/*.{rb,rbi,rake,ru}"
115
+ Exclude:
116
+ - bin/**/*
117
+ - db/**/*.rb
118
+ - script/**/*
108
119
 
109
120
  Sorbet/IgnoreSigil:
110
121
  Description: 'All files must be at least at strictness `ignore`.'
111
122
  Enabled: false
112
123
  SuggestedStrictness: "ignore"
113
124
  VersionAdded: 0.3.3
125
+ Include:
126
+ - "**/*.{rb,rbi,rake,ru}"
127
+ Exclude:
128
+ - bin/**/*
129
+ - db/**/*.rb
130
+ - script/**/*
114
131
 
115
132
  Sorbet/KeywordArgumentOrdering:
116
133
  Description: >-
@@ -127,11 +144,6 @@ Sorbet/OneAncestorPerLine:
127
144
  Enabled: false
128
145
  VersionAdded: '0.6.0'
129
146
 
130
- Sorbet/ParametersOrderingInSignature:
131
- Description: 'Enforces same parameter order between a method and its signature.'
132
- Enabled: true
133
- VersionAdded: 0.2.0
134
-
135
147
  Sorbet/SignatureBuildOrder:
136
148
  Description: >-
137
149
  Enforces the order of parts in a signature.
@@ -154,18 +166,36 @@ Sorbet/StrictSigil:
154
166
  Enabled: false
155
167
  SuggestedStrictness: "strict"
156
168
  VersionAdded: 0.3.3
169
+ Include:
170
+ - "**/*.{rb,rbi,rake,ru}"
171
+ Exclude:
172
+ - bin/**/*
173
+ - db/**/*.rb
174
+ - script/**/*
157
175
 
158
176
  Sorbet/StrongSigil:
159
177
  Description: 'All files must be at least at strictness `strong`.'
160
178
  Enabled: false
161
179
  SuggestedStrictness: "strong"
162
180
  VersionAdded: 0.3.3
181
+ Include:
182
+ - "**/*.{rb,rbi,rake,ru}"
183
+ Exclude:
184
+ - bin/**/*
185
+ - db/**/*.rb
186
+ - script/**/*
163
187
 
164
188
  Sorbet/TrueSigil:
165
189
  Description: 'All files must be at least at strictness `true`.'
166
190
  Enabled: false
167
191
  SuggestedStrictness: "true"
168
192
  VersionAdded: 0.3.3
193
+ Include:
194
+ - "**/*.{rb,rbi,rake,ru}"
195
+ Exclude:
196
+ - bin/**/*
197
+ - db/**/*.rb
198
+ - script/**/*
169
199
 
170
200
  Sorbet/ValidSigil:
171
201
  Description: 'All files must have a valid sigil.'
@@ -174,3 +204,9 @@ Sorbet/ValidSigil:
174
204
  SuggestedStrictness: "false"
175
205
  MinimumStrictness: "false"
176
206
  VersionAdded: 0.3.3
207
+ Include:
208
+ - "**/*.{rb,rbi,rake,ru}"
209
+ Exclude:
210
+ - bin/**/*
211
+ - db/**/*.rb
212
+ - script/**/*
data/config/rbi.yml ADDED
@@ -0,0 +1,262 @@
1
+ require:
2
+ - rubocop-sorbet
3
+
4
+ AllCops:
5
+ TargetRubyVersion: 3.0
6
+ DisabledByDefault: true
7
+ Include:
8
+ - '**/*.rbi'
9
+
10
+ ## Layout
11
+
12
+ Layout/AccessModifierIndentation:
13
+ Enabled: true
14
+
15
+ Layout/ArgumentAlignment:
16
+ Enabled: true
17
+
18
+ Layout/BlockAlignment:
19
+ Enabled: true
20
+
21
+ Layout/BlockEndNewline:
22
+ Enabled: true
23
+
24
+ Layout/ClassStructure:
25
+ Enabled: true
26
+ ExpectedOrder:
27
+ - module_inclusion
28
+ - macros
29
+ - public_attribute_macros
30
+ - protected_attribute_macros
31
+ - private_attribute_macros
32
+ - initializer
33
+ - public_methods
34
+ - protected_methods
35
+ - private_methods
36
+ - public_class_methods
37
+ - constants
38
+
39
+ Layout/ClosingParenthesisIndentation:
40
+ Enabled: true
41
+
42
+ Layout/CommentIndentation:
43
+ Enabled: true
44
+
45
+ Layout/EmptyComment:
46
+ Enabled: true
47
+
48
+ Layout/EmptyLineAfterMagicComment:
49
+ Enabled: true
50
+
51
+ Layout/EmptyLineBetweenDefs:
52
+ Enabled: true
53
+ AllowAdjacentOneLineDefs: true
54
+
55
+ Layout/EmptyLines:
56
+ Enabled: true
57
+
58
+ Layout/EmptyLinesAroundAccessModifier:
59
+ Enabled: true
60
+
61
+ Layout/EmptyLinesAroundArguments:
62
+ Enabled: true
63
+
64
+ Layout/EmptyLinesAroundAttributeAccessor:
65
+ Enabled: true
66
+
67
+ Layout/EmptyLinesAroundBlockBody:
68
+ Enabled: true
69
+
70
+ Layout/EmptyLinesAroundClassBody:
71
+ Enabled: true
72
+
73
+ Layout/EmptyLinesAroundModuleBody:
74
+ Enabled: true
75
+
76
+ Layout/EndOfLine:
77
+ Enabled: true
78
+ EnforcedStyle: lf
79
+
80
+ Layout/ExtraSpacing:
81
+ Enabled: true
82
+
83
+ Layout/FirstMethodArgumentLineBreak:
84
+ Enabled: true
85
+
86
+ Layout/FirstMethodParameterLineBreak:
87
+ Enabled: true
88
+
89
+ Layout/FirstParameterIndentation:
90
+ Enabled: true
91
+
92
+ Layout/IndentationConsistency:
93
+ Enabled: true
94
+
95
+ Layout/IndentationStyle:
96
+ Enabled: true
97
+ EnforcedStyle: spaces
98
+
99
+ Layout/IndentationWidth:
100
+ Enabled: true
101
+
102
+ Layout/InitialIndentation:
103
+ Enabled: true
104
+
105
+ Layout/LeadingCommentSpace:
106
+ Enabled: true
107
+
108
+ Layout/LeadingEmptyLines:
109
+ Enabled: true
110
+
111
+ # TODO: make Tapioca break long lines?
112
+ Layout/LineLength:
113
+ Enabled: false
114
+
115
+ Layout/MultilineBlockLayout:
116
+ Enabled: true
117
+
118
+ Layout/MultilineMethodArgumentLineBreaks:
119
+ Enabled: true
120
+
121
+ Layout/MultilineMethodCallBraceLayout:
122
+ Enabled: true
123
+
124
+ Layout/MultilineMethodCallIndentation:
125
+ Enabled: true
126
+
127
+ Layout/ParameterAlignment:
128
+ Enabled: true
129
+
130
+ Layout/RedundantLineBreak:
131
+ Enabled: true
132
+
133
+ Layout/SpaceAfterColon:
134
+ Enabled: true
135
+
136
+ Layout/SpaceAfterComma:
137
+ Enabled: true
138
+
139
+ Layout/SpaceAfterMethodName:
140
+ Enabled: true
141
+
142
+ Layout/SpaceAfterSemicolon:
143
+ Enabled: true
144
+
145
+ Layout/SpaceAroundEqualsInParameterDefault:
146
+ Enabled: true
147
+
148
+ Layout/SpaceAroundKeyword:
149
+ Enabled: true
150
+
151
+ Layout/SpaceAroundMethodCallOperator:
152
+ Enabled: true
153
+
154
+ Layout/SpaceBeforeBlockBraces:
155
+ Enabled: true
156
+
157
+ Layout/SpaceBeforeBrackets:
158
+ Enabled: true
159
+
160
+ Layout/SpaceBeforeComma:
161
+ Enabled: true
162
+
163
+ Layout/SpaceBeforeComment:
164
+ Enabled: true
165
+
166
+ Layout/SpaceBeforeFirstArg:
167
+ Enabled: true
168
+
169
+ Layout/SpaceBeforeSemicolon:
170
+ Enabled: true
171
+
172
+ Layout/SpaceInsideParens:
173
+ Enabled: true
174
+
175
+ Layout/TrailingEmptyLines:
176
+ Enabled: true
177
+ EnforcedStyle: final_newline
178
+
179
+ Layout/TrailingWhitespace:
180
+ Enabled: true
181
+
182
+ ## Lint
183
+
184
+ Lint/DuplicateMethods:
185
+ Enabled: true
186
+
187
+ Lint/EmptyFile:
188
+ Enabled: true
189
+ AllowComments: false
190
+
191
+ Lint/SyntaxError:
192
+ Enabled: true
193
+
194
+ ## Sorbet
195
+
196
+ Sorbet:
197
+ DisabledByDefault: true
198
+
199
+ Sorbet/EnforceSigilOrder:
200
+ Enabled: true
201
+
202
+ Sorbet/ForbidExtendTSigHelpersInShims:
203
+ Enabled: true
204
+
205
+ Sorbet/ForbidIncludeConstLiteral:
206
+ Enabled: true
207
+
208
+ Sorbet/ForbidSuperclassConstLiteral:
209
+ Enabled: true
210
+
211
+ Sorbet/OneAncestorPerLine:
212
+ Enabled: true
213
+
214
+ Sorbet/SignatureBuildOrder:
215
+ Enabled: true
216
+
217
+ Sorbet/SingleLineRbiClassModuleDefinitions:
218
+ Enabled: true
219
+
220
+ Sorbet/ValidSigil:
221
+ Enabled: true
222
+ RequireSigilOnAllFiles: true
223
+ MinimumStrictness: "false"
224
+ SuggestedStrictness: "true"
225
+
226
+ ## Style
227
+
228
+ Style/ClassAndModuleChildren:
229
+ Enabled: true
230
+ EnforcedStyle: compact
231
+
232
+ Style/DefWithParentheses:
233
+ Enabled: true
234
+
235
+ Style/EmptyMethod:
236
+ Enabled: true
237
+ EnforcedStyle: compact
238
+
239
+ Style/FrozenStringLiteralComment:
240
+ Enabled: true
241
+ EnforcedStyle: never
242
+
243
+ Style/MethodCallWithArgsParentheses:
244
+ Enabled: true
245
+ IgnoreMacros: true
246
+
247
+ Style/MethodCallWithoutArgsParentheses:
248
+ Enabled: true
249
+
250
+ Style/MethodDefParentheses:
251
+ Enabled: true
252
+
253
+ Style/MixinGrouping:
254
+ Enabled: true
255
+ EnforcedStyle: separated
256
+
257
+ Style/MixinUsage:
258
+ Enabled: true
259
+
260
+ Style/ModuleFunction:
261
+ Enabled: true
262
+ EnforcedStyle: forbidden
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'rubocop'
3
+ require "rubocop"
4
4
 
5
5
  module RuboCop
6
6
  module Cop
@@ -94,16 +94,16 @@ module RuboCop
94
94
  add_offense(
95
95
  node.children[2],
96
96
  message: "It looks like you're using the old `T.type_alias` syntax. " \
97
- '`T.type_alias` now expects a block.' \
97
+ "`T.type_alias` now expects a block." \
98
98
  'Run Sorbet with the options "--autocorrect --error-white-list=5043" ' \
99
- 'to automatically upgrade to the new syntax.'
99
+ "to automatically upgrade to the new syntax."
100
100
  )
101
101
  return
102
102
  end
103
103
  add_offense(
104
104
  node.children[2],
105
105
  message: "It looks like you're trying to bind a type to a constant. " \
106
- 'To do this, you must alias the type using `T.type_alias`.'
106
+ "To do this, you must alias the type using `T.type_alias`."
107
107
  )
108
108
  end
109
109