unused-code / unused

A tool to identify potentially unused code.
https://unused.codes
MIT License
283 stars 11 forks source link

unused.yml file allows for logical errors that result in unexpected results #4

Closed joshuaclayton closed 4 years ago

joshuaclayton commented 4 years ago

Configuring unused.yml allows for odd combinations of match assertions, e.g. coupling token_* (which is often used for prefixes/suffixes of tokens) alongside allowed_tokens (which does exact matching of values against a list of possible values).

I see a few options here:

I'm leaning towards the first item, only because I think even with a misconfiguration, the only problem is that there might be a misrepresentation of potentially unused tokens.

Later on, that could likely be pulled into a unused doctor command if that makes sense.

milmazz commented 4 years ago

I'm leaning towards the first item,

+1 for the first option, and your idea of an unused doctor is also great, but I think that could be done later.

joshuaclayton commented 4 years ago

@milmazz what do you think about output like this?

Errors detected in YAML configuration: LiveView
   Conflicting keys: (2)
   * allowed_tokens
   * token_ends_with
Output and Config