2017-09-27 04:52:03 -04:00
|
|
|
#!/usr/bin/env ruby
|
|
|
|
|
|
|
|
require 'yaml'
|
|
|
|
|
2017-09-29 10:24:16 -04:00
|
|
|
invalid_changelogs = Dir['changelogs/**/*'].reject do |changelog|
|
|
|
|
next true if changelog =~ /(archive\.md|unreleased(-ee)?)$/
|
|
|
|
next false unless changelog.end_with?('.yml')
|
|
|
|
|
2017-09-27 04:52:03 -04:00
|
|
|
begin
|
|
|
|
YAML.load_file(changelog)
|
2017-12-22 20:53:13 -05:00
|
|
|
rescue => exception
|
|
|
|
puts exception
|
2017-09-27 04:52:03 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
if invalid_changelogs.any?
|
2017-12-22 20:53:13 -05:00
|
|
|
puts
|
2017-09-29 10:24:16 -04:00
|
|
|
puts "Invalid changelogs found!\n"
|
2017-09-27 04:52:03 -04:00
|
|
|
puts invalid_changelogs.sort
|
|
|
|
exit 1
|
|
|
|
else
|
|
|
|
puts "All changelogs are valid YAML.\n"
|
|
|
|
exit 0
|
|
|
|
end
|