Skip to content

[analyzer/linter] Consolidate still relevant information from rules.json into messages.yaml #56835

@parlough

Description

@parlough

As we introduce diagnostic style documentation for lint rules in pkg/linter/messages.yaml, we should collocate other relevant linter rule and lint code information in the same messages.yaml file. While doing so, we can move the old lint documentation information out of source code. This will help us to simplify and generalize the LintRule class, and in some cases, reduce the amount of strings that get included in the analysis server executable.

  • Link to hosted version of new diagnostic docs when it's written and marked published (91254e4)
  • Move since information from tools/since/sdk.yaml to messages.yaml (62a52ed)
  • Generate info needed by both docs and source from messages.yaml
    • LintCode (1f4f0d3)
    • LintRule#description (TODO: @parlough)
    • LintRule#incompatibleRules (TODO: @parlough)
    • LintRule#state (9de2a62)
    • LintNames enumeration (a409a1c)
    • Maybe: Registration functionality from linter/lib/src/rules.dart (TODO: @parlough)
  • Remove various info from source, move to messages.yaml if needed for docs

Once relevant data is migrated:

  • Improve and clean up validation of and generation from messages.yaml (1b6fe34)
  • Move downstream users away from machine/rules.json
    • dart-lang/site-www
    • dart-lang/lints
    • Other users?
  • Delete generation code and tests of machine/rules.json (e2a2761)
  • Remove the generated machine/rules.json file from the SDK and dart-lang/site-www
  • Fully remove the LintRule and LintCode members that were deprecated as part of this work

Metadata

Metadata

Assignees

Labels

P3A lower priority bug or feature requestarea-devexpFor issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.devexp-linterIssues with the analyzer's support for the linter packagetype-documentationA request to add or improve documentation

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions