Repository navigation
@W-24222796@ Add Compile Status command - #977
WillieRuemmele merged 10 commits into
Conversation
| // 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 => |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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...
There was a problem hiding this comment.
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.
- 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.
What does this PR do?
Adds
sf apex get compile-statuscommand to show invalid Apex / Apex with compilation warningsWhat issues does this PR fix or reference?