salsify_rubocop 0.78.1 → 0.85.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: 5fc1c179102ec565c2063453e0171fbcae3149139405a64a423d2e1c05109cc0
4
- data.tar.gz: deba1cf0289d79179453ec4a8f0bb14f0e8144c57cf77977596cdf197cc151f9
3
+ metadata.gz: d08274563973f107ae87494c994284ac9989f5653ab55bb8063e312de83e0b8b
4
+ data.tar.gz: 62498d79bfb7e1e94c86170210531f9d3ab1c37845077f144c42c8e5d83077b3
5
5
  SHA512:
6
- metadata.gz: 9f63eaf190f260cf7cd8e598af9da07b7eb122a63f16f09cf8b80c0bbd2b31e1e5e4cb83c02bf9e24393c4870053388f0024e32aace8b0383b847de08e1c6e8f
7
- data.tar.gz: db7e6935755f587fb0b8d2b24e9ad55d5388984ca246759281e19cc7453857885d5df0065a3401c6ee33e27c6ab0f662c16e1511fdab40b61e9950be22f209ec
6
+ metadata.gz: d091764bbd87bc8388f17ffb2b980d6aa79cff6cb20f06a50348f9e2ba27ee0dcb8f9b9fc53580fe820e098d3f2a353d431eafe579aef865059e12b92cdaa3c8
7
+ data.tar.gz: a587b9d3e3aa4d81d30a66bd0cb99c41ff97e50f32de4f8f32460fc8d57701e769b2237d781a8ea67d1e835aecaa4b6e1d3fd47b9e574e9303b0f48d384c993b
@@ -2,7 +2,7 @@ inherit_from:
2
2
  - conf/rubocop.yml
3
3
 
4
4
  AllCops:
5
- TargetRubyVersion: 2.3
5
+ TargetRubyVersion: 2.4
6
6
 
7
7
  Layout/LineLength:
8
8
  Exclude:
@@ -4,7 +4,6 @@ rvm:
4
4
  - 2.6.0
5
5
  - 2.5.3
6
6
  - 2.4.5
7
- - 2.3.8
8
7
  before_install:
9
8
  - gem update --system
10
9
  - gem install bundler
@@ -1,5 +1,11 @@
1
1
  # salsify_rubocop
2
2
 
3
+ ## 0.85.0
4
+ - Upgrate to `rubocop` v0.85.0
5
+ - Enable enforcement of Gem comments when specifying versions or sources
6
+ - Drop support for Ruby 2.3, as rubocop v0.81+ doesn't support it anymore
7
+ - Add `FrozenStringLiteralComment` and `LineLength` (max 120) rules.
8
+
3
9
  ## v0.78.1
4
10
  - Fix "`Style/SymbolArray` is concealed by line 190" warning
5
11
 
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
@@ -67,7 +76,7 @@ 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
@@ -152,10 +161,12 @@ Metrics/ClassLength:
152
161
  Metrics/CyclomaticComplexity:
153
162
  Enabled: false
154
163
 
155
- # Disabling line length enforcement since annotate generates
156
- # some pretty long lines
157
164
  Layout/LineLength:
158
- Enabled: false
165
+ Enabled: true
166
+ Max: 120
167
+ IgnoreCopDirectives: true
168
+ IgnoredPatterns:
169
+ - ^#
159
170
 
160
171
  Metrics/MethodLength:
161
172
  Enabled: false
@@ -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,9 +23,9 @@ 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
31
  [:include_examples, :it_behaves_like, :it_should_behave_like, :include_context]
@@ -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,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'salsify_rubocop/version'
2
4
  require 'rubocop-performance'
3
5
  require 'rubocop-rails'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module SalsifyRubocop
2
- VERSION = '0.78.1'.freeze
4
+ VERSION = '0.85.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,11 +30,13 @@ 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.78.0'
39
+ spec.add_runtime_dependency 'rubocop', '~> 0.85.0'
36
40
  spec.add_runtime_dependency 'rubocop-performance', '~> 1.5.0'
37
41
  spec.add_runtime_dependency 'rubocop-rails', '~> 2.4.0'
38
42
  spec.add_runtime_dependency 'rubocop-rspec', '~> 1.37.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: 0.78.1
4
+ version: 0.85.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: 2020-01-08 00:00:00.000000000 Z
11
+ date: 2020-06-09 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.78.0
61
+ version: 0.85.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.78.0
68
+ version: 0.85.0
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rubocop-performance
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -155,14 +155,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
155
155
  requirements:
156
156
  - - ">="
157
157
  - !ruby/object:Gem::Version
158
- version: '0'
158
+ version: '2.4'
159
159
  required_rubygems_version: !ruby/object:Gem::Requirement
160
160
  requirements:
161
161
  - - ">="
162
162
  - !ruby/object:Gem::Version
163
163
  version: '0'
164
164
  requirements: []
165
- rubygems_version: 3.0.6
165
+ rubygems_version: 3.0.8
166
166
  signing_key:
167
167
  specification_version: 4
168
168
  summary: Shared shared RuboCop configuration