rubocop-ordered_methods 0.10 → 0.11
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 +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/rubocop/cop/layout/ordered_methods.rb +6 -4
- 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: 8136e162c37c297ad3e2eee09364841551f447b6854ada050b165d0286fda95d
|
4
|
+
data.tar.gz: 595fd69b9114f9122920cf5c8f15a1cb6a43b22f4c31ab9665a11bf2411ff91d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ab8b3c4ae74ac44dc4ee43af04cdb3854f8df847113e499dc2d429843c4276a34084316edc3c0aca41fd4174fdd6c3a508a642ec8dbc19302e6c015bc65ee16e
|
7
|
+
data.tar.gz: 96347af9d20819c73c485e5a985702097ab5507ec86774ab144bf8f9fa54363461dc0a53f993429a6321e0e8fea6d0b4bcf244c9159b17a03fcf7f503b41ec75
|
data/CHANGELOG.md
CHANGED
@@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
6
6
|
|
7
7
|
## [Unreleased]
|
8
8
|
|
9
|
+
## [0.11] - 2023-12-19
|
10
|
+
|
11
|
+
### Fixed
|
12
|
+
|
13
|
+
- Fix handling require at the top of the file, nil nodes, and nodes that aren't of type AST::node ([#15](https://github.com/shanecav84/rubocop-ordered_methods/pull/15)). Thanks @rohitpaulk and @libmartinito
|
14
|
+
|
9
15
|
## [0.10] - 2021-03-10
|
10
16
|
|
11
17
|
### Removed
|
@@ -54,14 +54,15 @@ module RuboCop
|
|
54
54
|
end
|
55
55
|
|
56
56
|
def on_begin(node)
|
57
|
-
|
57
|
+
start_node = node.children.find(&:class_type?)&.children&.last || node
|
58
|
+
siblings, _corrector = cache(start_node)
|
59
|
+
|
58
60
|
consecutive_methods(siblings) do |previous, current|
|
59
61
|
unless ordered?(previous, current)
|
60
62
|
@previous_node = previous
|
61
63
|
add_offense(
|
62
64
|
current,
|
63
|
-
message:
|
64
|
-
"#{cop_config['EnforcedStyle']} order."
|
65
|
+
message: "Methods should be sorted in #{cop_config['EnforcedStyle']} order."
|
65
66
|
)
|
66
67
|
end
|
67
68
|
end
|
@@ -118,7 +119,8 @@ module RuboCop
|
|
118
119
|
# rubocop:enable Style/ExplicitBlockArgument
|
119
120
|
|
120
121
|
def filter_relevant_nodes(nodes)
|
121
|
-
nodes.select do |node|
|
122
|
+
nodes.compact.select do |node|
|
123
|
+
next unless node.is_a?(Parser::AST::Node)
|
122
124
|
relevant_node?(node) || (node.send_type? && qualifier_macro?(node))
|
123
125
|
end
|
124
126
|
end
|
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.11'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shane Cavanaugh
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-12-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rubocop
|