ruby-next-core 0.10.2 → 0.10.3

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: fb44065be7545114c59e01e16394f6c4840c7efa173349b5907e6d07fa8b7694
4
- data.tar.gz: bd8cb4e19884dfeb6059dc28d845bfb11061092ed888a2021ccf9575cdc72325
3
+ metadata.gz: 06e8a3264f44b75ea1c9c15b86857a99b20e537e34c1345a3cdb585ecc9ff815
4
+ data.tar.gz: 4a9fac897b70b243b4f465e3cb4b4d7f7e6838f9d119cb44befbac809ae57f66
5
5
  SHA512:
6
- metadata.gz: 521691a6abd8006d34ee48059d55b0aa43cbbe9c1d431a9d99b63f17bfec73e4e2e850dfac38e18f629131ccf5eae9899294c0741bd81bddbecd8d494aef2115
7
- data.tar.gz: f12c6e59416eaec1f2e900691bff08235dda1bfdfb98d6cfe186f0ba90b2d0d2d8e1c2cc169f7abafbc0c785e65ceb6aba60cd3255dd2c4575c1c9352da7e94e
6
+ metadata.gz: 383cfb7155da80a785f52996d470ed20e47f5e936973eddab95487fa1be952d829ccefc7605fd2e90967ab0bece5e8da678b6ba11be62534377762de9a247cc7
7
+ data.tar.gz: 05e872e67ec2a44076ab20cc7ca3592e010e5bb0ec0fb8249e1b6cfb46119049ad376ba7fb189c21a531b02ef12b98f9fc70f8c4467df9451e8c05f8cda80dc0
@@ -2,6 +2,12 @@
2
2
 
3
3
  ## master
4
4
 
5
+ ## 0.10.3 (2020-09-28)
6
+
7
+ - Update RuboCop integration to handle the latest Parser changes. ([@palkan][])
8
+
9
+ Parser 2.7.1.5 unified endless and normal methods and rightward and leftward assignments, thus, making some cops report false negatives.
10
+
5
11
  ## 0.10.2 (2020-09-09)
6
12
 
7
13
  - Fix regression when `nextify` produces incorrect files for 2.7. ([@palkan][])
@@ -148,6 +148,9 @@ module RubyNext
148
148
 
149
149
  # Then, generate the source code for the next version
150
150
  transpile path, contents, version: version
151
+ rescue SyntaxError, StandardError => e
152
+ warn "Failed to transpile #{path}: #{e.class} — #{e.message}"
153
+ exit 1
151
154
  end
152
155
 
153
156
  def save(contents, path, version)
@@ -148,6 +148,9 @@ module RubyNext
148
148
 
149
149
  # Then, generate the source code for the next version
150
150
  transpile path, contents, version: version
151
+ rescue SyntaxError, StandardError => e
152
+ warn "Failed to transpile #{path}: #{e.class} — #{e.message}"
153
+ exit 1
151
154
  end
152
155
 
153
156
  def save(contents, path, version)
@@ -117,5 +117,81 @@ module RuboCop
117
117
  end
118
118
  end
119
119
  end
120
+
121
+ module Layout
122
+ require "rubocop/cop/layout/assignment_indentation"
123
+ AssignmentIndentation.prepend(Module.new do
124
+ POTENTIAL_RIGHT_TYPES = %i[ivasgn lvasgn cvasgn gvasgn casgn masgn].freeze
125
+
126
+ def check_assignment(node, *)
127
+ return if rightward?(node)
128
+ super
129
+ end
130
+
131
+ private
132
+
133
+ def rightward?(node)
134
+ return unless POTENTIAL_RIGHT_TYPES.include?(node.type)
135
+
136
+ return unless node.loc.operator
137
+
138
+ assignee_loc =
139
+ if node.type == :masgn
140
+ node.children[0].loc.expression
141
+ else
142
+ node.loc.name
143
+ end
144
+
145
+ return false unless assignee_loc
146
+
147
+ assignee_loc.begin_pos > node.loc.operator.end_pos
148
+ end
149
+ end)
150
+
151
+ require "rubocop/cop/layout/empty_line_between_defs"
152
+ EmptyLineBetweenDefs.prepend(Module.new do
153
+ def def_end(node)
154
+ return super unless node.loc.end.nil?
155
+
156
+ node.loc.expression.line
157
+ end
158
+ end)
159
+ end
160
+
161
+ module Style
162
+ require "rubocop/cop/style/single_line_methods"
163
+ SingleLineMethods.prepend(Module.new do
164
+ def on_def(node)
165
+ return if node.loc.end.nil?
166
+ super
167
+ end
168
+
169
+ def on_defs(node)
170
+ return if node.loc.end.nil?
171
+ super
172
+ end
173
+ end)
174
+
175
+ require "rubocop/cop/style/def_with_parentheses"
176
+ DefWithParentheses.prepend(Module.new do
177
+ def on_def(node)
178
+ return if node.loc.end.nil?
179
+ super
180
+ end
181
+
182
+ def on_defs(node)
183
+ return if node.loc.end.nil?
184
+ super
185
+ end
186
+ end)
187
+
188
+ require "rubocop/cop/style/trailing_method_end_statement"
189
+ TrailingMethodEndStatement.prepend(Module.new do
190
+ def on_def(node)
191
+ return if node.loc.end.nil?
192
+ super
193
+ end
194
+ end)
195
+ end
120
196
  end
121
197
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RubyNext
4
- VERSION = "0.10.2"
4
+ VERSION = "0.10.3"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-next-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.2
4
+ version: 0.10.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vladimir Dementyev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-09-09 00:00:00.000000000 Z
11
+ date: 2020-09-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ruby-next-parser
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 3.0.0.0
19
+ version: 3.0.0.1
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: 3.0.0.0
26
+ version: 3.0.0.1
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: unparser
29
29
  requirement: !ruby/object:Gem::Requirement