nnkArglist => nnkArgList + special case stylecheck:error (#17529)
* nnkArglist => nnkArgList * special case stylecheck:error
This commit is contained in:
parent
8ed6de4fe6
commit
a65189a739
10 changed files with 17 additions and 15 deletions
|
|
@ -125,9 +125,11 @@ proc styleCheckUse*(conf: ConfigRef; info: TLineInfo; s: PSym) =
|
|||
return
|
||||
|
||||
let newName = s.name.s
|
||||
let oldName = differs(conf, info, newName)
|
||||
if oldName.len > 0:
|
||||
lintReport(conf, info, newName, oldName)
|
||||
let badName = differs(conf, info, newName)
|
||||
if badName.len > 0:
|
||||
# special rules for historical reasons
|
||||
let forceHint = badName == "nnkArgList" and newName == "nnkArglist" or badName == "nnkArglist" and newName == "nnkArgList"
|
||||
lintReport(conf, info, newName, badName, forceHint = forceHint)
|
||||
|
||||
proc checkPragmaUse*(conf: ConfigRef; info: TLineInfo; w: TSpecialWord; pragmaName: string) =
|
||||
let wanted = $w
|
||||
|
|
|
|||
|
|
@ -612,9 +612,9 @@ template internalAssert*(conf: ConfigRef, e: bool) =
|
|||
let arg = info2.toFileLineCol
|
||||
internalErrorImpl(conf, unknownLineInfo, arg, info2)
|
||||
|
||||
template lintReport*(conf: ConfigRef; info: TLineInfo, beau, got: string) =
|
||||
let m = "'$2' should be: '$1'" % [beau, got]
|
||||
let msg = if optStyleError in conf.globalOptions: errGenerated else: hintName
|
||||
template lintReport*(conf: ConfigRef; info: TLineInfo, beau, got: string, forceHint = false) =
|
||||
let m = "'$1' should be: '$2'" % [got, beau]
|
||||
let msg = if optStyleError in conf.globalOptions and not forceHint: errGenerated else: hintName
|
||||
liMessage(conf, info, msg, m, doNothing, instLoc())
|
||||
|
||||
proc quotedFilename*(conf: ConfigRef; i: TLineInfo): Rope =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue