diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-07-20 12:55:51 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-07-20 12:55:51 +0300 |
commit | e8d2c2579383897a1dd7f9debd359abe8ae8373d (patch) | |
tree | c42be41678c2586d49a75cabce89322082698334 /danger/vue_shared_documentation/Dangerfile | |
parent | fc845b37ec3a90aaa719975f607740c22ba6a113 (diff) |
Add latest changes from gitlab-org/gitlab@14-1-stable-eev14.1.0-rc42
Diffstat (limited to 'danger/vue_shared_documentation/Dangerfile')
-rw-r--r-- | danger/vue_shared_documentation/Dangerfile | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/danger/vue_shared_documentation/Dangerfile b/danger/vue_shared_documentation/Dangerfile new file mode 100644 index 00000000000..103ef3591af --- /dev/null +++ b/danger/vue_shared_documentation/Dangerfile @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +def has_matching_story?(file) + File.file?(file.dup.sub!(/\.vue$/, '.stories.js')) +end + +def get_vue_shared_files(files) + files.select do |file| + file.end_with?('.vue') && + file.include?('vue_shared/') && + !has_matching_story?(file) + end +end + +vue_shared_candidates = get_vue_shared_files(helper.all_changed_files) + +return if vue_shared_candidates.empty? + +documentation_url = 'https://docs.gitlab.com/ce/development/fe_guide/storybook' +file_list = "- #{vue_shared_candidates.map { |path| "`#{path}`" }.join("\n- ")}" + +warn "This merge request changed undocumented Vue components in `vue_shared/`. Please consider [creating Stories](#{documentation_url}) for these components:\n#{file_list}" |