Skip to content

Verify: Returns 1 for invalid SPDX doc; 2 for bad args#300

Merged
goneall merged 5 commits into
spdx:masterfrom
bact:exit-code-2
Jul 19, 2026
Merged

Verify: Returns 1 for invalid SPDX doc; 2 for bad args#300
goneall merged 5 commits into
spdx:masterfrom
bact:exit-code-2

Conversation

@bact

@bact bact commented Jul 16, 2026

Copy link
Copy Markdown
Collaborator

Implement exit codes as proposed in #299

Remove unused ERROR_STATUS.

bact added 2 commits July 16, 2026 13:57
run() returns an exit-status int instead of calling System.exit()
directly. No behavior change.

Signed-off-by: Arthit Suriyawongkul <arthit@gmail.com>
USAGE_ERROR_STATUS=2 for bad invocation (missing args, invalid file type, invalid file name);

ERROR_STATUS=1 stays for invalid or unreadable SPDX documents.

Signed-off-by: Arthit Suriyawongkul <arthit@gmail.com>
@bact bact added the enhancement New feature or request label Jul 16, 2026
@bact
bact marked this pull request as draft July 16, 2026 13:22
Signed-off-by: Arthit Suriyawongkul <arthit@gmail.com>

@goneall goneall left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Just one change requested - I don't think we need to deprecate the unused constant, we can just delete it.

Comment thread src/main/java/org/spdx/tools/Verify.java Outdated
Signed-off-by: Arthit Suriyawongkul <arthit@gmail.com>
@bact
bact requested a review from goneall July 19, 2026 08:35
Signed-off-by: Arthit Suriyawongkul <arthit@gmail.com>

@goneall goneall left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@goneall
goneall merged commit a464dc5 into spdx:master Jul 19, 2026
1 check passed
@bact
bact deleted the exit-code-2 branch July 19, 2026 17:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants