rubocop-ordered_methods 0.7 → 0.8

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c161660f9f4755d2e7fe826d18a1cd704d9f62071736ea5dc4f8e540ed78cd14
4
- data.tar.gz: 6f464af4d215c37dbeb402e0d81a730dcd96f6a77ae40892d60a382a847002c8
3
+ metadata.gz: fc5f933eab16f22d4ce9e90bac7b7da25af7af45f7fd1204974ea26d98287476
4
+ data.tar.gz: c3e5a535a8667acf2c88e8c127219b8b8e330d10e6575df5748391ec1c7758ba
5
5
  SHA512:
6
- metadata.gz: af7672dbef3e4fc3d5b84a814ec08f6e372d0dadc8d1fced783c7b74a6a4abc43c9d33e53b97b2c9b4e75bba73106b9a5238daaa9709333c6a477496eb18dfa3
7
- data.tar.gz: 73c5f91133bd0a8c1e8acd669d1c8df7e969670250a49df9698e0ea547c20ba92e0282032007fdd1406948a700c16b996c832f63269ef2014736a7165cc177d6
6
+ metadata.gz: c83ba399a7357517935466f59e4be28b75fbb399a571041b54ba4be1c387797b1867be69fcac2abe8e60e89572b34d35d9a327a171880cec2d9807ee258766ca
7
+ data.tar.gz: dc2897b646af1eb6e2b84dbe2e693be8a0a48de8645caf9551557c6dfe36809a34c92c4166428f9f0b17bd541c3a5c8bf60d349ea3db3286c09ebb4897467e7e
data/.rubocop.yml CHANGED
@@ -11,6 +11,10 @@ Metrics/BlockLength:
11
11
  Exclude:
12
12
  - spec/**/*
13
13
 
14
+ Metrics/MethodLength:
15
+ Exclude:
16
+ - spec/**/*
17
+
14
18
  Naming/FileName:
15
19
  Exclude:
16
20
  - lib/rubocop-ordered_methods.rb
data/CHANGELOG.md CHANGED
@@ -6,7 +6,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
- - nothing
9
+ ## [0.8] - 2021-02-01
10
+
11
+ ### Fixed
12
+
13
+ - Fix NoMethodError and the "\[Correctable\]" label ([#6](https://github.com/shanecav84/rubocop-ordered_methods/pull/6)). Thanks @jaredbeck.
10
14
 
11
15
  ## [0.7] - 2021-01-11
12
16
 
@@ -30,6 +30,7 @@ module RuboCop
30
30
  # def c; end
31
31
  # def d; end
32
32
  class OrderedMethods < Cop
33
+ # TODO: Extending Cop is deprecated. Should extend Cop::Base.
33
34
  include IgnoredMethods
34
35
  include RangeHelp
35
36
 
@@ -72,12 +73,13 @@ module RuboCop
72
73
  @cache ||= begin
73
74
  @siblings = node.children
74
75
 
75
- # Init the corrector with the cache to avoid traversing
76
- # the AST in the corrector
77
- if @options[:auto_correct]
78
- comments = processed_source.ast_with_comments
79
- @corrector = OrderedMethodsCorrector.new(comments, @siblings)
80
- end
76
+ # Init the corrector with the cache to avoid traversing the AST in
77
+ # the corrector. We always init the @corrector, even if
78
+ # @options[:auto_correct] is nil, because `add_offense` always
79
+ # attempts correction. This correction attempt is how RuboCop knows
80
+ # if the offense can be labeled "[Correctable]".
81
+ comments = processed_source.ast_with_comments
82
+ @corrector = OrderedMethodsCorrector.new(comments, @siblings)
81
83
  end
82
84
  end
83
85
 
@@ -5,7 +5,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
5
 
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = 'rubocop-ordered_methods'
8
- spec.version = '0.7'
8
+ spec.version = '0.8'
9
9
  spec.authors = ['Shane Cavanaugh']
10
10
  spec.email = ['shane@shanecav.net']
11
11
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubocop-ordered_methods
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.7'
4
+ version: '0.8'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shane Cavanaugh
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-01-11 00:00:00.000000000 Z
11
+ date: 2021-03-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubocop