Module

Whine

Package
purescript-whine-core
Repository
collegevine/purescript-whine

#runRules Source

runRules :: forall m e. MonadEffect m => RangeOf e => RuleSet -> Module e -> WhineM (WithRule + ()) m Unit

Given a parsed PS module, runs all the rules on it. The rules report violations via Writer side-effects.

#checkFile Source

checkFile :: forall m. MonadEffect m => RuleSet -> FilePath -> WhineM (WithRule + WithMuted + WithFile + ()) m Unit

Given a file path, reads the file, then passes it to checkModule (see comments there).

#checkModule Source

checkModule :: forall m. MonadEffect m => RuleSet -> { path :: FilePath, text :: String } -> WhineM (WithRule + WithMuted + WithFile + ()) m Unit

Given full text of a PureScript module, parses it and runs all the rules on it, then amends the rules with the muted :: Boolean flag based on the muting directives in the file itself as well as include/exclude globs in each rule's config. If reading the file or parsing it fails, those conditions are reported as linter violations, rather than a big loud crash.