From b2f143597ca22b9585cc758453ae920d9b9d0fe3 Mon Sep 17 00:00:00 2001 From: Peter Dave Hello Date: Tue, 23 Jul 2019 12:23:51 +0000 Subject: Extend yamllint test to changelogs cc !30979 --- .gitlab/ci/docs.gitlab-ci.yml | 1 - .gitlab/ci/yaml.gitlab-ci.yml | 2 +- changelogs/README.md | 2 +- scripts/lint-changelog-yaml | 24 ------------------------ 4 files changed, 2 insertions(+), 27 deletions(-) delete mode 100755 scripts/lint-changelog-yaml diff --git a/.gitlab/ci/docs.gitlab-ci.yml b/.gitlab/ci/docs.gitlab-ci.yml index 5bc109f2b7f..de1110f39fa 100644 --- a/.gitlab/ci/docs.gitlab-ci.yml +++ b/.gitlab/ci/docs.gitlab-ci.yml @@ -62,7 +62,6 @@ docs lint: before_script: [] script: - scripts/lint-doc.sh - - scripts/lint-changelog-yaml - mv doc/ /tmp/gitlab-docs/content/$DOCS_GITLAB_REPO_SUFFIX - cd /tmp/gitlab-docs # Lint Markdown diff --git a/.gitlab/ci/yaml.gitlab-ci.yml b/.gitlab/ci/yaml.gitlab-ci.yml index 401318d2df2..b7aa418d8f7 100644 --- a/.gitlab/ci/yaml.gitlab-ci.yml +++ b/.gitlab/ci/yaml.gitlab-ci.yml @@ -6,4 +6,4 @@ lint-ci-gitlab: dependencies: [] image: sdesbure/yamllint:latest script: - - yamllint .gitlab-ci.yml .gitlab/ci lib/gitlab/ci/templates + - yamllint .gitlab-ci.yml .gitlab/ci lib/gitlab/ci/templates changelogs diff --git a/changelogs/README.md b/changelogs/README.md index c4113ccb863..d408a74157a 100644 --- a/changelogs/README.md +++ b/changelogs/README.md @@ -3,7 +3,7 @@ To generate and validate your changelog entries: 1. Run `bin/changelog` to generate. -1. Run `scripts/lint-changelog-yaml` to validate. +1. Run `yamllint changelogs` to validate. See [development/changelog] documentation for detailed usage. diff --git a/scripts/lint-changelog-yaml b/scripts/lint-changelog-yaml deleted file mode 100755 index 06d502c4676..00000000000 --- a/scripts/lint-changelog-yaml +++ /dev/null @@ -1,24 +0,0 @@ -#!/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 -- cgit v1.2.3