Module
Whine.Runner.Config
- Package
- purescript-whine-core
- Repository
- collegevine/purescript-whine
#PackageSpec Source
data PackageSpec
Constructors
JustPackage
PackageVersion Version
LocalPackage { module :: Maybe String, path :: FilePath }
#ConfigJson Source
type ConfigJson = { exclude :: Maybe (Array NonEmptyString), include :: Maybe (Array NonEmptyString), rulePackages :: Map { package :: String } PackageSpec, rules :: Maybe (Map String JSON) }
#parseRuleConfigs Source
parseRuleConfigs :: forall m. MonadRules (WithRule + ()) m => RuleFactories -> Map String JSON -> m RuleSet
The config has the general shape of:
RuleId:
include: ["one/file.purs", "many/**/*.purs"]
exclude: ["same.purs"]
enabled: true
ruleSpecificSetting1: "foo"
ruleSpecificSetting2: 42
ruleSpecificSetting3: ["a", "b", "c"]
AnotherRuleId:
... samesies ...
This is what this function takes as parameter - a map of JS objects. The keys are rule IDs, the inner objects are rule-specific settings, plus common options of "include", "exclude", and "enable", all optional.
The other parameter is an array of rule factories, each a tuple of
(ruleId /\ factoryFunction), where factoryFunction :: JSON -> Either String Rule
The result is a RuleSet
value, which is a map of rule IDs to rule
configs.
The whole thing runs in a writer monad to which it can report any errors while parsing the config. The errors doesn't stop the parsing, but erroneous rules do not make it into the resulting map.
#readConfig Source
readConfig :: forall m. MonadEffect m => RuleFactories -> FilePath -> WhineM (WithRule + WithFile + WithMuted + ()) m Config
Reads config from a given file and parses it.
#packagesCodec Source
packagesCodec :: Codec (Map { package :: String } PackageSpec)
- Modules
- Vscode.
Client - Vscode.
Client. Configuration - Vscode.
Client. Executable - Vscode.
Client. FileSystemWatcher - Vscode.
Client. Workspace - Vscode.
Context - Vscode.
Events - Vscode.
Server. Capabilities - Vscode.
Server. Connection - Vscode.
Server. Diagnostic - Vscode.
Server. TextDocuments - Whine
- Whine.
Core. CaseBranchIndentation - Whine.
Core. CommaFirstArrays - Whine.
Core. UndesirableModules - Whine.
Core. WhineRules - Whine.
Log - Whine.
Muting - Whine.
Prelude - Whine.
Print - Whine.
Runner - Whine.
Runner. Cli - Whine.
Runner. Config - Whine.
Runner. FS - Whine.
Runner. Glob - Whine.
Runner. LanguageServer - Whine.
Runner. PackageVersion - Whine.
Runner. Prelude - Whine.
Runner. Yaml - Whine.
Types - WhineM