In theory it should be possible to use cabal check to lint *.cabal files. However there are some potential problems:
cabal check only works when there is exactly one *.cabal file in the current directory. You can't pass in a file name. You also can't pass in file contents on STDIN.
The output of cabal check is not machine readable.
cabal check only works with package descriptions, but other files use Cabal syntax (like cabal.project).
In theory it should be possible to use
cabal check
to lint*.cabal
files. However there are some potential problems:cabal check
only works when there is exactly one*.cabal
file in the current directory. You can't pass in a file name. You also can't pass in file contents on STDIN.cabal check
is not machine readable.cabal check
only works with package descriptions, but other files use Cabal syntax (likecabal.project
).It's possible that these issues will be addressed by https://github.com/haskell/cabal/issues/8211.