salsify_rubocop 1.0.1 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.circleci/config.yml +46 -9
- data/.github/CODEOWNERS +1 -0
- data/.rubocop.yml +1 -1
- data/CHANGELOG.md +12 -0
- data/conf/rubocop_without_rspec.yml +10 -1
- data/lib/rubocop/cop/salsify/rspec_doc_string.rb +3 -3
- data/lib/rubocop/cop/salsify/rspec_string_literals.rb +4 -3
- data/lib/salsify_rubocop/version.rb +1 -1
- data/salsify_rubocop.gemspec +5 -5
- metadata +15 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1a27b274167c99b0c602b8179de3b2cc833019ebcdb893278604a5259dc6b011
|
4
|
+
data.tar.gz: b15ac3e56b5ea6095f0dac07858e00aa55a22239dd86611ab97775cbee047d86
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c3709691e18170f955bc6825637234031dde141fa27a402ac4e3e64c904ee9a063c631587fd3b163a21e94a08a971e36be7d98600baebae8fd894e337c3de03e
|
7
|
+
data.tar.gz: 8adc382c5cb2ba0b196c12452591e5f42af2f7f687c1f2c71b43d62fdf9c47523572c3a535acb4fa7f42ee44af830c941b0bdeee34a82ce47cb8bae350ef0586
|
data/.circleci/config.yml
CHANGED
@@ -1,17 +1,15 @@
|
|
1
|
-
version: 2
|
1
|
+
version: 2.1
|
2
2
|
jobs:
|
3
|
-
|
3
|
+
lint:
|
4
4
|
docker:
|
5
|
-
- image: salsify/ruby_ci:2.
|
6
|
-
environment:
|
7
|
-
CIRCLE_TEST_REPORTS: "test-results"
|
5
|
+
- image: salsify/ruby_ci:2.6.6
|
8
6
|
working_directory: ~/salsify_rubocop
|
9
7
|
steps:
|
10
8
|
- checkout
|
11
9
|
- restore_cache:
|
12
10
|
keys:
|
13
|
-
- v1-gems-ruby-2.
|
14
|
-
- v1-gems-ruby-2.
|
11
|
+
- v1-gems-ruby-2.6.6-{{ checksum "salsify_rubocop.gemspec" }}-{{ checksum "Gemfile" }}
|
12
|
+
- v1-gems-ruby-2.6.6-
|
15
13
|
- run:
|
16
14
|
name: Install Gems
|
17
15
|
command: |
|
@@ -20,15 +18,54 @@ jobs:
|
|
20
18
|
bundle clean
|
21
19
|
fi
|
22
20
|
- save_cache:
|
23
|
-
key: v1-gems-ruby-2.
|
21
|
+
key: v1-gems-ruby-2.6.6-{{ checksum "salsify_rubocop.gemspec" }}-{{ checksum "Gemfile" }}
|
24
22
|
paths:
|
25
23
|
- "vendor/bundle"
|
24
|
+
- "gemfiles/vendor/bundle"
|
26
25
|
- run:
|
27
26
|
name: Run Rubocop
|
28
|
-
command: bundle exec rubocop
|
27
|
+
command: bundle exec rubocop --config .rubocop.yml
|
28
|
+
test:
|
29
|
+
parameters:
|
30
|
+
ruby_version:
|
31
|
+
type: string
|
32
|
+
docker:
|
33
|
+
- image: salsify/ruby_ci:<< parameters.ruby_version >>
|
34
|
+
environment:
|
35
|
+
CIRCLE_TEST_REPORTS: "test-results"
|
36
|
+
working_directory: ~/salsify_rubocop
|
37
|
+
steps:
|
38
|
+
- checkout
|
39
|
+
- restore_cache:
|
40
|
+
keys:
|
41
|
+
- v1-gems-ruby-<< parameters.ruby_version >>-{{ checksum "salsify_rubocop.gemspec" }}-{{ checksum "Gemfile" }}
|
42
|
+
- v1-gems-ruby-<< parameters.ruby_version >>-
|
43
|
+
- run:
|
44
|
+
name: Install Gems
|
45
|
+
command: |
|
46
|
+
if ! bundle check --path=vendor/bundle; then
|
47
|
+
bundle install --path=vendor/bundle --jobs=4 --retry=3
|
48
|
+
bundle clean
|
49
|
+
fi
|
50
|
+
- save_cache:
|
51
|
+
key: v1-gems-ruby-<< parameters.ruby_version >>-{{ checksum "salsify_rubocop.gemspec" }}-{{ checksum "Gemfile" }}
|
52
|
+
paths:
|
53
|
+
- "vendor/bundle"
|
54
|
+
- "gemfiles/vendor/bundle"
|
29
55
|
- run:
|
30
56
|
name: Run Tests
|
31
57
|
command: |
|
32
58
|
bundle exec rspec --format RspecJunitFormatter --out $CIRCLE_TEST_REPORTS/rspec/junit.xml --format progress spec
|
33
59
|
- store_test_results:
|
34
60
|
path: "test-results"
|
61
|
+
workflows:
|
62
|
+
build:
|
63
|
+
jobs:
|
64
|
+
- lint
|
65
|
+
- test:
|
66
|
+
matrix:
|
67
|
+
parameters:
|
68
|
+
ruby_version:
|
69
|
+
- "2.6.6"
|
70
|
+
- "2.7.2"
|
71
|
+
- "3.0.0"
|
data/.github/CODEOWNERS
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
* @jturkel @erikkessler1 @skarger
|
data/.rubocop.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,17 @@
|
|
1
1
|
# salsify_rubocop
|
2
2
|
|
3
|
+
## 1.2.0
|
4
|
+
- Disable Style/ExplicitBlockArgument for performance reasons, https://github.com/JuanitoFatas/fast-ruby/blob/master/code/proc-and-block/proc-call-vs-yield.rb.
|
5
|
+
|
6
|
+
## 1.1.0
|
7
|
+
- Re-enable version specifier checks for the `Bundler/GemComment` cop, for limiting version specifiers only.
|
8
|
+
- Upgrade to `rubocop` v1.13.0
|
9
|
+
- Drop support for Ruby 2.5 now that's in EOL
|
10
|
+
|
11
|
+
## 1.0.2
|
12
|
+
- Disable version specifier checks for the `Bundler/GemComment` cop until https://github.com/rubocop/rubocop/pull/9358
|
13
|
+
is merged.
|
14
|
+
|
3
15
|
## 1.0.1
|
4
16
|
- Configure file exclusions for `Rails/RakeEnvironment` and `Gemspec/RequiredRubyVersion`
|
5
17
|
|
@@ -1,3 +1,7 @@
|
|
1
|
+
require:
|
2
|
+
- rubocop-performance
|
3
|
+
- rubocop-rails
|
4
|
+
|
1
5
|
AllCops:
|
2
6
|
NewCops: disable
|
3
7
|
DisplayCopNames: true
|
@@ -13,7 +17,7 @@ AllCops:
|
|
13
17
|
Bundler/GemComment:
|
14
18
|
Enabled: true
|
15
19
|
OnlyFor:
|
16
|
-
- '
|
20
|
+
- 'restrictive_version_specificiers'
|
17
21
|
- 'source'
|
18
22
|
- 'git'
|
19
23
|
- 'github'
|
@@ -74,6 +78,11 @@ Style/EmptyLiteral:
|
|
74
78
|
Style/EmptyMethod:
|
75
79
|
Enabled: false
|
76
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
|
+
|
77
86
|
# The Exclude list is not additive. Projects that exclude file names will
|
78
87
|
# need to re-add Appraisals.
|
79
88
|
Naming/FileName:
|
@@ -57,9 +57,9 @@ module RuboCop
|
|
57
57
|
def check_quotes(doc_node)
|
58
58
|
return unless wrong_quotes?(doc_node)
|
59
59
|
|
60
|
-
add_offense(doc_node,
|
61
|
-
|
62
|
-
|
60
|
+
add_offense(doc_node, message: style == :single_quotes ? SINGLE_QUOTE_MSG : DOUBLE_QUOTE_MSG) do |corrector|
|
61
|
+
StringLiteralCorrector.correct(corrector, doc_node, style)
|
62
|
+
end
|
63
63
|
end
|
64
64
|
|
65
65
|
def wrong_quotes?(node)
|
@@ -11,7 +11,8 @@ module RuboCop
|
|
11
11
|
# Used together with Salsify/RspecDocString it allows one quote style to
|
12
12
|
# be used for doc strings (`describe "foobar"`) and another style to be
|
13
13
|
# used for all other strings in specs.
|
14
|
-
class RspecStringLiterals < Cop
|
14
|
+
class RspecStringLiterals < RuboCop::Cop::RSpec::Base
|
15
|
+
extend RuboCop::Cop::AutoCorrector
|
15
16
|
include ConfigurableEnforcedStyle
|
16
17
|
include StringLiteralsHelp
|
17
18
|
|
@@ -22,8 +23,8 @@ module RuboCop
|
|
22
23
|
DOUBLE_QUOTE_MSG = 'Prefer double-quoted strings unless you need ' \
|
23
24
|
'single quotes to avoid extra backslashes for escaping.'
|
24
25
|
|
25
|
-
def autocorrect(node)
|
26
|
-
StringLiteralCorrector.correct(node, style)
|
26
|
+
def autocorrect(corrector, node)
|
27
|
+
StringLiteralCorrector.correct(corrector, node, style)
|
27
28
|
end
|
28
29
|
|
29
30
|
private
|
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
|
@@ -30,14 +30,14 @@ Gem::Specification.new do |spec|
|
|
30
30
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
31
31
|
spec.require_paths = ['lib']
|
32
32
|
|
33
|
-
spec.required_ruby_version = '>= 2.
|
33
|
+
spec.required_ruby_version = '>= 2.6'
|
34
34
|
|
35
35
|
spec.add_development_dependency 'bundler', '~> 2.0'
|
36
|
-
spec.add_development_dependency 'rake', '~>
|
36
|
+
spec.add_development_dependency 'rake', '~> 13.0'
|
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.
|
40
|
+
spec.add_runtime_dependency 'rubocop', '~> 1.13.0'
|
41
41
|
spec.add_runtime_dependency 'rubocop-performance', '~> 1.5.0'
|
42
42
|
spec.add_runtime_dependency 'rubocop-rails', '~> 2.4.0'
|
43
43
|
spec.add_runtime_dependency 'rubocop-rspec', '~> 2.0.0'
|
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.0
|
4
|
+
version: 1.2.0
|
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-03-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '13.0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '13.0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rspec
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -72,14 +72,14 @@ dependencies:
|
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: 1.
|
75
|
+
version: 1.13.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.13.0
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: rubocop-performance
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -122,7 +122,7 @@ dependencies:
|
|
122
122
|
- - "~>"
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: 2.0.0
|
125
|
-
description: Shared
|
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
|
@@ -168,15 +170,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
168
170
|
requirements:
|
169
171
|
- - ">="
|
170
172
|
- !ruby/object:Gem::Version
|
171
|
-
version: '2.
|
173
|
+
version: '2.6'
|
172
174
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
173
175
|
requirements:
|
174
176
|
- - ">="
|
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.22
|
181
|
+
signing_key:
|
180
182
|
specification_version: 4
|
181
|
-
summary: Shared
|
183
|
+
summary: Shared RuboCop configuration
|
182
184
|
test_files: []
|