BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
2f0d2ab5
Unverified
Commit
2f0d2ab5
authored
Feb 12, 2018
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Run lint:all tasks in forks
Signed-off-by:
Rémy Coutable
<
remy@rymai.me
>
parent
e4990b66
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
13 deletions
+34
-13
lint.rake
lib/tasks/lint.rake
+32
-11
static-analysis
scripts/static-analysis
+2
-2
No files found.
lib/tasks/lint.rake
View file @
2f0d2ab5
...
...
@@ -20,7 +20,6 @@ unless Rails.env.production?
desc
"GitLab | lint | Run several lint checks"
task
:all
do
status
=
0
original_stdout
=
$stdout
%w[
config_lint
...
...
@@ -30,19 +29,41 @@ unless Rails.env.production?
gettext:lint
lint:static_verification
]
.
each
do
|
task
|
begin
$stdout
=
StringIO
.
new
Rake
::
Task
[
task
].
invoke
rescue
RuntimeError
,
SystemExit
=>
ex
raise
ex
if
ex
.
is_a?
(
RuntimeError
)
&&
task
!=
'haml_lint'
original_stdout
<<
$stdout
.
string
status
=
1
ensure
$stdout
=
original_stdout
pid
=
Process
.
fork
do
rd
,
wr
=
IO
.
pipe
stdout
=
$stdout
.
dup
stderr
=
$stderr
.
dup
$stdout
.
reopen
(
wr
)
$stderr
.
reopen
(
wr
)
begin
begin
Rake
::
Task
[
task
].
invoke
rescue
RuntimeError
# The haml_lint tasks raise a RuntimeError
exit
(
1
)
end
rescue
SystemExit
=>
ex
msg
=
"*** Rake task
#{
task
}
failed with the following error(s):"
raise
ex
ensure
$stdout
.
reopen
(
stdout
)
$stderr
.
reopen
(
stderr
)
wr
.
close
if
msg
warn
"
\n
#{
msg
}
\n\n
"
IO
.
copy_stream
(
rd
,
$stderr
)
else
IO
.
copy_stream
(
rd
,
$stdout
)
end
end
end
Process
.
waitpid
(
pid
)
status
+=
$?
.
exitstatus
end
exit
status
exit
(
status
)
end
end
end
scripts/static-analysis
View file @
2f0d2ab5
...
...
@@ -7,7 +7,7 @@ require_relative '../lib/gitlab/popen/runner'
def
emit_warnings
(
static_analysis
)
static_analysis
.
warned_results
.
each
do
|
result
|
puts
puts
"****
#{
result
.
cmd
.
join
(
' '
)
}
had the following warning
s
:"
puts
"****
#{
result
.
cmd
.
join
(
' '
)
}
had the following warning
(s)
:"
puts
puts
result
.
stderr
puts
...
...
@@ -17,7 +17,7 @@ end
def
emit_errors
(
static_analysis
)
static_analysis
.
failed_results
.
each
do
|
result
|
puts
puts
"****
#{
result
.
cmd
.
join
(
' '
)
}
failed with the following error:"
puts
"****
#{
result
.
cmd
.
join
(
' '
)
}
failed with the following error
(s)
:"
puts
puts
result
.
stdout
puts
result
.
stderr
...
...
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