salsify_rubocop 1.1.0 → 1.27.1
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/.github/CODEOWNERS +1 -0
- data/CHANGELOG.md +14 -0
- data/README.md +0 -1
- data/conf/rubocop_rails.yml +113 -0
- data/conf/rubocop_without_rspec.yml +98 -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 +6 -6
- metadata +18 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4858a3104641455a362aff7d1dcf9c7666f61f81ec954bccd8f71e96d9f08831
|
4
|
+
data.tar.gz: 785e24363210b51765e5dc392382325f3c0441c4196e0d0b96a433b549636f40
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2b196f52a16768febf63e6779525cd25cee0d7d255bea11f1e498f8865da8d39fe2edcbcedff0b6af0dd1abd9f3d20c5a21727c9c0381dfa5e7e0d982836406e
|
7
|
+
data.tar.gz: 11c29e4f3976a435e98744468ce7995b9e01fe46c89d4544d629c77a0ed634da85bc2e069764a69f43e73c527a2ce6ff5ffbd509c07bdae9a5c30c59df841870
|
data/.circleci/config.yml
CHANGED
data/.github/CODEOWNERS
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
* @jturkel @erikkessler1 @skarger
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,19 @@
|
|
1
1
|
# salsify_rubocop
|
2
2
|
|
3
|
+
## 1.27.1
|
4
|
+
- Set `Style/HashSyntax` option `EnforcedShorthandSyntax: either`, allowing both `{ foo: }` and `{ foo: foo }`
|
5
|
+
|
6
|
+
## 1.27.0
|
7
|
+
- Note: Previous versions had drifted from the documented versioning scheme,
|
8
|
+
which states that versions should match the shipped version of `rubocop`.
|
9
|
+
- Upgrade to `rubocop` v1.27.0 with support for Ruby 3.1.
|
10
|
+
- Upgrade `rubocop-rails` to v2.12.0.
|
11
|
+
- Upgrade `rubocop-rspec` to v2.9.0.
|
12
|
+
- Upgrade `rubocop-performance` to v1.12.0.
|
13
|
+
|
14
|
+
## 1.2.0
|
15
|
+
- Disable Style/ExplicitBlockArgument for performance reasons, https://github.com/JuanitoFatas/fast-ruby/blob/master/code/proc-and-block/proc-call-vs-yield.rb.
|
16
|
+
|
3
17
|
## 1.1.0
|
4
18
|
- Re-enable version specifier checks for the `Bundler/GemComment` cop, for limiting version specifiers only.
|
5
19
|
- Upgrade to `rubocop` v1.13.0
|
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.
|
@@ -78,6 +78,11 @@ Style/EmptyLiteral:
|
|
78
78
|
Style/EmptyMethod:
|
79
79
|
Enabled: false
|
80
80
|
|
81
|
+
# Disabling due to performance implications.
|
82
|
+
# https://github.com/JuanitoFatas/fast-ruby/blob/master/code/proc-and-block/proc-call-vs-yield.rb
|
83
|
+
Style/ExplicitBlockArgument:
|
84
|
+
Enabled: false
|
85
|
+
|
81
86
|
# The Exclude list is not additive. Projects that exclude file names will
|
82
87
|
# need to re-add Appraisals.
|
83
88
|
Naming/FileName:
|
@@ -227,6 +232,10 @@ Style/HashAsLastArrayItem:
|
|
227
232
|
Style/HashEachMethods:
|
228
233
|
Enabled: false
|
229
234
|
|
235
|
+
# Allow both { foo: } and { foo: foo }
|
236
|
+
Style/HashSyntax:
|
237
|
+
EnforcedShorthandSyntax: either
|
238
|
+
|
230
239
|
Style/OptionalBooleanParameter:
|
231
240
|
Enabled: false
|
232
241
|
|
@@ -235,3 +244,92 @@ Style/RedundantSelfAssignment:
|
|
235
244
|
|
236
245
|
Style/SingleArgumentDig:
|
237
246
|
Enabled: false
|
247
|
+
|
248
|
+
# Added for v1.13.0 -> v1.27.0 version bump.
|
249
|
+
Bundler/GemFilename:
|
250
|
+
Enabled: false
|
251
|
+
|
252
|
+
Bundler/GemVersion:
|
253
|
+
Enabled: false
|
254
|
+
|
255
|
+
Gemspec/RequireMFA:
|
256
|
+
Enabled: false
|
257
|
+
|
258
|
+
Layout/LineEndStringConcatenationIndentation:
|
259
|
+
Enabled: false
|
260
|
+
|
261
|
+
Layout/SingleLineBlockChain:
|
262
|
+
Enabled: false
|
263
|
+
|
264
|
+
Lint/AmbiguousOperatorPrecedence:
|
265
|
+
Enabled: false
|
266
|
+
|
267
|
+
Lint/AmbiguousRange:
|
268
|
+
Enabled: false
|
269
|
+
|
270
|
+
Lint/EmptyInPattern:
|
271
|
+
Enabled: false
|
272
|
+
|
273
|
+
Lint/IncompatibleIoSelectWithFiberScheduler:
|
274
|
+
Enabled: false
|
275
|
+
|
276
|
+
Lint/RefinementImportMethods:
|
277
|
+
Enabled: false
|
278
|
+
|
279
|
+
Lint/RequireRelativeSelfPath:
|
280
|
+
Enabled: false
|
281
|
+
|
282
|
+
Lint/UselessRuby2Keywords:
|
283
|
+
Enabled: false
|
284
|
+
|
285
|
+
Naming/BlockForwarding:
|
286
|
+
Enabled: false
|
287
|
+
|
288
|
+
Naming/InclusiveLanguage:
|
289
|
+
Enabled: false
|
290
|
+
|
291
|
+
Security/IoMethods:
|
292
|
+
Enabled: false
|
293
|
+
|
294
|
+
Style/FileRead:
|
295
|
+
Enabled: false
|
296
|
+
|
297
|
+
Style/FileWrite:
|
298
|
+
Enabled: false
|
299
|
+
|
300
|
+
Style/InPatternThen:
|
301
|
+
Enabled: false
|
302
|
+
|
303
|
+
Style/MapToHash:
|
304
|
+
Enabled: false
|
305
|
+
|
306
|
+
Style/MultilineInPatternThen:
|
307
|
+
Enabled: false
|
308
|
+
|
309
|
+
Style/NestedFileDirname:
|
310
|
+
Enabled: false
|
311
|
+
|
312
|
+
Style/NumberedParameters:
|
313
|
+
Enabled: false
|
314
|
+
|
315
|
+
Style/NumberedParametersLimit:
|
316
|
+
Enabled: false
|
317
|
+
|
318
|
+
Style/OpenStructUse:
|
319
|
+
Enabled: false
|
320
|
+
|
321
|
+
Style/QuotedSymbols:
|
322
|
+
Enabled: false
|
323
|
+
|
324
|
+
Style/RedundantInitialize:
|
325
|
+
Enabled: false
|
326
|
+
|
327
|
+
Style/RedundantSelfAssignmentBranch:
|
328
|
+
Enabled: false
|
329
|
+
|
330
|
+
Style/SelectByRegexp:
|
331
|
+
Enabled: false
|
332
|
+
|
333
|
+
Style/TopLevelMethodDefinition:
|
334
|
+
Enabled: false
|
335
|
+
# 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
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
|
|
10
10
|
spec.authors = ['Salsify, Inc']
|
11
11
|
spec.email = ['engineering@salsify.com']
|
12
12
|
|
13
|
-
spec.summary = 'Shared
|
13
|
+
spec.summary = 'Shared RuboCop configuration'
|
14
14
|
spec.description = spec.summary
|
15
15
|
spec.homepage = 'https://github.com/salsify/salsify_rubocop'
|
16
16
|
|
@@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
|
|
20
20
|
# delete this section to allow pushing this gem to any host.
|
21
21
|
if spec.respond_to?(:metadata)
|
22
22
|
spec.metadata['allowed_push_host'] = 'https://rubygems.org'
|
23
|
-
|
23
|
+
spec.metadata['rubygems_mfa_required'] = 'true'
|
24
24
|
else
|
25
25
|
raise 'RubyGems 2.0 or newer is required to protect against public gem pushes.'
|
26
26
|
end
|
@@ -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.1
|
4
|
+
version: 1.27.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Salsify, Inc
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-05-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -72,57 +72,57 @@ 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.
|
125
|
-
description: Shared
|
124
|
+
version: 2.9.0
|
125
|
+
description: Shared RuboCop configuration
|
126
126
|
email:
|
127
127
|
- engineering@salsify.com
|
128
128
|
executables: []
|
@@ -130,6 +130,7 @@ extensions: []
|
|
130
130
|
extra_rdoc_files: []
|
131
131
|
files:
|
132
132
|
- ".circleci/config.yml"
|
133
|
+
- ".github/CODEOWNERS"
|
133
134
|
- ".gitignore"
|
134
135
|
- ".rspec"
|
135
136
|
- ".rubocop.yml"
|
@@ -160,7 +161,8 @@ licenses:
|
|
160
161
|
- MIT
|
161
162
|
metadata:
|
162
163
|
allowed_push_host: https://rubygems.org
|
163
|
-
|
164
|
+
rubygems_mfa_required: 'true'
|
165
|
+
post_install_message:
|
164
166
|
rdoc_options: []
|
165
167
|
require_paths:
|
166
168
|
- lib
|
@@ -175,8 +177,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
175
177
|
- !ruby/object:Gem::Version
|
176
178
|
version: '0'
|
177
179
|
requirements: []
|
178
|
-
rubygems_version: 3.
|
179
|
-
signing_key:
|
180
|
+
rubygems_version: 3.2.33
|
181
|
+
signing_key:
|
180
182
|
specification_version: 4
|
181
|
-
summary: Shared
|
183
|
+
summary: Shared RuboCop configuration
|
182
184
|
test_files: []
|