File tree Expand file tree Collapse file tree 3 files changed +8
-0
lines changed Expand file tree Collapse file tree 3 files changed +8
-0
lines changed Original file line number Diff line number Diff line change 5
5
### Bug Fixes
6
6
7
7
* [ #2214 ] ( https://github.com/bbatsov/rubocop/pull/2214 ) : Fix ` File name too long error ` when ` STDIN ` option is provided. ([ @mrfoto ] [ ] )
8
+ * [ #2217 ] ( https://github.com/bbatsov/rubocop/issues/2217 ) : Allow block arguments in ` Style/SymbolProc ` . ([ @lumeet ] [ ] )
8
9
9
10
## 0.34.0 (05/09/2015)
10
11
Original file line number Diff line number Diff line change @@ -103,6 +103,7 @@ def ignored_method?(name)
103
103
def can_shorten? ( block_args , block_body )
104
104
# something { |x, y| ... }
105
105
return false unless block_args . children . size == 1
106
+ return false if block_args . children . first . blockarg_type?
106
107
return false unless block_body && block_body . type == :send
107
108
108
109
receiver , _method_name , args = *block_body
Original file line number Diff line number Diff line change 76
76
expect ( cop . offenses ) . to be_empty
77
77
end
78
78
79
+ it 'accepts block with a block argument ' do
80
+ inspect_source ( cop , 'something { |&x| x.call }' )
81
+
82
+ expect ( cop . offenses ) . to be_empty
83
+ end
84
+
79
85
context 'when the method has arguments' do
80
86
let ( :source ) { 'method(one, 2) { |x| x.test }' }
81
87
You can’t perform that action at this time.
0 commit comments