mirror of
https://github.com/nim-lang/Nim.git
synced 2026-02-20 01:48:31 +00:00
* fix #8219; nim check/dump shouldn't run single nimscript project [backport: 1.6]
This commit is contained in:
@@ -301,7 +301,7 @@ proc loadConfigs*(cfg: RelativeFile; cache: IdentCache; conf: ConfigRef; idgen:
|
||||
if conf.cmd == cmdNimscript:
|
||||
showHintConf()
|
||||
conf.configFiles.setLen 0
|
||||
if conf.cmd != cmdIdeTools:
|
||||
if conf.cmd notin {cmdIdeTools, cmdCheck, cmdDump}:
|
||||
if conf.cmd == cmdNimscript:
|
||||
runNimScriptIfExists(conf.projectFull, isMain = true)
|
||||
else:
|
||||
@@ -311,5 +311,6 @@ proc loadConfigs*(cfg: RelativeFile; cache: IdentCache; conf: ConfigRef; idgen:
|
||||
runNimScriptIfExists(scriptFile, isMain = true)
|
||||
else:
|
||||
# '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
|
||||
showHintConf()
|
||||
|
||||
@@ -249,6 +249,11 @@ tests/newconfig/bar/mfoo.nims""".splitLines
|
||||
expected.add &"Hint: used config file '{b}' [Conf]\n"
|
||||
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
|
||||
let filename = testsDir / "newconfig/foo2/mfoo2.customext"
|
||||
let cmd = fmt"{nim} e --hint:conf {filename}"
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
discard """
|
||||
cmd: "nim check $file"
|
||||
"""
|
||||
|
||||
mode = ScriptMode.Verbose
|
||||
proc build() =
|
||||
echo "building nim... "
|
||||
exec "sleep 10"
|
||||
exec "nonexistant command"
|
||||
echo getCurrentDir()
|
||||
|
||||
echo "hello"
|
||||
build()
|
||||
Reference in New Issue
Block a user