Skip to content

@W-24222796@ Add Compile Status command - #977

Merged
WillieRuemmele merged 10 commits into
salesforcecli:mainfrom
jamessimone:feature/W-24222796-get-compile-status
Oct 5, 2026
Merged

WillieRuemmele merged 10 commits into
salesforcecli:mainfrom
jamessimone:feature/W-24222796-get-compile-status

Conversation

@jamessimone

@jamessimone jamessimone commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

What does this PR do?

Adds sf apex get compile-status command to show invalid Apex / Apex with compilation warnings

What issues does this PR fix or reference?

  • @W-24222796@

@jamessimone
jamessimone requested a review from a team as a code owner October 2, 2026 17:26
Comment thread src/commands/apex/get/compile-status.ts Outdated
Comment thread README.md Outdated
Comment thread src/commands/apex/get/compile-status.ts Outdated
Comment thread src/commands/apex/get/compile-status.ts Outdated
// so we format the results for everyone else
if (!this.jsonEnabled() && invalidApexResponse.results.length > 0) {
if (invalidApexResponse.results.length > 0) {
const tableFormatter = (tableItems: ApexClassProblem[]): string =>

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.

The JSON.stringify per problem produces output like {"line":10,"column":5,"message":"Unexpected token: }"} in the table cell — not great for human consumption.

Consider a readable format, e.g.:

const tableFormatter = (items: ApexClassProblem[]): string =>
  items.map((p) => `L${p.line}:C${p.column} - ${p.message}`).join('\n');

This would render as L10:C5 - Unexpected token: } which is much easier to scan.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'll work a little bit on the output, but I thought the tabled results looked nice as is. Let me play around it with it...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I tried a few different output formats, but the bare string versions just look weird on my terminal. I don't think they're easier to read, and in many cases the "message" would wrap onto a new line in a way that the stringified versions didn't.

Comment thread messages/get-compile-status.md Outdated
@WillieRuemmele WillieRuemmele changed the title @W-24222796 Add Compile Status command @W-24222796@ Add Compile Status command Oct 2, 2026
jamessimone and others added 5 commits October 3, 2026 09:29
- Format problems/warnings as readable strings (L:C - message) instead
  of raw JSON
- Set table overflow to wrap so long messages aren't truncated
- Remove stale signal handler test (was testing SfCommand base class
  behavior, not the command)
- Remove unnecessary process.on/process.exit stubs from beforeEach
- Add expect.fail() to API version test to catch silent passes
- Add NUT for compile-status command
org:create:scratch, project:deploy:start, and org:delete:scratch need
cli: 'sf' since they aren't part of plugin-apex and can't run via
bin/run.
@WillieRuemmele
WillieRuemmele merged commit e3f1547 into salesforcecli:main Oct 5, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants