gitlab-org--gitlab-foss/scripts/lint-changelog-yaml
Elan Ruusamäe 83b1c44a77 add changelogs/README.md
this is to quickstart contributors who don't work daily on the codebase
2019-02-18 04:57:57 +00:00

24 lines
484 B
Ruby
Executable file

#!/usr/bin/env ruby
require 'yaml'
invalid_changelogs = Dir['changelogs/**/*'].reject do |changelog|
next true if changelog =~ /((README|archive)\.md|unreleased(-ee)?)$/
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