feature request: cabal lint #1680

dagit opened this Issue Feb 11, 2014 · 4 comments


None yet

5 participants


The purpose of cabal lint command would be to point out potentially bogus things in the users .cabal file. It could additionally check for violations to hackage's policy. The idea is that, while cabal checks for serious problems automatically and gives an error, there may be other things it could warn about (if they are correlated with mistakes but not necessarily wrong).

Here are a few things off the top of my head to get ideas going:

  • Warn about files in hs-source-dirs (and similar) that are not mentioned in the .cabal file. Due to the way ghc chases dependencies it's easy to forget to list something.
  • Depending on a really old version of cabal in the .cabal file.
  • Relative paths for extra libraries (I think this is currently an error, but in controlled situations it's desirable and fine).
  • Warn about weird dependency constraints (missing bounds?)
  • There are some situations where putting executable and library sections in one .cabal file and overlapping the source directories leads to a very confused ghc, try typing cabal install on this minimal example thanks to @glguy: https://github.com/dagit/cabal-quirk

Basically, anything that is questionable but not obviously an error could have a cabal lint warning.

Haskell member

Instead of adding a new command, isn't it better to just extend cabal check?

Haskell member

actually, a cabal lint would be useful for a different (but related role): checking the users ~/.cabal/config settings!

Currently theres no way to give nice user feedback about potential issues with having an old ~/.cabal/config, and this will likely hit a few users who try to use cabal 1.18 and ghc 7.8 with the old no enabled shared flags that might be lying around in a legacy config

@ttuegel ttuegel added this to the Cabal-1.24 milestone Apr 23, 2015
Haskell member

If there's a potential issue with the user's ~/.cabal/config, that needs to be a warning wherever it may be an issue. But, I'm not aware of any issues that did arise during the Cabal 1.18/GHC 7.8 transition.

Tagging this documentation for the outstanding issue that cabal check is not properly documented.

@23Skidoo 23Skidoo modified the milestone: Cabal 1.24, Cabal 1.26 Feb 21, 2016
@ezyang ezyang modified the milestone: Cabal 2.0 Sep 6, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment