We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 930584a + 84d09f5 commit 3fbbca6Copy full SHA for 3fbbca6
lib/rubocop/cop/rails/output.rb
@@ -23,7 +23,6 @@ class Output < Base
23
24
MSG = "Do not write to stdout. Use Rails's logger if you want to log."
25
RESTRICT_ON_SEND = %i[ap p pp pretty_print print puts binwrite syswrite write write_nonblock].freeze
26
- ALLOWED_TYPES = %i[send csend block numblock].freeze
27
28
def_node_matcher :output?, <<~PATTERN
29
(send nil? {:ap :p :pp :pretty_print :print :puts} ...)
@@ -40,7 +39,7 @@ class Output < Base
40
39
PATTERN
41
42
def on_send(node)
43
- return if ALLOWED_TYPES.include?(node.parent&.type)
+ return if node.parent&.call_type? || node.block_node
44
return if !output?(node) && !io_output?(node)
45
46
range = offense_range(node)
0 commit comments