-
Notifications
You must be signed in to change notification settings - Fork 696
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Show format for --help flag. Fixes #2460 #2607
Conversation
It's intentionally hidden because it's somewhat buggy. |
Now that #2353 is closed, are there any other blockers on exposing this? |
@bgamari Sorry, I'm sick right now, will answer in a few days. |
@23Skidoo ping (apologies if you are still ill). |
Patch looks fine, assuming we're now happy with exposing this feature. |
Well, the patch itself is trivial, but |
Simple check for @23Skidoo module Main (main) where
import Control.Monad
import Control.Applicative
import Distribution.Verbosity
import Distribution.PackageDescription.Parse
import Distribution.PackageDescription.PrettyPrint
import Distribution.ParseUtils
hoist :: ParseResult a -> Maybe a
hoist (ParseOk _ x) = Just x
hoist (ParseFailed _) = Nothing
check :: FilePath -> IO ()
check cabal = do
print cabal
desc <- readPackageDescription silent cabal
let desc' = parsePackageDescription (showGenericPackageDescription desc)
when (Just desc /= hoist desc') $ do
print $ Just desc
print $ hoist desc'
fail cabal
main :: IO ()
main = do
-- Generate listing with
-- find . -type f -name '*.cabal' > cabal-files
cabalFiles <- lines <$> readFile "cabal-files"
mapM_ check cabalFiles Fails already at |
@phadej Thanks! I think we shouldn't expose |
I'm sure this is nice'n'all, but I'm not sure "round-tripping" is the be-all-and-end-all of package description formats[1]. So, I'd argue to just say WONTFIX... as unpopular as that may be. I'd rather argue that the cmdline arg and all supporting code should be removed. (I hope I haven't completely misunderstood the point of this PR.) [1] Parsers of said formats, sure, but not the semantics. |
I have recently started taking a closer look at the I'm going to close out this PR since it'll be a little while before we want this to be published. |
Fixes #2460