From 15ceccd30c6dafb4e32aa801ce55207c83814a46 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micha=C5=82=20Zaj=C4=85c?= <mzajac@gitlab.com>
Date: Fri, 22 Oct 2021 15:17:09 +0200
Subject: [PATCH] Run GraphQL docs rake task on changes

This commit makes pre-push hook run gitlab:graphql:check_docs rake task
to make sure that our GraphQL docs are up-to-date.

Changelog: changed
---
 lefthook.yml | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/lefthook.yml b/lefthook.yml
index 55027f6bf59fc..c5c51b53fb321 100644
--- a/lefthook.yml
+++ b/lefthook.yml
@@ -33,6 +33,11 @@ pre-push:
       files: git diff --name-only --diff-filter=d $(git merge-base origin/master HEAD)..HEAD
       glob: '*.rb'
       run: REVEAL_RUBOCOP_TODO=0 bundle exec rubocop --parallel --force-exclusion {files}
+    graphql_docs:
+      tags: documentation
+      files: git diff --name-only --diff-filter=d $(git merge-base origin/master HEAD)..HEAD
+      glob: '{app/graphql/**/*.rb,ee/app/graphql/**/*.rb}'
+      run: bundle exec rake gitlab:graphql:check_docs
     vale:  # Requires Vale: https://docs.gitlab.com/ee/development/documentation/#install-linters
       tags: documentation style
       files: git diff --name-only --diff-filter=d $(git merge-base origin/master HEAD)..HEAD
-- 
GitLab