salsify_rubocop 0.58.0.rc1 → 0.59.2.1.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/conf/rubocop_rails.yml +3 -0
- data/config/default.yml +4 -0
- data/lib/rubocop/cop/salsify/rails_unscoped.rb +28 -0
- data/lib/rubocop/cop/salsify/rspec_doc_string.rb +1 -0
- data/lib/rubocop/cop/salsify/style_dig.rb +1 -0
- data/lib/salsify_rubocop.rb +1 -0
- data/lib/salsify_rubocop/version.rb +1 -1
- data/salsify_rubocop.gemspec +1 -1
- metadata +6 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3bad74d395450e607785a9cce155e9637feda5a809b073c979acc8dbc811bb30
|
4
|
+
data.tar.gz: 48029cf2df4a10cdfa5aa82b3a0cec831349820196359f78ac76bd970ede329b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 64f196f2442d97efb44df337d1e35ea58860a17909a793d658c65053c8006097a873ace55c7b7bff4d15fe69f0bc358d232ca9568ab465c062a7907af65e9e6b
|
7
|
+
data.tar.gz: 64475b91d7e555e2665240d288a9ca043a4ce41177786b64646dbd185c5e17b3a7ed44237064c76e9699784d5b141c93aeef7c157a8250f5c5bf7105dbe8df6e
|
data/CHANGELOG.md
CHANGED
data/conf/rubocop_rails.yml
CHANGED
data/config/default.yml
CHANGED
@@ -10,6 +10,10 @@ Salsify/RailsApplicationRecord:
|
|
10
10
|
Description: 'Models must subclass ApplicationRecord.'
|
11
11
|
Enabled: false
|
12
12
|
|
13
|
+
Salsify/RailsUnscoped:
|
14
|
+
Description: 'Activerecord scopes cannot use unscoped.'
|
15
|
+
Enabled: false
|
16
|
+
|
13
17
|
Salsify/RspecDocString:
|
14
18
|
Description: 'Check that RSpec doc strings use the correct quoting.'
|
15
19
|
Enabled: true
|
@@ -0,0 +1,28 @@
|
|
1
|
+
module RuboCop
|
2
|
+
module Cop
|
3
|
+
module Salsify
|
4
|
+
# Check that Activerecord scopes do not use `unscoped`
|
5
|
+
#
|
6
|
+
# @example
|
7
|
+
#
|
8
|
+
# # good
|
9
|
+
# User.strip_default_scope
|
10
|
+
#
|
11
|
+
# # bad
|
12
|
+
# User.unscoped
|
13
|
+
class RailsUnscoped < Cop
|
14
|
+
MSG = 'Explicitly remove scopes instead of using `unscoped`.'.freeze
|
15
|
+
|
16
|
+
def_node_matcher :unscoped?, <<-PATTERN
|
17
|
+
(send _ :unscoped)
|
18
|
+
PATTERN
|
19
|
+
|
20
|
+
def on_send(node)
|
21
|
+
return unless unscoped?(node)
|
22
|
+
|
23
|
+
add_offense(node, location: :expression, message: MSG)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
data/lib/salsify_rubocop.rb
CHANGED
@@ -15,6 +15,7 @@ RuboCop::ConfigLoader.instance_variable_set(:@default_configuration, config)
|
|
15
15
|
# cops
|
16
16
|
require 'rubocop/cop/salsify/rails_application_mailer'
|
17
17
|
require 'rubocop/cop/salsify/rails_application_serializer'
|
18
|
+
require 'rubocop/cop/salsify/rails_unscoped'
|
18
19
|
require 'rubocop/cop/salsify/rspec_doc_string'
|
19
20
|
require 'rubocop/cop/salsify/rspec_dot_not_self_dot'
|
20
21
|
require 'rubocop/cop/salsify/rspec_string_literals'
|
data/salsify_rubocop.gemspec
CHANGED
@@ -32,6 +32,6 @@ Gem::Specification.new do |spec|
|
|
32
32
|
spec.add_development_dependency 'rake', '~> 10.0'
|
33
33
|
spec.add_development_dependency 'rspec', '~> 3.0'
|
34
34
|
|
35
|
-
spec.add_runtime_dependency 'rubocop', '~> 0.
|
35
|
+
spec.add_runtime_dependency 'rubocop', '~> 0.59.2'
|
36
36
|
spec.add_runtime_dependency 'rubocop-rspec', '~> 1.29.0'
|
37
37
|
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: 0.
|
4
|
+
version: 0.59.2.1.rc1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Salsify, Inc
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-10-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -58,14 +58,14 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: 0.
|
61
|
+
version: 0.59.2
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: 0.
|
68
|
+
version: 0.59.2
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: rubocop-rspec
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -105,6 +105,7 @@ files:
|
|
105
105
|
- config/default.yml
|
106
106
|
- lib/rubocop/cop/salsify/rails_application_mailer.rb
|
107
107
|
- lib/rubocop/cop/salsify/rails_application_serializer.rb
|
108
|
+
- lib/rubocop/cop/salsify/rails_unscoped.rb
|
108
109
|
- lib/rubocop/cop/salsify/rspec_doc_string.rb
|
109
110
|
- lib/rubocop/cop/salsify/rspec_dot_not_self_dot.rb
|
110
111
|
- lib/rubocop/cop/salsify/rspec_string_literals.rb
|
@@ -134,7 +135,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
134
135
|
version: 1.3.1
|
135
136
|
requirements: []
|
136
137
|
rubyforge_project:
|
137
|
-
rubygems_version: 2.7.
|
138
|
+
rubygems_version: 2.7.6
|
138
139
|
signing_key:
|
139
140
|
specification_version: 4
|
140
141
|
summary: Shared shared RuboCop configuration
|