← Back to issue list

Provide a way for apps to warn users about deprecated features.

View original Github issue

Metadata

Project
craft-cli
Number
#266
Type
issue
State
open
Author
lengau
Labels
Created
2024-07-31 19:33:39+00:00
Updated
2025-03-10 18:59:08+00:00
Closed

Current evaluation

No evaluation has been recorded for this issue yet.

Issue body

### What needs to get done Similar to `CraftError` but this would be a way to alert users that something is deprecated and will be removed in a future release of the app. Ideally, it would be something equivalent to `warnings.warn()`, perhaps a `warning()` method on the `Emitter`, that gets: 1. A warning message for the user (that will be emitted permanently to stderr) 2. A link to documentation about the change. 3. (Optionally) a version in which the warning will become an error. This particular warning should only be emitted once per application run, and the app should be able to disable these warnings. (e.g. if an app is going to run in managed mode, the outer version can silence its own warnings.) ### Why it needs to get done Currently applications either implement this themselves or just use `emit.progress` with `permanent=True`, but this would help the app have a consistent way to do it.

Evaluation history

No evaluation history available.