Closed sirlensalot closed 6 years ago
If people want it use it that way, I have no objection. Just - main :: [String] -> IO () ?
More like hlint, weeder :: [String] -> IO [Result]
, with main calling that
The problem is that [Result]
is really a tree, so it's a much richer structure than HLint where the hints really are a list. Any structure I give is then locked down in an API, so really want to expose as little as possible.
Well, the real goal is to pass or fail, so a Bool result is good too.
Int
for number of non-ignored errors is just as easy - I think I currently spit that out as the exit code. Sounds like we have a plan. I'd welcome a PR, otherwise it might take a moderate while.
Note: weeder just does exitFailure
with no special code, so my PR returns a Bool.
Fixed in #39.
The current recommendation to use weeder via a downloaded travis.sh script (for travis) and to use a nightly stack build for local installation is prone to build instability if developers do not maintain a regular process of re-installing weeder.
I have solved this problem with hlint by importing it as a library and running it as a test, as seen here: https://github.com/kadena-io/pact/blob/master/tests/HlintSpec.hs . This way the hlint version can be managed and upgraded from the cabal file, nobody ever "forgets" to run hlint, and CI integration is solved.
Weeder however does not export a library so it is not possible to work with it this way. Happy to provide a PR for this.