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
fff6b89f
Commit
fff6b89f
authored
Jun 19, 2018
by
Bob Van Landuyt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More verbose errors in static-analysis
This makes the output in static analysis a bit more verbose.
parent
c815abbd
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
13 deletions
+30
-13
lib/tasks/gettext.rake
lib/tasks/gettext.rake
+15
-6
lib/tasks/lint.rake
lib/tasks/lint.rake
+15
-7
No files found.
lib/tasks/gettext.rake
View file @
fff6b89f
...
@@ -53,25 +53,34 @@ namespace :gettext do
...
@@ -53,25 +53,34 @@ namespace :gettext do
task
:updated_check
do
task
:updated_check
do
# Removing all pre-translated files speeds up `gettext:find` as the
# Removing all pre-translated files speeds up `gettext:find` as the
# files don't need to be merged.
# files don't need to be merged.
`rm locale/*/gitlab.po`
# Having `LC_MESSAGES/gitlab.mo files present also confuses the output.
FileUtils
.
rm
Dir
[
'locale/**/gitlab.*'
]
# Make sure we start out with a clean pot.file
`git checkout -- locale/gitlab.pot`
# `gettext:find` writes touches to temp files to `stderr` which would cause
# `gettext:find` writes touches to temp files to `stderr` which would cause
# `static-analysis` to report failures. We can ignore these
# `static-analysis` to report failures. We can ignore these.
silence_stream
(
STDERR
)
{
Rake
::
Task
[
'gettext:find'
].
invoke
}
silence_stream
(
$stderr
)
do
Rake
::
Task
[
'gettext:find'
].
invoke
end
changed_files
=
`git diff --name-only`
.
lines
.
map
(
&
:strip
)
pot_diff
=
`git diff -- locale/gitlab.pot`
.
strip
# reset the locale folder for potential next tasks
# reset the locale folder for potential next tasks
`git checkout -- locale`
`git checkout -- locale`
if
changed_files
.
include?
(
'locale/gitlab.pot'
)
if
pot_diff
.
present?
raise
<<~
MSG
raise
<<~
MSG
Newly translated strings found, please add them to `gitlab.pot` by running:
Newly translated strings found, please add them to `gitlab.pot` by running:
bundle exec rake gettext:find; git checkout -- locale/*/gitlab.po;
rm locale/**/gitlab.*; bin/rake gettext:find; git checkout -- locale/*/gitlab.po
Then commit and push the resulting changes to `locale/gitlab.pot`.
Then commit and push the resulting changes to `locale/gitlab.pot`.
The diff was:
#{
pot_diff
}
MSG
MSG
end
end
end
end
...
...
lib/tasks/lint.rake
View file @
fff6b89f
...
@@ -17,13 +17,22 @@ unless Rails.env.production?
...
@@ -17,13 +17,22 @@ unless Rails.env.production?
Rake
::
Task
[
'eslint'
].
invoke
Rake
::
Task
[
'eslint'
].
invoke
end
end
desc
"GitLab | lint | Lint HAML files"
task
:haml
do
begin
Rake
::
Task
[
'haml_lint'
].
invoke
rescue
RuntimeError
# The haml_lint tasks raise a RuntimeError
exit
(
1
)
end
end
desc
"GitLab | lint | Run several lint checks"
desc
"GitLab | lint | Run several lint checks"
task
:all
do
task
:all
do
status
=
0
status
=
0
%w[
%w[
config_lint
config_lint
haml_lint
lint:haml
scss_lint
scss_lint
flay
flay
gettext:lint
gettext:lint
...
@@ -38,14 +47,13 @@ unless Rails.env.production?
...
@@ -38,14 +47,13 @@ unless Rails.env.production?
$stdout
.
reopen
(
wr_out
)
$stdout
.
reopen
(
wr_out
)
$stderr
.
reopen
(
wr_err
)
$stderr
.
reopen
(
wr_err
)
begin
begin
begin
Rake
::
Task
[
task
].
invoke
Rake
::
Task
[
task
].
invoke
rescue
RuntimeError
# The haml_lint tasks raise a RuntimeError
exit
(
1
)
end
rescue
SystemExit
=>
ex
rescue
SystemExit
=>
ex
msg
=
"*** Rake task
#{
task
}
failed with the following error(s):"
msg
=
"*** Rake task
#{
task
}
exited:"
raise
ex
rescue
=>
ex
msg
=
"*** Rake task
#{
task
}
raised
#{
ex
.
class
}
:"
raise
ex
raise
ex
ensure
ensure
$stdout
.
reopen
(
stdout
)
$stdout
.
reopen
(
stdout
)
...
...
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