hindent
hindent copied to clipboard
Support deriving stock (-Wmissing-deriving-strategies)
Completed checklist
- [x] I've checked the issue tracker for similar issues.
- [x] 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 => 😿