Module

Whine

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

#runRules Source

runRules :: forall m e. Monad m => RangeOf e => RuleSet (WriterT (Violations ()) m) -> Module e -> WriterT (Violations (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 (WriterT (Violations ()) m) -> FilePath -> WriterT (Violations (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 (WriterT (Violations ()) m) -> { path :: FilePath, text :: String } -> WriterT (Violations (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.