Skip to content

Commit

Permalink
require 2 empty line at structure.sql end
Browse files Browse the repository at this point in the history
  • Loading branch information
rkukutis committed Nov 12, 2024
1 parent d58b028 commit d0db693
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/pronto/rails_migrations.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def bad_structure_sql_messages
*all_but_tail, tail = inserts
bad_semicolons = all_but_tail.any? { |line| line.end_with?(';') } || !tail.end_with?(';')

bad_ending = structure_sql[-2, 2] !~ /[^\n]\n/
bad_ending = structure_sql[-4, 4] !~ /[^\n]\n\n\n/

messages = []

Expand All @@ -59,7 +59,7 @@ def bad_structure_sql_messages
'last insert must end with semicolon (`;`).'
)
end
messages << message(patch, '`db/structure.sql` must end without extra empty lines.') if bad_ending
messages << message(patch, '`db/structure.sql` must end with 2 empty lines.') if bad_ending

messages
end
Expand Down

0 comments on commit d0db693

Please sign in to comment.