mihaimaruseac / hindent

Haskell pretty printer

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support deriving stock (-Wmissing-deriving-strategies)

bergmark opened this issue · comments

Completed checklist

  • I've checked the issue tracker for similar issues.
  • I am not creating an issue about adding more configuration options for the styling/layout of hindent, because hindent is not about customizing style.

Problem description

$ cat Test.hs

data X deriving stock Generic

$ hindent Test.hs
$ cat Test.hs

data X
  deriving  (Generic)

(sic! two spaces in deriving (Generic))

Proposed solution

Don't remove stock if present. Removing it triggers -WMissing-deriving-strategies if enabled. I like being explicit about it to remove potential confusion on how the instance is being derived.
This solution will not cause a diff for anyone upgrading.

Alternatives

  • Always add stock => not backwards compatible and will cause diffs.
  • Don't do anything and keep things as is => 😿

Closing as the current master doesn't remove stock anymore.