Skip to content

feat(ng-dev/format): report line numbers for formatting failures - #4127

Merged
alan-agius4 merged 1 commit into
angular:mainfrom
alan-agius4:feat/ng-dev-format-line-number
Nov 24, 2026
Merged

alan-agius4 merged 1 commit into
angular:mainfrom
alan-agius4:feat/ng-dev-format-line-number

Conversation

@alan-agius4

@alan-agius4 alan-agius4 commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Compute and report the 1-based line number of the first formatting, lint, or syntax failure in ng-dev format (Prettier and Buildifier), while keeping the follow-up pnpm ng-dev format files <files> command free of :line.
  • Update the angular-ng-dev-format GitHub Actions problem matcher (github-actions/npm/checkout-and-setup-node/matchers.json) to capture the optional line number ("line": 3) so GitHub renders inline annotations in the PR Files changed diff view while remaining backwards-compatible with legacy line-less output.
  • Add unit tests for line detection, formatters, output formatting (ng-dev/format/test/format.spec.ts), and problem matcher parsing (github-actions/bazel/configure-remote/failure-annotations.spec.ts), and regenerate github-actions/release/publish/main.js.

Report the 1-based line number of the first formatting, lint, or syntax failure in `ng-dev format` output and capture it in the `angular-ng-dev-format` GitHub Actions problem matcher so annotations render inline in the pull request diff view.
@angular-robot angular-robot Bot added the detected: feature PR contains a feature commit label Nov 24, 2026
@alan-agius4
alan-agius4 force-pushed the feat/ng-dev-format-line-number branch from 6615a31 to ee8fe54 Compare November 24, 2026 14:11
@alan-agius4
alan-agius4 requested a review from atscott November 24, 2026 14:11
@alan-agius4 alan-agius4 added the action: merge The PR is ready for merge by the caretaker label Nov 24, 2026
@alan-agius4
alan-agius4 marked this pull request as ready for review November 24, 2026 14:11

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request introduces line-number reporting for formatting and linting failures in the ng-dev tool. It updates the Formatter interface to include a getFailureLine method, implements this logic for Prettier and Buildifier, and updates the parallel execution logic to capture and display these line numbers in logs. The review comment highlights a potential performance bottleneck where awaiting getFailureLine inside the parallel loop blocks worker threads; this is a valid improvement opportunity for the current implementation.

Comment thread ng-dev/format/run-commands-parallel.ts Resolved

@josephperrott josephperrott left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@alan-agius4
alan-agius4 removed the request for review from atscott November 24, 2026 17:10
@alan-agius4
alan-agius4 merged commit f715124 into angular:main Nov 24, 2026
17 of 18 checks passed
@alan-agius4

Copy link
Copy Markdown
Contributor Author

This PR was merged into the repository. The changes were merged into the following branches:

@alan-agius4
alan-agius4 deleted the feat/ng-dev-format-line-number branch November 24, 2026 17:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action: merge The PR is ready for merge by the caretaker detected: feature PR contains a feature commit

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants