Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Toolchain
sgc
Commits
b9f50418
Commit
b9f50418
authored
Aug 31, 2018
by
Philipp Nowinski
Browse files
[FEATURE] add notification for linting error
parent
baad40b7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
3 deletions
+8
-3
core/logger.js
core/logger.js
+1
-0
core/tasks/css.js
core/tasks/css.js
+4
-2
core/tasks/js.js
core/tasks/js.js
+3
-1
No files found.
core/logger.js
View file @
b9f50418
...
@@ -84,6 +84,7 @@ module.exports = class Logger {
...
@@ -84,6 +84,7 @@ module.exports = class Logger {
summary
:
_title
,
summary
:
_title
,
body
:
_message
,
body
:
_message
,
icon
:
path
.
join
(
__dirname
,
'
SGC.svg
'
),
icon
:
path
.
join
(
__dirname
,
'
SGC.svg
'
),
sound
:
'
message-new-instant
'
}).
push
();
}).
push
();
}
else
{
}
else
{
notifier
.
notify
(
notifier
.
notify
(
...
...
core/tasks/css.js
View file @
b9f50418
...
@@ -194,7 +194,8 @@ module.exports = class Css extends Task {
...
@@ -194,7 +194,8 @@ module.exports = class Css extends Task {
configBasedir
:
`
${
process
.
cwd
()}
/sgc-core/`
configBasedir
:
`
${
process
.
cwd
()}
/sgc-core/`
}),
}),
reporter
({
reporter
({
clearReportedMessages
:
true
clearReportedMessages
:
true
,
throwError
:
true
})
})
]).
process
(
file
,
{
]).
process
(
file
,
{
from
:
_input
,
from
:
_input
,
...
@@ -202,7 +203,8 @@ module.exports = class Css extends Task {
...
@@ -202,7 +203,8 @@ module.exports = class Css extends Task {
}).
then
(()
=>
{
}).
then
(()
=>
{
resolve
();
resolve
();
}).
catch
(
error
=>
{
}).
catch
(
error
=>
{
this
.
_logger
.
error
(
error
.
stack
)
this
.
_logger
.
displayNotification
(
'
SGC css:qa task
'
,
'
You have some linting-errors in your CSS. Please fix them!
'
);
resolve
();
});
});
});
});
}
}
...
...
core/tasks/js.js
View file @
b9f50418
...
@@ -169,7 +169,9 @@ module.exports = class Js extends Task {
...
@@ -169,7 +169,9 @@ module.exports = class Js extends Task {
});
});
let
formatter
=
cli
.
getFormatter
();
let
formatter
=
cli
.
getFormatter
();
let
report
=
cli
.
executeOnFiles
(
_files
);
let
report
=
cli
.
executeOnFiles
(
_files
);
if
(
report
.
errorCount
>
0
)
{
this
.
_logger
.
displayNotification
(
'
SGC js:qa task
'
,
'
You have some linting-errors in your JavaScript. Please fix them!
'
);
}
console
.
log
(
formatter
(
report
.
results
));
console
.
log
(
formatter
(
report
.
results
));
resolve
();
resolve
();
});
});
...
...
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