add astmsgs; add declared in msg for usage lint errors (#17961)

* add astmsgs; add `declared in` msg for usage lint errors

* fix test

* fix tests/tools/tlinter.nim

* std prefix
This commit is contained in:
Timothee Cour 2021-05-07 21:43:52 -07:00 • committed by GitHub
commit e224865b3b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 43 additions and 39 deletions

View file

@ -616,8 +616,8 @@ template internalAssert*(conf: ConfigRef, e: bool) =
let arg = info2.toFileLineCol
internalErrorImpl(conf, unknownLineInfo, arg, info2)
template lintReport*(conf: ConfigRef; info: TLineInfo, beau, got: string, forceHint = false) =
let m = "'$1' should be: '$2'" % [got, beau]
template lintReport*(conf: ConfigRef; info: TLineInfo, beau, got: string, forceHint = false, extraMsg = "") =
let m = "'$1' should be: '$2'$3" % [got, beau, extraMsg]
let msg = if optStyleError in conf.globalOptions and not forceHint: errGenerated else: hintName
liMessage(conf, info, msg, m, doNothing, instLoc())