sdk icon indicating copy to clipboard operation
sdk copied to clipboard

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

Open parlough opened this issue 1 year ago • 0 comments

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.

  • [x] Link to hosted version of new diagnostic docs when it's written and marked published (https://github.com/dart-lang/sdk/commit/91254e406462287169d0b9a40dbfdd18adb1d5a0)
  • [x] Move since information from tools/since/sdk.yaml to messages.yaml (https://github.com/dart-lang/sdk/commit/62a52ed946698a9971a11ea261e00e7159d2c2fe)
  • [ ] Generate info needed by both docs and source from messages.yaml
    • [x] LintCode (https://github.com/dart-lang/sdk/commit/1f4f0d386a9095fc788f53b0a98d0069bcabc800)
    • [ ] LintRule#description (TODO: @parlough)
    • [ ] LintRule#incompatibleRules (TODO: @parlough)
    • [ ] LintRule#state (TODO: @parlough)
    • [x] LintNames enumeration (https://github.com/dart-lang/sdk/commit/a409a1c07df74c327c9e9f59359f81ab172d6cee)
    • [ ] Maybe: Registration functionality from linter/lib/src/rules.dart (TODO: @parlough)
  • [ ] Remove various info from source, move to messages.yaml if needed for docs
    • [x] LintRule#documentation (https://github.com/dart-lang/sdk/commit/3bf33d6e433ab34b63449eed931945084c75290f)
    • [x] LintRule#details (https://github.com/dart-lang/sdk/commit/46cd8b627cf538a2e114f40ae5df315ae3de9860, https://github.com/dart-lang/sdk/commit/4819bd09aa5048548e10d352bde67f66461ba07f)
    • [x] LintRule#categories (https://github.com/dart-lang/sdk/commit/94eef72b7deefdb3ddc24e3e2375fe2fca8a3162, https://github.com/dart-lang/sdk/commit/a4a7af74df664649f2d0624d6bb05600d36c7ac8)
    • Rule sets/packages info won't be moved

Once relevant data is migrated:

  • [ ] Improve and clean up validation of and generation from messages.yaml (https://github.com/dart-lang/sdk/commit/1b6fe3406ae23854d63a875232edff5536bb2691)
  • [ ] 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 (https://github.com/dart-lang/sdk/commit/e2a2761cc693f43587f3b803ce70a68405db336e)
  • [ ] 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

parlough avatar Oct 02 '24 04:10 parlough