Skip to content

[cli] Consider processing errors in exit status #2827

@linusjf

Description

@linusjf

Affects PMD Version:
6.28.0

Description:
Command line interface:

There are a couple of problems with the error code returned
currently. If failOnViolations is set and PMDException occurs, the error
code returned is 0, not 1. That's not expected.
If violations are present as well, the error code returned is 4, not 1.
Is this the norm or expected behaviour? It must be 1 while not failing to process violations.

When both occur, the more severe error code must be returned; in this case, 1.

Running PMD through:
CLI

PS: It's been a while since I've used the CLI. And it has slipped my mind as how to simulate a PMDException while executing it.

Referred from here.

Metadata

Metadata

Assignees

Labels

an:enhancementAn improvement on existing features / rulesin:cliAffects the PMD Command Line Interface

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions