Skip to content

Commit

Permalink
fix(linter): "(invalid MessageData.lazy, missing context)" (#838)
Browse files Browse the repository at this point in the history
  • Loading branch information
llllvvuu committed Jun 12, 2024
1 parent f96a344 commit 42b5ddd
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Batteries/Tactic/Lint/Frontend.lean
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,11 @@ def printWarning (declName : Name) (warning : MessageData) (useErrorFormat : Boo
(filePath : System.FilePath := default) : CoreM MessageData := do
if useErrorFormat then
if let some range ← findDeclarationRanges? declName then
return m!"{filePath}:{range.range.pos.line}:{range.range.pos.column + 1}: error: {
let msg ← addMessageContextPartial
m!"{filePath}:{range.range.pos.line}:{range.range.pos.column + 1}: error: {
← mkConstWithLevelParams declName} {warning}"
pure m!"#check {← mkConstWithLevelParams declName} /- {warning} -/"
return msg
addMessageContextPartial m!"#check {← mkConstWithLevelParams declName} /- {warning} -/"

/-- Formats a map of linter warnings using `print_warning`, sorted by line number. -/
def printWarnings (results : HashMap Name MessageData) (filePath : System.FilePath := default)
Expand Down

0 comments on commit 42b5ddd

Please sign in to comment.