An open source design system that's fully customizable and agent ready
TypeScript
fix(cli): integration check --strict prints each finding once (#7751)
Joeyf1e22eed8afc
diff --git a/.changeset/strict-list-once.md b/.changeset/strict-list-once.mdnew file mode 100644index 0000000000..30848d36e9--- /dev/null+++ b/.changeset/strict-list-once.md@@ -0,0 +1,7 @@+---+'@astryxdesign/cli': patch+---++[fix] `astryx integration check --strict` prints each finding once. The checks' own output shows its message and fix, and the closing "Failing under --strict" list names each failure by check, code and place only, so a long report is no longer doubled.++@josephfarinadiff --git a/packages/cli/clients/cli/commands/integration-check.test.mjs b/packages/cli/clients/cli/commands/integration-check.test.mjsindex a6068022f8..19175b4803 100644--- a/packages/cli/clients/cli/commands/integration-check.test.mjs+++ b/packages/cli/clients/cli/commands/integration-check.test.mjs@@ -117,6 +117,23 @@ describe('astryx integration check', () => {expect(run.status).toBe(1);});+ it('--strict prints each finding once: its message above, its code in the failing list', async () => {+ const id = await coreTemplateId();+ writePackage({id});++ const run = await runCli(['integration', 'check', '--strict'], tmpDir);+ const json = await runCli(+ ['integration', 'check', '--strict', '--json'],+ tmpDir,+ );+ const [failure] = JSON.parse(json.stdout.trim()).data.failures;++ expect(run.stdout.split(failure.message).length - 1).toBe(1);+ expect(+ run.stdout.slice(run.stdout.indexOf('Failing under --strict')),+ ).toContain('template_id_conflict');+ });+it('--json carries each check with its own envelope, the --strict failures, and exits as the text does', async () => {const id = await coreTemplateId();writePackage({id});diff --git a/packages/cli/clients/cli/commands/integration.mjs b/packages/cli/clients/cli/commands/integration.mjsindex 754284160e..c0ebf13f3f 100644--- a/packages/cli/clients/cli/commands/integration.mjs+++ b/packages/cli/clients/cli/commands/integration.mjs@@ -155,7 +155,8 @@ async function checkPackage(program, options) {: data.name;emit(// --strict lists each warning and each skipped check again, as the- // error it now is, in the issue format the checks use.+ // error it now is: by check, code and place only, since the check's own+ // output above already printed its message and fix once....(data.failures.length > 0? [section('Failing under --strict'),@@ -166,8 +167,6 @@ async function checkPackage(program, options) {'code','component','prop',- 'message',- 'fix','file','line',],