2018-03-17 18:26:18 +05:30
|
|
|
#!/usr/bin/env ruby
|
|
|
|
|
|
|
|
require 'yaml'
|
|
|
|
|
|
|
|
invalid_changelogs = Dir['changelogs/**/*'].reject do |changelog|
|
2019-05-18 00:54:41 +05:30
|
|
|
next true if changelog =~ /((README|archive)\.md|unreleased(-ee)?)$/
|
2018-03-17 18:26:18 +05:30
|
|
|
next false unless changelog.end_with?('.yml')
|
|
|
|
|
|
|
|
begin
|
|
|
|
YAML.load_file(changelog)
|
|
|
|
rescue => exception
|
|
|
|
puts exception
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
if invalid_changelogs.any?
|
|
|
|
puts
|
|
|
|
puts "Invalid changelogs found!\n"
|
|
|
|
puts invalid_changelogs.sort
|
|
|
|
exit 1
|
|
|
|
else
|
|
|
|
puts "All changelogs are valid YAML.\n"
|
|
|
|
exit 0
|
|
|
|
end
|