Skip to content

#463 - Error messages: give the valid values and suggest the closest code - #464

Merged
njoubert-cleverage merged 2 commits into
mainfrom
463
Nov 4, 2026
Merged

njoubert-cleverage merged 2 commits into
mainfrom
463

Conversation

@njoubert-cleverage

Copy link
Copy Markdown
Member

Description

Fixes #463:

  • new internal DidYouMean helper (Levenshtein, at most a third of the length, up to 3 changes);
  • cleverage:process:execute: Unknown process demo.transformr. Did you mean "demo.transformer"? The processes are listed by the cleverage:process:list command.; Invalid context foo: expected key:value, e.g. -c date:2024-01-01 (the value is parsed as YAML); Cannot handle data output with format 'jsonstream': use 'dump' (STDOUT only) or 'json-stream'. Did you mean "json-stream"?;
  • MissingTransformerException / MissingProcessException::create(): new optional list of the known codes to suggest the closest one, given by TransformerRegistry and ProcessConfigurationRegistry (new getProcessCodes(), without resolving the configurations);
  • callback: Callback option must be callable, "strtoupperr" given ("Class::method" for an array callback, the type otherwise);
  • unknown task code: "Did you mean" and the hint about #[AsTask(code: '...')] / the code attribute of the cleverage.task tag, before the known codes;
  • configuration: a task given as a list (e.g. outputs: [next] indented at the level of the tasks) is reported with a hint about the indentation, instead of Unrecognized option "0"; a task without task nor service says "neither" instead of "not both".

The messages start with the same text as before (except the "neither" one).

Checked locally: the messages in the demo (unknown process, output format); highest dependencies (PHP 8.5), with pcov coverage: all tests OK, no risky; PHPStan, PHP-CS-Fixer and Rector OK.

Requirements

  • Documentation updates
    • Reference
    • Cookbooks
    • Changelog
  • Unit tests

Breaking changes

None.

🤖 Generated with Claude Code

@njoubert-cleverage
njoubert-cleverage requested a review from a team as a code owner November 4, 2026 15:17
…code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@njoubert-cleverage
njoubert-cleverage merged commit f649171 into main Nov 4, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error messages: give the valid values and suggest the closest code

1 participant