From 426edbef9ce836f1f891c479ec32dab93f015c7c Mon Sep 17 00:00:00 2001 From: Johan Persson Date: Mon, 2 Mar 2026 11:28:06 +0100 Subject: [PATCH] fix(repo-tools): allow excess arguments for generate-catalog-info command Re-add `.allowExcessArguments(true)` which was dropped during conflict resolution in the Commander v14 upgrade (PR #32583). lint-staged passes staged file paths as extra arguments when invoking `generate-catalog-info` via the pre-commit hook, causing Commander v14 to reject them with "too many arguments". Signed-off-by: Johan Persson --- .changeset/bright-items-see.md | 5 +++++ packages/repo-tools/src/commands/index.ts | 1 + 2 files changed, 6 insertions(+) create mode 100644 .changeset/bright-items-see.md diff --git a/.changeset/bright-items-see.md b/.changeset/bright-items-see.md new file mode 100644 index 0000000000..ea3ba17cdf --- /dev/null +++ b/.changeset/bright-items-see.md @@ -0,0 +1,5 @@ +--- +'@backstage/repo-tools': patch +--- + +Fixed `generate-catalog-info` command failing with "too many arguments" when invoked by lint-staged via the pre-commit hook. diff --git a/packages/repo-tools/src/commands/index.ts b/packages/repo-tools/src/commands/index.ts index dab7d6df0d..371d0609ff 100644 --- a/packages/repo-tools/src/commands/index.ts +++ b/packages/repo-tools/src/commands/index.ts @@ -226,6 +226,7 @@ export function registerCommands(program: Command) { 'CI run checks that there are no changes to catalog-info.yaml files', ) .description('Create or fix info yaml files for all backstage packages') + .allowExcessArguments(true) .action( lazy( () => import('./generate-catalog-info/generate-catalog-info'),