Skip to content

lint: print source line under each warning - #3585

Open
aleksisch wants to merge 2 commits into
masterfrom
lint-source-lines
Open

lint: print source line under each warning#3585
aleksisch wants to merge 2 commits into
masterfrom
lint-source-lines

Conversation

@aleksisch

Copy link
Copy Markdown
Collaborator

Uses the structured *_collect_issues overloads (LintIssue carries file/line/column) instead of re-parsing locations out of display strings. --silent suppresses the source lines.

Uses the structured *_collect_issues overloads (LintIssue carries
file/line/column) instead of re-parsing locations out of display
strings. --silent suppresses the source lines.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the utils/lint CLI output to include the offending source line under each warning, switching the tool to consume structured LintIssue records (file/line/column) rather than re-parsing location data from formatted strings. A new --silent flag is added to suppress the source-line printing when desired.

Changes:

  • Replace string-based lint collection with *_collect_issues to carry structured file/line/column metadata end-to-end.
  • Print the corresponding source line under each unique warning (deduped), with a cache to avoid re-reading the same file repeatedly.
  • Add --silent to disable source-line printing while keeping warning summaries.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread utils/lint/main.das
Comment on lines +92 to +95
let fin = find(text, "\n", start)
let line = fin < 0 ? slice(text, start) : slice(text, start, fin)
return line |> strip
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants