resyntax icon indicating copy to clipboard operation
resyntax copied to clipboard

Remove duplicate provided identifiers

Open jessealama opened this issue 4 years ago • 3 comments

If I provide an identifier multiple times, it could be replaced with a single occurrence of the identifier. Thus,

(provide
  a
  b
  a)             

could be rewritten to just

(provide 
  a
  b)

jessealama avatar Jan 30 '21 06:01 jessealama

This seems doable. Does it need to catch duplication across multiple provide forms, or would duplication within a single provide form be enough? The latter is much easier to implement currently. Also, how common an issue is this in practice? Links to files/commits/pull requests where this rule would have helped would be great.

jackfirth avatar Feb 01 '21 07:02 jackfirth

I guess it's pretty rare. I'm not drawing on experience with PRs or other high-quality code -- I'm reflecting on my own poor code!

jessealama avatar Feb 01 '21 09:02 jessealama

Doing this for a single provide form would be a good (and easier) start.

jessealama avatar Feb 01 '21 09:02 jessealama