Skip to content

Produce a warning for deprecated features related to JSON outputs #6261

@wenzeslaus

Description

@wenzeslaus

This issue is to track deprecation warnings for version 8.6 (next minor release).

After addition of format=json, format=csv, or others to tools producing text on standard output, some parameters, especially usage -g in many tools, are deprecated.

Usually, the deprecation warning was implemented as a verbose message to allow people adopt the new behavior in v8.5 while not being intrusive with a warning when they use something which was the only possible way in the previous version (8.4). In version 8.6 (or possibly a later version), we should change this to a warning to strongly encourage the change.

In the code, we may have something like this:

G_verbose_message(
            _("Flag 'g' is deprecated and will be removed in a future "
              "release. Please use format=csv instead."));

And that should now change to this:

G_warning(
            _("Flag 'g' is deprecated and will be removed in a future "
              "release. Please use format=csv instead."));

This will apply to multiple tools and a full text search of [deprecated] should generally be sufficient to identify the places which needs a change.

In addition to the message, the documentation may to be updated if it specifically mentions a version or the message, so a documentation review is needed. The following example of documentation would not need any change:

The -g flag is deprecated and will be removed in a future release. Please use format=csv option with the -p flag instead.

The parameters should also be reviewed, but generally should not need any change just like the doc. An example which does not need a change:

    csv_print = G_define_flag();
    csv_print->key = 'g';
    csv_print->label = _(
        "Print all map connection parameters in a legacy format [deprecated]");

This can in theory be applied to version 9.0 without breaking semantic versioning expectations because the features would be already deprecated at the time of the release.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    Status

    No status

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions