
On Fri, Feb 28, 2014 at 9:04 PM, Henning Thielemann < lemming@henning-thielemann.de> wrote:
Following Mikhail Glushenkov's advice I have prepared a separate tool that checks PVP compliance of imports as proposed in: https://github.com/haskell/cabal/issues/1703
I added some feedback in this bug, before I saw this email.
* How can I exclude automatically generated modules like Path_*.hs from the check?
Somewhere in the code there's a function for getting them. Unfortunately I don't remember where. Not very helpful, I know.
* How can I access modules that are preprocessed? HSC processed modules are stored in dist/build, but CPP processed modules are not stored anywhere.
Perhaps because GHC applies CPP "on the fly". I guess you prefer to use haskell-src-exts, but using the GHC API might be better in the long run, as your tool will work on all packages (more or less a requirement for cabal integration.)
* How shall I cope with condition flags? Currently I use flattenPackageDescription. Alternatively I might only check the modules that are part of the current configuration. But I may miss many modules this way. I might perform checks on all possible configurations.
* Can you give me advice on what I shall write to stdout and what to stderr? The purpose of the program is to generate a list of warnings. Shall they be written to stderr because they are warnings or shall they be written to stdout because they are the intended output of the program?
I think it depends on the context where this is run. If it was part of cabal check, stderr. If it's a standalone tool, perhaps stdout.
* Regarding levels of verbosity: How silent shall silent be? Shall the test results be emitted in silent mode or only in normal verbosity mode?
By test results you mean your warnings? I think we should consider making this part of cabal check. I think we might want to only run it on the library section for now and only optionally (i.e. using a flag) check test-suites etc. The PVP really only applies to libraries. -- Johan