ExtraChecksRunnerNode
Run checks in the command line.
Fully assembled command line program to run checks, re-running on file changes.
Use from a node gren project as the main.
Be aware that if you change the gren.json/dependencies of the project to check
the program needs to be restarted.
If you just want to list all errors once without fixes and without watching for changes,
run the node program not in TTY mode, for example with gren run Main | cat on linux.
In projects where security is important,
you can instead assemble the parts that define a ExtraChecksRunnerNode.program yourself,
for you to inspect and mess with:
program =
Node.defineProgram
{ init =
\environment ->
Init.await Terminal.initialize
(\maybeTerminalConfiguration ->
Init.await FileSystem.initialize
(\fileSystemPermission ->
Init.awaitTask
(initWith config
{ environment = environment
, terminalConfiguration = maybeTerminalConfiguration
, fileSystemPermission = fileSystemPermission
}
)
Node.startProgram
)
)
, update = \event state -> update config event state
, subscriptions = \state -> subscriptions config state
}
Notice how initWith being a Task (not Init.Task) enforces that the program cannot itself
attain new permissions, to for example reach out to the internet.
A node program produced by ExtraChecksRunnerNode.program
The "starting up" part of a program definition for assembling yourself.
Notice how initWith being a Task (not Init.Task) enforces that the program cannot itself
attain new permissions, to for example reach out to the internet.
The "react to an incoming event" part of a program definition for assembling yourself
The "listen to incoming events" part of a program definition for assembling yourself
Msg of a ExtraChecksRunnerNode.program
Model of a ExtraChecksRunnerNode.program