diff options
Diffstat (limited to 'rubocop/cop/line_break_around_conditional_block.rb')
-rw-r--r-- | rubocop/cop/line_break_around_conditional_block.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/rubocop/cop/line_break_around_conditional_block.rb b/rubocop/cop/line_break_around_conditional_block.rb index 011f2bcf8bf..59fe6e5d98c 100644 --- a/rubocop/cop/line_break_around_conditional_block.rb +++ b/rubocop/cop/line_break_around_conditional_block.rb @@ -48,6 +48,8 @@ module RuboCop MSG = 'Add a line break around conditional blocks' def on_if(node) + # This cop causes errors in haml files, so let's skip those + return if in_haml?(node) return if node.single_line? return unless node.if? || node.unless? @@ -116,6 +118,10 @@ module RuboCop def end_line?(line) line =~ /^\s*(end|})/ end + + def in_haml?(node) + node.location.expression.source_buffer.name.end_with?('.haml.rb') + end end end end |