salsify_rubocop 1.0.2 → 1.1.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 +46 -9
- data/.rubocop.yml +1 -1
- data/CHANGELOG.md +5 -0
- data/conf/rubocop_without_rspec.yml +5 -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 +3 -3
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ec6518eab32e91fe9d55cddeeebe45b6c894646f416489b35d124c68ca9d45b6
|
4
|
+
data.tar.gz: 29aae33cb64d4c8505bcc2d5bdc99bc316d82bdb6ecb0963f06993d3f856ef38
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aa3992654fbaa71f4cfbdab64203590153483e9a5a57718f72f64022ba65d7cea95bcb71665cfa229dd4f6283d883a20551e27139ce3fabaaaf1d19599ba69e3
|
7
|
+
data.tar.gz: 95aa6ec7078f655bae79f0b6a53bd0037888d2fcf20465dbad819e4ed9c9749a840dadc2b54af78857da67ffb0a390ca8b8d36f670abfdac285e227bfa45de24
|
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/.rubocop.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,10 @@
|
|
1
1
|
# salsify_rubocop
|
2
2
|
|
3
|
+
## 1.1.0
|
4
|
+
- Re-enable version specifier checks for the `Bundler/GemComment` cop, for limiting version specifiers only.
|
5
|
+
- Upgrade to `rubocop` v1.13.0
|
6
|
+
- Drop support for Ruby 2.5 now that's in EOL
|
7
|
+
|
3
8
|
## 1.0.2
|
4
9
|
- Disable version specifier checks for the `Bundler/GemComment` cop until https://github.com/rubocop/rubocop/pull/9358
|
5
10
|
is merged.
|
@@ -1,3 +1,7 @@
|
|
1
|
+
require:
|
2
|
+
- rubocop-performance
|
3
|
+
- rubocop-rails
|
4
|
+
|
1
5
|
AllCops:
|
2
6
|
NewCops: disable
|
3
7
|
DisplayCopNames: true
|
@@ -10,10 +14,10 @@ AllCops:
|
|
10
14
|
- 'tmp/**/*'
|
11
15
|
- 'vendor/**/*'
|
12
16
|
|
13
|
-
# Don't check version_specifiers until https://github.com/rubocop/rubocop/pull/9358 merges
|
14
17
|
Bundler/GemComment:
|
15
18
|
Enabled: true
|
16
19
|
OnlyFor:
|
20
|
+
- 'restrictive_version_specificiers'
|
17
21
|
- 'source'
|
18
22
|
- 'git'
|
19
23
|
- 'github'
|
@@ -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
@@ -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.1.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: 2021-
|
11
|
+
date: 2021-08-19 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
|
@@ -168,7 +168,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
168
168
|
requirements:
|
169
169
|
- - ">="
|
170
170
|
- !ruby/object:Gem::Version
|
171
|
-
version: '2.
|
171
|
+
version: '2.6'
|
172
172
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
173
173
|
requirements:
|
174
174
|
- - ">="
|