run chktex when request has check:true

This commit is contained in:
Brian Gough 2016-07-26 16:22:38 +01:00
parent 3135ff2842
commit d6d6e18b89
4 changed files with 13 additions and 4 deletions

View file

@ -27,6 +27,10 @@ module.exports = CommandRunner =
err = new Error("terminated")
err.terminated = true
return callback(err)
else if code
err = new Error("exit")
err.code = code
return callback(err)
else
callback()

View file

@ -17,6 +17,8 @@ module.exports = CompileController =
CompileManager.doCompile request, (error, outputFiles = []) ->
if error?.terminated
status = "terminated"
else if error?.code is 1
status = "exited"
else if error?
logger.error err: error, project_id: request.project_id, "error running compile"
if error.timedout

View file

@ -44,9 +44,9 @@ module.exports = CompileManager =
# set up environment variables for chktex
env = {}
if request.chktex?
env['CHKTEX_OPTIONS'] = '-nall -e9 -e10 -e15 -e16 -e27'
if request.chktex is 'error'
if request.check?
env['CHKTEX_OPTIONS'] = '-nall -e9 -e10 -w15 -w16 -w27'
if request.check is 'error'
env['CHKTEX_EXIT_ON_ERROR'] = 1
injectDraftModeIfRequired (error) ->
@ -67,7 +67,7 @@ module.exports = CompileManager =
environment: env
}, (error, output, stats, timings) ->
# compile was killed by user
if error?.terminated
if error?.terminated or error?.code is 1
OutputFileFinder.findOutputFiles request.resources, compileDir, (err, outputFiles) ->
return callback(err) if err?
callback(error, outputFiles) # return output files so user can check logs

View file

@ -28,6 +28,9 @@ module.exports = RequestParser =
compile.options.draft,
default: false,
type: "boolean"
response.check = @_parseAttribute "check",
compile.options.check,
type: "string"
if response.timeout > RequestParser.MAX_TIMEOUT
response.timeout = RequestParser.MAX_TIMEOUT