salsify_rubocop 0.62.0 → 0.91.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5f6a3aa2033749bbf8ce148a3769a564c5b7b59475ae866510cc40fae3483f5a
4
- data.tar.gz: 34cb8125ec5729f682ee03bebd44347de5259abc4315ec3d0fe4cf074977fdf7
3
+ metadata.gz: b7075a3184d398f5ed45dc726da7a289323eb1839dd7ecb78fe614b242b6798f
4
+ data.tar.gz: 70c2dfb69a48fa75e58a218e8cea848fc477dfbfd22fc50adefbac86589132f3
5
5
  SHA512:
6
- metadata.gz: d502990fb8bd1888091e117a76b80b78127588f5eb966ef455db4395d527311f239cc8023742b1cf872077cbefc25d217414a92e7f3455f02075bb3922231b5c
7
- data.tar.gz: 12381ee2f3905191905369dbcab63fad288fd5b8aaf4fce43f2e75652f6cdeeca7728fb1e336710df15d0be6f36631b075a0644f7de4f360bab218d9be6fc809
6
+ metadata.gz: ddcd5e8975a9d35a5b5efe66e5e90d1ca4645aebca2d6b70e8084c6dda8fac05b36c27f557aebdc45fabe6458215a6bab4c06dc4acd8935a02017dc22a2131cb
7
+ data.tar.gz: 33e382909c34f89e5ba8f14ea1a03bb443df82fad6d2e80905d1faf7ef8950692a85e768dfa2a8bcc8bc7ef7ceac21e500c00675939ff481a5ed31dc8751f158
@@ -2,8 +2,8 @@ inherit_from:
2
2
  - conf/rubocop.yml
3
3
 
4
4
  AllCops:
5
- TargetRubyVersion: 2.3
5
+ TargetRubyVersion: 2.4
6
6
 
7
- Metrics/LineLength:
7
+ Layout/LineLength:
8
8
  Exclude:
9
9
  - '*.gemspec'
@@ -1,9 +1,9 @@
1
1
  language: ruby
2
2
  rvm:
3
+ - 2.7.0
3
4
  - 2.6.0
4
5
  - 2.5.3
5
6
  - 2.4.5
6
- - 2.3.8
7
7
  before_install:
8
8
  - gem update --system
9
9
  - gem install bundler
@@ -1,5 +1,25 @@
1
1
  # salsify_rubocop
2
2
 
3
+ ## 0.91.0
4
+
5
+ - Upgrade to `rubocop` v0.91.0
6
+
7
+ ## 0.85.0
8
+ - Upgrade to `rubocop` v0.85.0
9
+ - Enable enforcement of Gem comments when specifying versions or sources
10
+ - Drop support for Ruby 2.3, as rubocop v0.81+ doesn't support it anymore
11
+ - Add `FrozenStringLiteralComment` and `LineLength` (max 120) rules.
12
+
13
+ ## v0.78.1
14
+ - Fix "`Style/SymbolArray` is concealed by line 190" warning
15
+
16
+ ## v0.78.0
17
+ - Upgrade to `rubocop` v0.78.0
18
+ - Upgrade to `rubocop_rspec` v1.37.0
19
+ - Add `rubocop-rails `v2.4.0`
20
+ - Add `rubocop-performance `v1.5.0`
21
+ - Update names/namespaces of rules that changed between 0.62 and 0.78
22
+
3
23
  ## v0.62.0
4
24
  - Upgrade to `rubocop` v0.62.0
5
25
  - Upgrade to `rubocop_rspec` v1.31.0
data/Gemfile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  source 'https://rubygems.org'
2
4
 
3
5
  # Specify your gem's dependencies in salsify_rubocop.gemspec
data/Rakefile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'bundler/gem_tasks'
2
4
  require 'rspec/core/rake_task'
3
5
 
@@ -9,6 +9,15 @@ AllCops:
9
9
  - 'tmp/**/*'
10
10
  - 'vendor/**/*'
11
11
 
12
+ Bundler/GemComment:
13
+ Enabled: true
14
+ OnlyFor:
15
+ - 'version_specifiers'
16
+ - 'source'
17
+ - 'git'
18
+ - 'github'
19
+ - 'gist'
20
+
12
21
  # This cop has poor handling for the common case of a lambda arg in a DSL
13
22
  Lint/AmbiguousBlockAssociation:
14
23
  Enabled: false
@@ -22,7 +31,7 @@ Performance/RedundantMerge:
22
31
  Style/Alias:
23
32
  EnforcedStyle: prefer_alias_method
24
33
 
25
- Layout/AlignHash:
34
+ Layout/HashAlignment:
26
35
  Enabled: false
27
36
 
28
37
  Style/Documentation:
@@ -67,13 +76,13 @@ Naming/FileName:
67
76
  - 'Appraisals'
68
77
 
69
78
  Style/FrozenStringLiteralComment:
70
- Enabled: false
79
+ Enabled: true
71
80
 
72
81
  Style/GuardClause:
73
82
  Enabled: false
74
83
 
75
84
  # does not make sense to enable this without AlignHash
76
- Layout/IndentHash:
85
+ Layout/FirstHashElementIndentation:
77
86
  Enabled: false
78
87
 
79
88
  Style/Lambda:
@@ -134,10 +143,6 @@ Style/StringLiterals:
134
143
  Exclude:
135
144
  - 'spec/**/*'
136
145
 
137
- # We don't require %i() for an array of symbols.
138
- Style/SymbolArray:
139
- Enabled: false
140
-
141
146
  Naming/VariableNumber:
142
147
  Enabled: false
143
148
 
@@ -156,10 +161,12 @@ Metrics/ClassLength:
156
161
  Metrics/CyclomaticComplexity:
157
162
  Enabled: false
158
163
 
159
- # Disabling line length enforcement since annotate generates
160
- # some pretty long lines
161
- Metrics/LineLength:
162
- Enabled: false
164
+ Layout/LineLength:
165
+ Enabled: true
166
+ Max: 120
167
+ IgnoreCopDirectives: true
168
+ IgnoredPatterns:
169
+ - ^#
163
170
 
164
171
  Metrics/MethodLength:
165
172
  Enabled: false
@@ -183,3 +190,9 @@ Style/NumericLiterals:
183
190
 
184
191
  Style/StructInheritance:
185
192
  Enabled: false
193
+
194
+ Style/WordArray:
195
+ EnforcedStyle: brackets
196
+
197
+ Style/SymbolArray:
198
+ EnforcedStyle: brackets
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module RuboCop
2
4
  module Cop
3
5
  module Salsify
@@ -19,9 +21,9 @@ module RuboCop
19
21
 
20
22
  minimum_target_rails_version 5.0
21
23
 
22
- MSG = 'Mailers should subclass `ApplicationMailer`.'.freeze
23
- SUPERCLASS = 'ApplicationMailer'.freeze
24
- BASE_PATTERN = '(const (const nil? :ActionMailer) :Base)'.freeze
24
+ MSG = 'Mailers should subclass `ApplicationMailer`.'
25
+ SUPERCLASS = 'ApplicationMailer'
26
+ BASE_PATTERN = '(const (const nil? :ActionMailer) :Base)'
25
27
 
26
28
  include RuboCop::Cop::EnforceSuperclass
27
29
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module RuboCop
2
4
  module Cop
3
5
  module Salsify
@@ -19,9 +21,9 @@ module RuboCop
19
21
 
20
22
  minimum_target_rails_version 5.0
21
23
 
22
- MSG = 'Serializers should subclass `ApplicationSerializer`.'.freeze
23
- SUPERCLASS = 'ApplicationSerializer'.freeze
24
- BASE_PATTERN = '(const (const nil? :ActiveModel) :Serializer)'.freeze
24
+ MSG = 'Serializers should subclass `ApplicationSerializer`.'
25
+ SUPERCLASS = 'ApplicationSerializer'
26
+ BASE_PATTERN = '(const (const nil? :ActiveModel) :Serializer)'
25
27
 
26
28
  include RuboCop::Cop::EnforceSuperclass
27
29
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module RuboCop
2
4
  module Cop
3
5
  module Salsify
@@ -11,7 +13,7 @@ module RuboCop
11
13
  # # bad
12
14
  # User.unscoped
13
15
  class RailsUnscoped < Cop
14
- MSG = 'Explicitly remove scopes instead of using `unscoped`.'.freeze
16
+ MSG = 'Explicitly remove scopes instead of using `unscoped`.'
15
17
 
16
18
  def_node_matcher :unscoped?, <<-PATTERN
17
19
  (send _ :unscoped)
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module RuboCop
2
4
  module Cop
3
5
  module Salsify
@@ -21,12 +23,12 @@ module RuboCop
21
23
  include ConfigurableEnforcedStyle
22
24
 
23
25
  SINGLE_QUOTE_MSG =
24
- 'Example Group/Example doc strings must be single-quoted.'.freeze
26
+ 'Example Group/Example doc strings must be single-quoted.'
25
27
  DOUBLE_QUOTE_MSG =
26
- 'Example Group/Example doc strings must be double-quoted.'.freeze
28
+ 'Example Group/Example doc strings must be double-quoted.'
27
29
 
28
30
  SHARED_EXAMPLES = RuboCop::RSpec::Language::SelectorSet.new(
29
- %i(include_examples it_behaves_like it_should_behave_like include_context)
31
+ [:include_examples, :it_behaves_like, :it_should_behave_like, :include_context]
30
32
  ).freeze
31
33
 
32
34
  DOCUMENTED_METHODS = (RuboCop::RSpec::Language::ExampleGroups::ALL +
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module RuboCop
2
4
  module Cop
3
5
  module Salsify
@@ -18,7 +20,7 @@ module RuboCop
18
20
  class RspecDotNotSelfDot < Cop
19
21
 
20
22
  SELF_DOT_REGEXP = /["']self\./.freeze
21
- MSG = 'Use ".<class method>" instead of "self.<class method>" for example group description.'.freeze
23
+ MSG = 'Use ".<class method>" instead of "self.<class method>" for example group description.'
22
24
 
23
25
  def_node_matcher :example_group_match, <<-PATTERN
24
26
  (send _ #{RuboCop::RSpec::Language::ExampleGroups::ALL.node_pattern_union} $_ ...)
@@ -26,7 +28,7 @@ module RuboCop
26
28
 
27
29
  def on_send(node)
28
30
  example_group_match(node) do |doc|
29
- add_offense(doc) if SELF_DOT_REGEXP =~ doc.source
31
+ add_offense(doc) if SELF_DOT_REGEXP.match?(doc.source)
30
32
  end
31
33
  end
32
34
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module RuboCop
2
4
  module Cop
3
5
  module Salsify
@@ -16,9 +18,9 @@ module RuboCop
16
18
  DOCUMENTED_METHODS = RuboCop::Cop::Salsify::RspecDocString::DOCUMENTED_METHODS
17
19
 
18
20
  SINGLE_QUOTE_MSG = 'Prefer single-quoted strings unless you need ' \
19
- 'interpolation or special symbols.'.freeze
21
+ 'interpolation or special symbols.'
20
22
  DOUBLE_QUOTE_MSG = 'Prefer double-quoted strings unless you need ' \
21
- 'single quotes to avoid extra backslashes for escaping.'.freeze
23
+ 'single quotes to avoid extra backslashes for escaping.'
22
24
 
23
25
  def autocorrect(node)
24
26
  StringLiteralCorrector.correct(node, style)
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # This may be added in the near future to rubocop, see https://github.com/bbatsov/rubocop/issues/5332
2
4
 
3
5
  module RuboCop
@@ -21,7 +23,7 @@ module RuboCop
21
23
 
22
24
  minimum_target_ruby_version 2.3
23
25
 
24
- MSG = 'Use `dig` for nested access.'.freeze
26
+ MSG = 'Use `dig` for nested access.'
25
27
 
26
28
  def_node_matcher :nested_access_match, <<-PATTERN
27
29
  (send (send (send _receiver !:[]) :[] !{irange erange}) :[] !{irange erange})
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Monkey-patch SelectorSet to allow enumeration of selectors.
2
4
 
3
5
  module RuboCop
@@ -1,4 +1,8 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'salsify_rubocop/version'
4
+ require 'rubocop-performance'
5
+ require 'rubocop-rails'
2
6
  require 'rubocop-rspec'
3
7
 
4
8
  # Because RuboCop doesn't yet support plugins, we have to monkey patch in a
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module SalsifyRubocop
2
- VERSION = '0.62.0'.freeze
4
+ VERSION = '0.91.0'
3
5
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  lib = File.expand_path('lib', __dir__)
2
4
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
5
  require 'salsify_rubocop/version'
@@ -28,10 +30,14 @@ Gem::Specification.new do |spec|
28
30
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
29
31
  spec.require_paths = ['lib']
30
32
 
33
+ spec.required_ruby_version = '>= 2.4'
34
+
31
35
  spec.add_development_dependency 'bundler', '~> 2.0'
32
36
  spec.add_development_dependency 'rake', '~> 10.0'
33
37
  spec.add_development_dependency 'rspec', '~> 3.0'
34
38
 
35
- spec.add_runtime_dependency 'rubocop', '~> 0.62.0'
36
- spec.add_runtime_dependency 'rubocop-rspec', '~> 1.31.0'
39
+ spec.add_runtime_dependency 'rubocop', '~> 0.91.0'
40
+ spec.add_runtime_dependency 'rubocop-performance', '~> 1.5.0'
41
+ spec.add_runtime_dependency 'rubocop-rails', '~> 2.4.0'
42
+ spec.add_runtime_dependency 'rubocop-rspec', '~> 1.37.0'
37
43
  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.62.0
4
+ version: 0.91.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: 2019-01-04 00:00:00.000000000 Z
11
+ date: 2020-09-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -58,28 +58,56 @@ dependencies:
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: 0.62.0
61
+ version: 0.91.0
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.62.0
68
+ version: 0.91.0
69
+ - !ruby/object:Gem::Dependency
70
+ name: rubocop-performance
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: 1.5.0
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: 1.5.0
83
+ - !ruby/object:Gem::Dependency
84
+ name: rubocop-rails
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: 2.4.0
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: 2.4.0
69
97
  - !ruby/object:Gem::Dependency
70
98
  name: rubocop-rspec
71
99
  requirement: !ruby/object:Gem::Requirement
72
100
  requirements:
73
101
  - - "~>"
74
102
  - !ruby/object:Gem::Version
75
- version: 1.31.0
103
+ version: 1.37.0
76
104
  type: :runtime
77
105
  prerelease: false
78
106
  version_requirements: !ruby/object:Gem::Requirement
79
107
  requirements:
80
108
  - - "~>"
81
109
  - !ruby/object:Gem::Version
82
- version: 1.31.0
110
+ version: 1.37.0
83
111
  description: Shared shared RuboCop configuration
84
112
  email:
85
113
  - engineering@salsify.com
@@ -119,7 +147,7 @@ licenses:
119
147
  - MIT
120
148
  metadata:
121
149
  allowed_push_host: https://rubygems.org
122
- post_install_message:
150
+ post_install_message:
123
151
  rdoc_options: []
124
152
  require_paths:
125
153
  - lib
@@ -127,15 +155,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
127
155
  requirements:
128
156
  - - ">="
129
157
  - !ruby/object:Gem::Version
130
- version: '0'
158
+ version: '2.4'
131
159
  required_rubygems_version: !ruby/object:Gem::Requirement
132
160
  requirements:
133
161
  - - ">="
134
162
  - !ruby/object:Gem::Version
135
163
  version: '0'
136
164
  requirements: []
137
- rubygems_version: 3.0.2
138
- signing_key:
165
+ rubygems_version: 3.1.2
166
+ signing_key:
139
167
  specification_version: 4
140
168
  summary: Shared shared RuboCop configuration
141
169
  test_files: []