rubocop-ordered_methods 0.7 → 0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +4 -0
- data/CHANGELOG.md +5 -1
- data/lib/rubocop/cop/layout/ordered_methods.rb +8 -6
- data/rubocop-ordered_methods.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fc5f933eab16f22d4ce9e90bac7b7da25af7af45f7fd1204974ea26d98287476
|
4
|
+
data.tar.gz: c3e5a535a8667acf2c88e8c127219b8b8e330d10e6575df5748391ec1c7758ba
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c83ba399a7357517935466f59e4be28b75fbb399a571041b54ba4be1c387797b1867be69fcac2abe8e60e89572b34d35d9a327a171880cec2d9807ee258766ca
|
7
|
+
data.tar.gz: dc2897b646af1eb6e2b84dbe2e693be8a0a48de8645caf9551557c6dfe36809a34c92c4166428f9f0b17bd541c3a5c8bf60d349ea3db3286c09ebb4897467e7e
|
data/.rubocop.yml
CHANGED
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
|
-
-
|
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
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
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
|
|
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.
|
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
|
+
date: 2021-03-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rubocop
|