davsclaus opened a new pull request, #29926: URL: https://github.com/apache/camel/pull/29926
Part of item 5 of [CAMEL-26933](https://issues.apache.org/jira/browse/CAMEL-26933): the exit codes of `camel validate`. ## Problem Agents run `camel validate` after every edit, so its exit codes need to say what happened. They disagreed: - `camel validate yaml nope.yaml` reported a validation error with exit 1 (`YamlValidateCommand`), while `validate source` and `validate properties` exit 66 (file not found) for a missing file. - `camel validate source notes.txt` printed "Validation success (files:0)" and exited 0 (`SourceValidateCommand`), although nothing was validated. - `camel validate normalize notes.txt` exited 0 with no output. ## Change - `validate yaml` of a file that does not exist: exit 66, "File not found: <file>". - `validate source` with no file it can validate: exit 66, "No files to validate (YAML, XML, Java and properties files)", as `validate yaml` ("No YAML files to validate") and `validate properties` already do. - `validate normalize` with no YAML file: exit 66, "No YAML files to normalize". - The 4.24 upgrade guide has an entry, as scripts may check the old codes. The rest of item 5 (`validate yaml --camel-version=9.9.9`, the wording of the messages, `validate normalize` dropping comments, `application.yaml`, `validate properties` options) is not in this PR. ## Tests - `ValidateJsonTest.theCommandsAgreeOnMissingFilesAndNothingToDo`: the three cases. - The camel-jbang-plugin-validate tests pass (24). _Claude Code on behalf of davsclaus_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
