Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 36aa07c

Browse files
committed
Report error if missing configurations.
refs skygragon#13 Signed-off-by: Eric Wang <skygragon@gmail.com>
1 parent d276e3a commit 36aa07c

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

plugins/cpp.lint.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ var DEFAULT_FLAGS = [
1717
];
1818

1919
plugin.testProblem = function(problem, cb) {
20+
// TODO: unify error handling
21+
if (!plugin.config.bin)
22+
return log.error('cpplint.py not configured correctly! (plugins:cpp.lint:bin)');
23+
2024
var flags = DEFAULT_FLAGS.concat(plugin.config.flags || []);
2125

2226
var cmd = [

plugins/github.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@ var plugin = new Plugin(100, 'github', '2018.03.24',
1717
var ctx = {};
1818

1919
plugin.submitProblem = function(problem, cb) {
20+
// TODO: unify error handling
21+
if (!plugin.config.repo)
22+
return log.error('GitHub repo not configured correctly! (plugins:github:repo)');
23+
if (!plugin.config.token)
24+
return log.error('GitHub token not configured correctly! (plugins:github:token)');
25+
2026
var parts = url.parse(plugin.config.repo).pathname.split('/');
2127
var filename = path.basename(problem.file);
2228
parts.push(filename);

0 commit comments

Comments
 (0)