* fix #8219; nim check/dump shouldn't run single nimscript project [backport: 1.6]
This commit is contained in:
parent
8cdd8867c0
commit
82319ef00d
3 changed files with 9 additions and 5 deletions
|
|
@ -301,7 +301,7 @@ proc loadConfigs*(cfg: RelativeFile; cache: IdentCache; conf: ConfigRef; idgen:
|
||||||
if conf.cmd == cmdNimscript:
|
if conf.cmd == cmdNimscript:
|
||||||
showHintConf()
|
showHintConf()
|
||||||
conf.configFiles.setLen 0
|
conf.configFiles.setLen 0
|
||||||
if conf.cmd != cmdIdeTools:
|
if conf.cmd notin {cmdIdeTools, cmdCheck, cmdDump}:
|
||||||
if conf.cmd == cmdNimscript:
|
if conf.cmd == cmdNimscript:
|
||||||
runNimScriptIfExists(conf.projectFull, isMain = true)
|
runNimScriptIfExists(conf.projectFull, isMain = true)
|
||||||
else:
|
else:
|
||||||
|
|
@ -311,5 +311,6 @@ proc loadConfigs*(cfg: RelativeFile; cache: IdentCache; conf: ConfigRef; idgen:
|
||||||
runNimScriptIfExists(scriptFile, isMain = true)
|
runNimScriptIfExists(scriptFile, isMain = true)
|
||||||
else:
|
else:
|
||||||
# 'nimsuggest foo.nims' means to just auto-complete the NimScript file
|
# 'nimsuggest foo.nims' means to just auto-complete the NimScript file
|
||||||
|
# `nim check foo.nims' means to check the syntax of the NimScript file
|
||||||
discard
|
discard
|
||||||
showHintConf()
|
showHintConf()
|
||||||
|
|
|
||||||
|
|
@ -249,6 +249,11 @@ tests/newconfig/bar/mfoo.nims""".splitLines
|
||||||
expected.add &"Hint: used config file '{b}' [Conf]\n"
|
expected.add &"Hint: used config file '{b}' [Conf]\n"
|
||||||
doAssert outp.endsWith expected, outp & "\n" & expected
|
doAssert outp.endsWith expected, outp & "\n" & expected
|
||||||
|
|
||||||
|
block: # bug #8219
|
||||||
|
let file = "tests/newconfig/mconfigcheck.nims"
|
||||||
|
let cmd = fmt"{nim} check --hints:off {file}"
|
||||||
|
check execCmdEx(cmd) == ("", 0)
|
||||||
|
|
||||||
block: # mfoo2.customext
|
block: # mfoo2.customext
|
||||||
let filename = testsDir / "newconfig/foo2/mfoo2.customext"
|
let filename = testsDir / "newconfig/foo2/mfoo2.customext"
|
||||||
let cmd = fmt"{nim} e --hint:conf {filename}"
|
let cmd = fmt"{nim} e --hint:conf {filename}"
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,9 @@
|
||||||
discard """
|
|
||||||
cmd: "nim check $file"
|
|
||||||
"""
|
|
||||||
|
|
||||||
mode = ScriptMode.Verbose
|
mode = ScriptMode.Verbose
|
||||||
proc build() =
|
proc build() =
|
||||||
echo "building nim... "
|
echo "building nim... "
|
||||||
exec "sleep 10"
|
exec "sleep 10"
|
||||||
|
exec "nonexistant command"
|
||||||
echo getCurrentDir()
|
echo getCurrentDir()
|
||||||
|
|
||||||
echo "hello"
|
echo "hello"
|
||||||
|
build()
|
||||||
Loading…
Add table
Add a link
Reference in a new issue