diff options
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/lint-changelog-yaml | 22 | ||||
-rwxr-xr-x | scripts/static-analysis | 3 |
2 files changed, 24 insertions, 1 deletions
diff --git a/scripts/lint-changelog-yaml b/scripts/lint-changelog-yaml new file mode 100755 index 00000000000..cce5f1c7667 --- /dev/null +++ b/scripts/lint-changelog-yaml @@ -0,0 +1,22 @@ +#!/usr/bin/env ruby + +require 'yaml' + +invalid_changelogs = Dir['changelogs/**/*'].reject do |changelog| + next true if changelog =~ /(archive\.md|unreleased(-ee)?)$/ + next false unless changelog.end_with?('.yml') + + begin + YAML.load_file(changelog) + rescue + end +end + +if invalid_changelogs.any? + puts "Invalid changelogs found!\n" + puts invalid_changelogs.sort + exit 1 +else + puts "All changelogs are valid YAML.\n" + exit 0 +end diff --git a/scripts/static-analysis b/scripts/static-analysis index 295b6f132c1..aeefb2bc96f 100755 --- a/scripts/static-analysis +++ b/scripts/static-analysis @@ -13,7 +13,8 @@ tasks = [ %w[yarn run eslint], %w[bundle exec rubocop --require rubocop-rspec], %w[scripts/lint-conflicts.sh], - %w[bundle exec rake gettext:lint] + %w[bundle exec rake gettext:lint], + %w[scripts/lint-changelog-yaml] ] failed_tasks = tasks.reduce({}) do |failures, task| |