Problem
On nasa/fprime-gds devel at dae5a6342c1e0716b174aebdf72be79f117f7d03, every invocation of fprime-merge-dictionary with --name fails before the dictionaries are read.
fprime-merge-dictionary --name Combined --output combined.json first.json second.json
Actual error:
[ERROR] match() missing 1 required positional argument: 'string'
parse_arguments() calls re.match with the identifier pattern but omits args.name. Invocations without --name avoid the error and use the generated deployment name.
Expected behavior
A valid identifier such as Combined should become metadata.deploymentName in the merged dictionary. Invalid identifiers should receive the existing validation error before any output file is written. The complete string must match, so names such as Combined-extra or Combined followed by a newline cannot pass through a prefix-only match.
Reproduction and proposed change
I reproduced this with two temporary JSON dictionaries containing compatible metadata and distinct commands, using the real module CLI in subprocesses. Fifteen of sixteen new regression cases fail against unchanged code; the no-name control passes. Supplying the name to re.fullmatch fixes the CLI while retaining the intended ASCII identifier syntax.
The new tests also check input immutability, preservation of an existing output on validation failure, and metadata compatibility with/without --permissive. Python 3.12.11 on macOS; no flight deployment is involved.
Problem
On
nasa/fprime-gdsdevel atdae5a6342c1e0716b174aebdf72be79f117f7d03, every invocation offprime-merge-dictionarywith--namefails before the dictionaries are read.Actual error:
parse_arguments()callsre.matchwith the identifier pattern but omitsargs.name. Invocations without--nameavoid the error and use the generated deployment name.Expected behavior
A valid identifier such as
Combinedshould becomemetadata.deploymentNamein the merged dictionary. Invalid identifiers should receive the existing validation error before any output file is written. The complete string must match, so names such asCombined-extraorCombinedfollowed by a newline cannot pass through a prefix-only match.Reproduction and proposed change
I reproduced this with two temporary JSON dictionaries containing compatible metadata and distinct commands, using the real module CLI in subprocesses. Fifteen of sixteen new regression cases fail against unchanged code; the no-name control passes. Supplying the name to
re.fullmatchfixes the CLI while retaining the intended ASCII identifier syntax.The new tests also check input immutability, preservation of an existing output on validation failure, and metadata compatibility with/without
--permissive. Python 3.12.11 on macOS; no flight deployment is involved.