Skip to content

Define style guide as data interchange format #57155

@seaneagan

Description

@seaneagan

Currently the style guide is just a markdown doc. So there is no metadata about the style guide rules for the linter to consume, so it will have to define its own. It would be much nicer if the lints produced by the linter were associated back to a style guide rule via a rule id. The rule metadata could then be looked up in the style guide by that id. Would probably be either JSON or YAML. That would allow:

  • maintaining rule metadata in a single place
    • id
    • type e.g. DO/DONT/PREFER/AVOID
    • title the text after the type
    • description
    • good and bad examples
  • Contextual view of style guide rule violations for lints in editors (e.g. in tooltips and problems view) which could also link to the appropriate section of the actual style guide.
  • Filtering of rules by their type which could be useful for Linter Configurability #57153.
  • Generating the actual style guide markdown doc.

I filed the issue here instead of at https://github.com/dart-lang/www.dartlang.org since this seems like a logical place for the discussion, but I can move it there if desired.

@pq @munificent thoughts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    devexp-linterIssues with the analyzer's support for the linter packagelegacy-area-analyzerUse area-devexp instead.type-enhancementA request for a change that isn't a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions