salsify_rubocop 1.2.0 → 1.27.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +1 -0
- data/CHANGELOG.md +8 -0
- data/README.md +0 -1
- data/conf/rubocop_rails.yml +113 -0
- data/conf/rubocop_without_rspec.yml +89 -0
- data/lib/rubocop/cop/salsify/rails_application_mailer.rb +2 -1
- data/lib/rubocop/cop/salsify/rails_application_serializer.rb +2 -1
- data/lib/rubocop/cop/salsify/rspec_doc_string.rb +35 -6
- data/lib/rubocop/cop/salsify/rspec_string_literals.rb +1 -0
- data/lib/salsify_rubocop/version.rb +1 -1
- data/salsify_rubocop.gemspec +4 -4
- metadata +10 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ce5d5cbb06696fde312271fdf7309d421476dc692129a4a483211fcd794f9fe8
|
4
|
+
data.tar.gz: 182edaf990710370a9a125f96e021e2185fa13f89c93e5d07001f60409fab3e7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e77dd48c195e9018fdb6514f0460cf0568e2c2410246986eca8b84581f7fc34d65d830f1d16f516788f1dd4b5a468a40869ed20a88da3dc942e1b4e184e22ed3
|
7
|
+
data.tar.gz: 8a072d0da7d78be213a1c310402ed8a05e19b3c4729356f96db5412edb9c0b4a95044810546e2ba38d15426ef9399cb8c2cb20c2755a892aa30c069d1cc12d7f
|
data/.circleci/config.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,13 @@
|
|
1
1
|
# salsify_rubocop
|
2
2
|
|
3
|
+
## 1.27.0
|
4
|
+
- Note: Previous versions had drifted from the documented versioning scheme,
|
5
|
+
which states that versions should match the shipped version of `rubocop`.
|
6
|
+
- Upgrade to `rubocop` v1.27.0 with support for Ruby 3.1.
|
7
|
+
- Upgrade `rubocop-rails` to v2.12.0.
|
8
|
+
- Upgrade `rubocop-rspec` to v2.9.0.
|
9
|
+
- Upgrade `rubocop-performance` to v1.12.0.
|
10
|
+
|
3
11
|
## 1.2.0
|
4
12
|
- Disable Style/ExplicitBlockArgument for performance reasons, https://github.com/JuanitoFatas/fast-ruby/blob/master/code/proc-and-block/proc-call-vs-yield.rb.
|
5
13
|
|
data/README.md
CHANGED
@@ -127,7 +127,6 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
127
127
|
|
128
128
|
Bug reports and pull requests are welcome on GitHub at https://github.com/salsify/salsify_rubocop.
|
129
129
|
|
130
|
-
|
131
130
|
## License
|
132
131
|
|
133
132
|
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
data/conf/rubocop_rails.yml
CHANGED
@@ -24,3 +24,116 @@ Rails/UniqBeforePluck:
|
|
24
24
|
|
25
25
|
Salsify/RailsUnscoped:
|
26
26
|
Enabled: true
|
27
|
+
|
28
|
+
# Disabled for v2.4.0 -> v2.12.0 upgrade.
|
29
|
+
Rails/ActiveRecordCallbacksOrder:
|
30
|
+
Enabled: false
|
31
|
+
|
32
|
+
Rails/AddColumnIndex:
|
33
|
+
Enabled: false
|
34
|
+
|
35
|
+
Rails/AfterCommitOverride:
|
36
|
+
Enabled: false
|
37
|
+
|
38
|
+
Rails/ArelStar:
|
39
|
+
Enabled: false
|
40
|
+
|
41
|
+
Rails/AttributeDefaultBlockValue:
|
42
|
+
Enabled: false
|
43
|
+
|
44
|
+
Rails/ContentTag:
|
45
|
+
Enabled: false
|
46
|
+
|
47
|
+
Rails/DefaultScope:
|
48
|
+
Enabled: false
|
49
|
+
|
50
|
+
Rails/EagerEvaluationLogMessage:
|
51
|
+
Enabled: false
|
52
|
+
|
53
|
+
Rails/EnvironmentVariableAccess:
|
54
|
+
Enabled: false
|
55
|
+
|
56
|
+
Rails/ExpandedDateRange:
|
57
|
+
Enabled: false
|
58
|
+
|
59
|
+
Rails/FindById:
|
60
|
+
Enabled: false
|
61
|
+
|
62
|
+
Rails/I18nLocaleAssignment:
|
63
|
+
Enabled: false
|
64
|
+
|
65
|
+
Rails/IndexBy:
|
66
|
+
Enabled: false
|
67
|
+
|
68
|
+
Rails/IndexWith:
|
69
|
+
Enabled: false
|
70
|
+
|
71
|
+
Rails/Inquiry:
|
72
|
+
Enabled: false
|
73
|
+
|
74
|
+
Rails/MailerName:
|
75
|
+
Enabled: false
|
76
|
+
|
77
|
+
Rails/MatchRoute:
|
78
|
+
Enabled: false
|
79
|
+
|
80
|
+
Rails/NegateInclude:
|
81
|
+
Enabled: false
|
82
|
+
|
83
|
+
Rails/OrderById:
|
84
|
+
Enabled: false
|
85
|
+
|
86
|
+
Rails/Pick:
|
87
|
+
Enabled: false
|
88
|
+
|
89
|
+
Rails/Pluck:
|
90
|
+
Enabled: false
|
91
|
+
|
92
|
+
Rails/PluckId:
|
93
|
+
Enabled: false
|
94
|
+
|
95
|
+
Rails/PluckInWhere:
|
96
|
+
Enabled: false
|
97
|
+
|
98
|
+
Rails/RedundantForeignKey:
|
99
|
+
Enabled: false
|
100
|
+
|
101
|
+
Rails/RedundantTravelBack:
|
102
|
+
Enabled: false
|
103
|
+
|
104
|
+
Rails/RenderInline:
|
105
|
+
Enabled: false
|
106
|
+
|
107
|
+
Rails/RenderPlainText:
|
108
|
+
Enabled: false
|
109
|
+
|
110
|
+
Rails/RequireDependency:
|
111
|
+
Enabled: false
|
112
|
+
|
113
|
+
Rails/ReversibleMigrationMethodDefinition:
|
114
|
+
Enabled: false
|
115
|
+
|
116
|
+
Rails/ShortI18n:
|
117
|
+
Enabled: false
|
118
|
+
|
119
|
+
Rails/SquishedSQLHeredocs:
|
120
|
+
Enabled: false
|
121
|
+
|
122
|
+
Rails/TimeZoneAssignment:
|
123
|
+
Enabled: false
|
124
|
+
|
125
|
+
Rails/UniqueValidationWithoutIndex:
|
126
|
+
Enabled: false
|
127
|
+
|
128
|
+
Rails/UnusedIgnoredColumns:
|
129
|
+
Enabled: false
|
130
|
+
|
131
|
+
Rails/WhereEquals:
|
132
|
+
Enabled: false
|
133
|
+
|
134
|
+
Rails/WhereExists:
|
135
|
+
Enabled: false
|
136
|
+
|
137
|
+
Rails/WhereNot:
|
138
|
+
Enabled: false
|
139
|
+
# End updates for v2.4.0 -> v2.12.0 upgrade.
|
@@ -240,3 +240,92 @@ Style/RedundantSelfAssignment:
|
|
240
240
|
|
241
241
|
Style/SingleArgumentDig:
|
242
242
|
Enabled: false
|
243
|
+
|
244
|
+
# Added for v1.13.0 -> v1.27.0 version bump.
|
245
|
+
Bundler/GemFilename:
|
246
|
+
Enabled: false
|
247
|
+
|
248
|
+
Bundler/GemVersion:
|
249
|
+
Enabled: false
|
250
|
+
|
251
|
+
Gemspec/RequireMFA:
|
252
|
+
Enabled: false
|
253
|
+
|
254
|
+
Layout/LineEndStringConcatenationIndentation:
|
255
|
+
Enabled: false
|
256
|
+
|
257
|
+
Layout/SingleLineBlockChain:
|
258
|
+
Enabled: false
|
259
|
+
|
260
|
+
Lint/AmbiguousOperatorPrecedence:
|
261
|
+
Enabled: false
|
262
|
+
|
263
|
+
Lint/AmbiguousRange:
|
264
|
+
Enabled: false
|
265
|
+
|
266
|
+
Lint/EmptyInPattern:
|
267
|
+
Enabled: false
|
268
|
+
|
269
|
+
Lint/IncompatibleIoSelectWithFiberScheduler:
|
270
|
+
Enabled: false
|
271
|
+
|
272
|
+
Lint/RefinementImportMethods:
|
273
|
+
Enabled: false
|
274
|
+
|
275
|
+
Lint/RequireRelativeSelfPath:
|
276
|
+
Enabled: false
|
277
|
+
|
278
|
+
Lint/UselessRuby2Keywords:
|
279
|
+
Enabled: false
|
280
|
+
|
281
|
+
Naming/BlockForwarding:
|
282
|
+
Enabled: false
|
283
|
+
|
284
|
+
Naming/InclusiveLanguage:
|
285
|
+
Enabled: false
|
286
|
+
|
287
|
+
Security/IoMethods:
|
288
|
+
Enabled: false
|
289
|
+
|
290
|
+
Style/FileRead:
|
291
|
+
Enabled: false
|
292
|
+
|
293
|
+
Style/FileWrite:
|
294
|
+
Enabled: false
|
295
|
+
|
296
|
+
Style/InPatternThen:
|
297
|
+
Enabled: false
|
298
|
+
|
299
|
+
Style/MapToHash:
|
300
|
+
Enabled: false
|
301
|
+
|
302
|
+
Style/MultilineInPatternThen:
|
303
|
+
Enabled: false
|
304
|
+
|
305
|
+
Style/NestedFileDirname:
|
306
|
+
Enabled: false
|
307
|
+
|
308
|
+
Style/NumberedParameters:
|
309
|
+
Enabled: false
|
310
|
+
|
311
|
+
Style/NumberedParametersLimit:
|
312
|
+
Enabled: false
|
313
|
+
|
314
|
+
Style/OpenStructUse:
|
315
|
+
Enabled: false
|
316
|
+
|
317
|
+
Style/QuotedSymbols:
|
318
|
+
Enabled: false
|
319
|
+
|
320
|
+
Style/RedundantInitialize:
|
321
|
+
Enabled: false
|
322
|
+
|
323
|
+
Style/RedundantSelfAssignmentBranch:
|
324
|
+
Enabled: false
|
325
|
+
|
326
|
+
Style/SelectByRegexp:
|
327
|
+
Enabled: false
|
328
|
+
|
329
|
+
Style/TopLevelMethodDefinition:
|
330
|
+
Enabled: false
|
331
|
+
# End updates for v1.13.0 -> v1.27.0 version bump.
|
@@ -16,8 +16,9 @@ module RuboCop
|
|
16
16
|
# class Yugo < ActionMailer::Base
|
17
17
|
# ...
|
18
18
|
# end
|
19
|
-
class RailsApplicationMailer < Cop
|
19
|
+
class RailsApplicationMailer < RuboCop::Cop::Base
|
20
20
|
extend TargetRailsVersion
|
21
|
+
extend RuboCop::Cop::AutoCorrector
|
21
22
|
|
22
23
|
minimum_target_rails_version 5.0
|
23
24
|
|
@@ -16,8 +16,9 @@ module RuboCop
|
|
16
16
|
# class Yugo < ActiveModel::Serializer
|
17
17
|
# ...
|
18
18
|
# end
|
19
|
-
class RailsApplicationSerializer < Cop
|
19
|
+
class RailsApplicationSerializer < RuboCop::Cop::Base
|
20
20
|
extend TargetRailsVersion
|
21
|
+
extend RuboCop::Cop::AutoCorrector
|
21
22
|
|
22
23
|
minimum_target_rails_version 5.0
|
23
24
|
|
@@ -28,12 +28,41 @@ module RuboCop
|
|
28
28
|
DOUBLE_QUOTE_MSG =
|
29
29
|
'Example Group/Example doc strings must be double-quoted.'
|
30
30
|
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
31
|
+
DOCUMENTED_METHODS = [
|
32
|
+
:context,
|
33
|
+
:describe,
|
34
|
+
:example,
|
35
|
+
:example_group,
|
36
|
+
:fcontext,
|
37
|
+
:fdescribe,
|
38
|
+
:feature,
|
39
|
+
:fexample,
|
40
|
+
:ffeature,
|
41
|
+
:fit,
|
42
|
+
:focus,
|
43
|
+
:fscenario,
|
44
|
+
:fspecify,
|
45
|
+
:include_context,
|
46
|
+
:include_examples,
|
47
|
+
:it,
|
48
|
+
:it_behaves_like,
|
49
|
+
:it_should_behave_like,
|
50
|
+
:its,
|
51
|
+
:pending,
|
52
|
+
:scenario,
|
53
|
+
:shared_context,
|
54
|
+
:shared_examples,
|
55
|
+
:shared_examples_for,
|
56
|
+
:skip,
|
57
|
+
:specify,
|
58
|
+
:xcontext,
|
59
|
+
:xdescribe,
|
60
|
+
:xexample,
|
61
|
+
:xfeature,
|
62
|
+
:xit,
|
63
|
+
:xscenario,
|
64
|
+
:xspecify
|
65
|
+
].freeze
|
37
66
|
|
38
67
|
def_node_matcher :documented_method?,
|
39
68
|
send_pattern(<<~PATTERN)
|
@@ -14,6 +14,7 @@ module RuboCop
|
|
14
14
|
class RspecStringLiterals < RuboCop::Cop::RSpec::Base
|
15
15
|
extend RuboCop::Cop::AutoCorrector
|
16
16
|
include ConfigurableEnforcedStyle
|
17
|
+
include StringHelp
|
17
18
|
include StringLiteralsHelp
|
18
19
|
|
19
20
|
DOCUMENTED_METHODS = RuboCop::Cop::Salsify::RspecDocString::DOCUMENTED_METHODS
|
data/salsify_rubocop.gemspec
CHANGED
@@ -37,8 +37,8 @@ Gem::Specification.new do |spec|
|
|
37
37
|
spec.add_development_dependency 'rspec', '~> 3.0'
|
38
38
|
spec.add_development_dependency 'rspec_junit_formatter'
|
39
39
|
|
40
|
-
spec.add_runtime_dependency 'rubocop', '~> 1.
|
41
|
-
spec.add_runtime_dependency 'rubocop-performance', '~> 1.
|
42
|
-
spec.add_runtime_dependency 'rubocop-rails', '~> 2.
|
43
|
-
spec.add_runtime_dependency 'rubocop-rspec', '~> 2.
|
40
|
+
spec.add_runtime_dependency 'rubocop', '~> 1.27.0'
|
41
|
+
spec.add_runtime_dependency 'rubocop-performance', '~> 1.12.0'
|
42
|
+
spec.add_runtime_dependency 'rubocop-rails', '~> 2.12.0'
|
43
|
+
spec.add_runtime_dependency 'rubocop-rspec', '~> 2.9.0'
|
44
44
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: salsify_rubocop
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.27.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Salsify, Inc
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-04-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -72,56 +72,56 @@ dependencies:
|
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: 1.
|
75
|
+
version: 1.27.0
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: 1.
|
82
|
+
version: 1.27.0
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: rubocop-performance
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
87
|
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: 1.
|
89
|
+
version: 1.12.0
|
90
90
|
type: :runtime
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
94
|
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version: 1.
|
96
|
+
version: 1.12.0
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: rubocop-rails
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
101
|
- - "~>"
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: 2.
|
103
|
+
version: 2.12.0
|
104
104
|
type: :runtime
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
108
|
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version: 2.
|
110
|
+
version: 2.12.0
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: rubocop-rspec
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
114
114
|
requirements:
|
115
115
|
- - "~>"
|
116
116
|
- !ruby/object:Gem::Version
|
117
|
-
version: 2.
|
117
|
+
version: 2.9.0
|
118
118
|
type: :runtime
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
122
|
- - "~>"
|
123
123
|
- !ruby/object:Gem::Version
|
124
|
-
version: 2.
|
124
|
+
version: 2.9.0
|
125
125
|
description: Shared RuboCop configuration
|
126
126
|
email:
|
127
127
|
- engineering@salsify.com
|