Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
f612a60b
Commit
f612a60b
authored
Jul 15, 2021
by
Tom Quirk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make vue_shared danger message more concise
parent
c521bc97
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
11 deletions
+8
-11
danger/vue_shared_documentation/Dangerfile
danger/vue_shared_documentation/Dangerfile
+8
-11
No files found.
danger/vue_shared_documentation/Dangerfile
View file @
f612a60b
# 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/'
)
&&
!
File
.
file?
(
file
.
dup
.
sub!
(
/\.vue$/
,
'.stories.js'
)
)
!
has_matching_story?
(
file
)
end
end
...
...
@@ -12,14 +16,7 @@ vue_shared_candidates = get_vue_shared_files(helper.all_changed_files)
return
if
vue_shared_candidates
.
empty?
warn
'This merge request changed undocumented Vue components in `vue_shared/`. Please consider [adding documention](https://docs.gitlab.com/ce/development/fe_guide/storybook).'
if
helper
.
ci?
markdown
(
<<~
MARKDOWN
)
## Undocumented Vue components
documentation_url
=
'https://docs.gitlab.com/ce/development/fe_guide/storybook'
file_list
=
"-
#{
vue_shared_candidates
.
map
{
|
path
|
"`
#{
path
}
`"
}
.join("
\
n
-
")}"
The following Vue components don't have associated stories. Please consider [creating them](https://docs.gitlab.com/ce/development/fe_guide/storybook):
*
#{
vue_shared_candidates
.
map
{
|
path
|
"`
#{
path
}
`"
}
.join("
\n
* ")}
MARKDOWN
end
warn
"This merge request changed undocumented Vue components in `vue_shared/`. Please consider [creating Stories](
#{
documentation_url
}
) for these components:
\n
#{
file_list
}
"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment