Skip to content

[tool] Deprecations validator truncates its error message right before the required "v" prefix of the deprecation version tag #178246

Description

@navaronbracke

For #178242 I was looking to add a new deprecation.
I looked at the docs in https://github.com/flutter/flutter/blob/master/docs/contributing/Tree-hygiene.md#deprecations to see how the deprecation message is structured and started working on my PR.

However, when running ./dev/bots/analyze.dart I noticed that the deprecations validator truncates its error message just before the v of the version, which made it less obvious in the error message. I had taken the template from the docs as verbatim, but overlooked a typo.

Proposal

  1. In https://github.com/flutter/flutter/blob/master/docs/contributing/Tree-hygiene.md#deprecations
    change the template to the following, since I presume that more people might take the template as verbatim?
@Deprecated(
  '[description of how to migrate] '
  '[brief motivation for why we are breaking the API] '
  'This feature was deprecated after v[beta version at time of deprecation].'
)
  1. In https://github.com/flutter/flutter/blob/master/dev/bots/analyze.dart#L762-L764 don't truncate the message before the leading "v", as the regex in https://github.com/flutter/flutter/blob/master/dev/bots/analyze.dart#L716-L718 specifically requires it. Perhaps the message should be updated to use a version pattern, instead of three periods?

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listc: proposalA detailed proposal for a change to Flutterc: tech-debtTechnical debt, code quality, testing, etc.d: docs/flutter/flutter/docs, for contributorsframeworkflutter/packages/flutter repository. See also f: labels.team-frameworkOwned by Framework teamtoolAffects the "flutter" command-line tool. See also t: labels.triaged-frameworkTriaged by Framework team

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions