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
0
Merge Requests
0
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
Léo-Paul Géneau
gitlab-ce
Commits
8a3d565c
Commit
8a3d565c
authored
Aug 19, 2018
by
gfyoung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't use arguments keyword in gettext script
Causing SAST build to fail unnecessarily. Follow-up to !19378.
parent
d195ee8f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
5 deletions
+10
-5
changelogs/unreleased/arguments-keyword-sast.yml
changelogs/unreleased/arguments-keyword-sast.yml
+5
-0
scripts/frontend/extract_gettext_all.js
scripts/frontend/extract_gettext_all.js
+5
-5
No files found.
changelogs/unreleased/arguments-keyword-sast.yml
0 → 100644
View file @
8a3d565c
---
title
:
Don't use arguments keyword in gettext script
merge_request
:
21296
author
:
gfyoung
type
:
fixed
scripts/frontend/extract_gettext_all.js
View file @
8a3d565c
...
...
@@ -7,7 +7,7 @@ const {
}
=
require
(
'
gettext-extractor-vue
'
);
const
ensureSingleLine
=
require
(
'
../../app/assets/javascripts/locale/ensure_single_line.js
'
);
const
arg
ument
s
=
argumentsParser
const
args
=
argumentsParser
.
option
(
'
-f, --file <file>
'
,
'
Extract message from one single file
'
)
.
option
(
'
-a, --all
'
,
'
Extract message from all js/vue files
'
)
.
parse
(
process
.
argv
);
...
...
@@ -61,12 +61,12 @@ function printJson() {
console
.
log
(
JSON
.
stringify
(
messages
));
}
if
(
arg
ument
s
.
file
)
{
vueParser
.
parseFile
(
arg
ument
s
.
file
).
then
(()
=>
printJson
());
}
else
if
(
arg
ument
s
.
all
)
{
if
(
args
.
file
)
{
vueParser
.
parseFile
(
args
.
file
).
then
(()
=>
printJson
());
}
else
if
(
args
.
all
)
{
vueParser
.
parseFilesGlob
(
'
{ee/app,app}/assets/javascripts/**/*.{js,vue}
'
).
then
(()
=>
printJson
());
}
else
{
console
.
warn
(
'
ERROR: Please use the script correctly:
'
);
arg
ument
s
.
outputHelp
();
args
.
outputHelp
();
process
.
exit
(
1
);
}
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