Skip to content

Commit

Permalink
Fix structure.sql end newline check
Browse files Browse the repository at this point in the history
Fix structure.sql end newline check
  • Loading branch information
rkukutis authored Nov 18, 2024
2 parents d58b028 + 7b71a41 commit b3817ff
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
pronto-rails_migrations (0.15.0)
pronto-rails_migrations (0.16.0)
faraday (>= 1.10.3)
multipart-post (>= 2.1.1)
pronto (>= 0.11.1)
Expand Down
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
2 changes: 1 addition & 1 deletion lib/pronto/rails_migrations/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Pronto
RAILS_MIGRATIONS_VERSION = '0.15.0'
RAILS_MIGRATIONS_VERSION = '0.16.0'
end

0 comments on commit b3817ff

Please sign in to comment.