Skip to content

Provide guidance for misconfigured config #1546

@stuartmorgan-g

Description

@stuartmorgan-g

The first time I tried to import an unnamed enum it took a while, because I hadn't realized it was a different config entry, and I tried various attempts with both enum and global before finding the right part of the docs. In general, it's tricky to debug a mistake because failures are basically silent, and can be caused by lots of different things (wrong element type, typo, wrong header, etc.)

Of course we can't figure out every problem at runtime, but I wonder if we could add some simple heuristics to give feedback. E.g.,:

  • For globals, enums, and unnamed-enums, if an inclusion or exclusion doesn't match anything, try it with the other two types and if it would match something that way, print a message suggesting that it may be in the wrong place.
  • Keep track of any symbol within a Hamming distance of one or two of a non-wildcarded pattern of the same type, and if that list is non-empty and that pattern didn't match anything, suggest that it may be a typo and print the close value(s)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Todo

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions