-
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
Cabal format duplicates dependencies #2353
Comments
/cc @benarmston On Mon, Jan 12, 2015 at 4:33 PM, Taylor Fausak [email protected]
|
I think the problem is in import Distribution.ParseUtils (ParseResult (ParseOk))
import Distribution.PackageDescription.Parse (parsePackageDescription)
import Distribution.PackageDescription.PrettyPrint (showGenericPackageDescription)
main :: IO ()
main = case parsePackageDescription cabalFile of
ParseOk _ package -> do
print package
putStrLn (showGenericPackageDescription package)
_ -> return ()
cabalFile :: String
cabalFile = unlines
[ "name: example"
, "cabal-version: >=1.2"
, "license: UnspecifiedLicense"
, ""
, "library"
, " build-depends:"
, " base -any"
] Running that gave me this output:
The package description contains a lot of things, but this part looked interesting:
There appears to only be one dependency. That tells me that it's being parsed correctly but it's being displayed incorrectly. |
This still happens with cabal-install 1.22.0.1. From what I can tell, it only affects Cabal on OS X. |
This does not happen anymore with cabal-install 1.22.2.0. One of these changes fixed it: cabal-install-v1.22.0.1...cabal-install-v1.22.2.0. |
Running
cabal format
duplicates thebuild-depends
section and duplicates dependencies in that section. For example, with this Cabal file:Repeatedly running
cabal format
produces this:I would expect
cabal format
to not make any changes to the given Cabal file. I'm using GHC version 7.8.3 and Cabal version 1.22.0.0.The text was updated successfully, but these errors were encountered: