tfausak / cabal-gild

:crown: Format Haskell package descriptions.
https://hackage.haskell.org/package/cabal-gild
MIT License
49 stars 5 forks source link

fail if an unknown pragma or unsupported pragma feature is found #105

Open BebeSparkelSparkel opened 3 months ago

BebeSparkelSparkel commented 3 months ago

If cabal-gild finds an unsupported pragma in the cabal file it should fail and report the unsupported pragma.

The flag --ignore-unsupported-pragmas should be added to ignore these pragmas and continue processing the cabal file.

This would have been useful for understanding why #96 was failing.

This should be added to all major versions.

tfausak commented 3 months ago

I like the idea of failing by default but providing a flag for turning them into warnings to allow for forwards compatibility.

Note that this wouldn't have necessarily helped with #96 because */foo is a valid filename that also happens to be a glob. Older versions certainly could suggest that this probably isn't doing what you intended, but it's not wrong per se.

BebeSparkelSparkel commented 3 months ago

The warning flag is a better idea, so --warn-unsupported-pragmas flag.