Skip to content

Commit f3a0594

Browse files
Format via purs-tidy (#42)
* Format code * Enforce formatting in CI * Add changelog entry
1 parent d650882 commit f3a0594

File tree

4 files changed

+17
-11
lines changed

4 files changed

+17
-11
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ jobs:
1515
- uses: purescript-contrib/setup-purescript@main
1616
with:
1717
purescript: "unstable"
18+
purs-tidy: "latest"
1819

1920
- uses: actions/setup-node@v3
2021
with:
@@ -33,3 +34,8 @@ jobs:
3334
run: |
3435
bower install
3536
npm run-script test --if-present
37+
38+
- name: Check formatting
39+
run: |
40+
purs-tidy check src test
41+

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Bugfixes:
1313
Other improvements:
1414
- Bumped CI's node version to `lts/*` (#41 by @JordanMartinez)
1515
- Updated CI `actions/checkout` and `actions/setup-nodee` to `v3` (#41 by @JordanMartinez)
16+
- Format codebase & enforce formatting in CI via purs-tidy (#42 by @JordanMartinez)
1617

1718
## [v9.0.0](https://github.com/purescript-node/purescript-node-child-process/releases/tag/v9.0.0) - 2022-04-29
1819

src/Node/ChildProcess.purs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ type ChildProcessRec =
8888
, pid :: Pid
8989
, connected :: Boolean
9090
, kill :: String -> Unit
91-
, send :: forall r. Fn2 { | r} Handle Boolean
91+
, send :: forall r. Fn2 { | r } Handle Boolean
9292
, disconnect :: Effect Unit
9393
}
9494

@@ -110,8 +110,8 @@ stderr = unsafeFromNullable (missingStream "stderr") <<< _.stderr <<< runChildPr
110110
missingStream :: String -> String
111111
missingStream str =
112112
"Node.ChildProcess: stream not available: " <> str <> "\nThis is probably "
113-
<> "because you passed something other than Pipe to the stdio option when "
114-
<> "you spawned it."
113+
<> "because you passed something other than Pipe to the stdio option when "
114+
<> "you spawned it."
115115

116116
foreign import unsafeFromNullable :: forall a. String -> Nullable a -> a
117117

@@ -491,7 +491,7 @@ data StdIOBehaviour
491491

492492
-- | Create pipes for each of the three standard IO streams.
493493
pipe :: Array (Maybe StdIOBehaviour)
494-
pipe = map Just [Pipe, Pipe, Pipe]
494+
pipe = map Just [ Pipe, Pipe, Pipe ]
495495

496496
-- | Share `stdin` with `stdin`, `stdout` with `stdout`,
497497
-- | and `stderr` with `stderr`.
@@ -506,8 +506,7 @@ foreign import process :: forall props. { | props }
506506

507507
-- | Ignore all streams.
508508
ignore :: Array (Maybe StdIOBehaviour)
509-
ignore = map Just [Ignore, Ignore, Ignore]
510-
509+
ignore = map Just [ Ignore, Ignore, Ignore ]
511510

512511
-- Helpers
513512

test/Main.purs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ main = do
2222
log "nonexistent executable: all good."
2323

2424
log "doesn't perform effects too early"
25-
spawn "ls" ["-la"] defaultSpawnOptions >>= \ls -> do
25+
spawn "ls" [ "-la" ] defaultSpawnOptions >>= \ls -> do
2626
let _ = kill SIGTERM ls
2727
onExit ls \exit ->
2828
case exit of
@@ -32,7 +32,7 @@ main = do
3232
log ("Bad exit: expected `Normally 0`, got: " <> show exit)
3333

3434
log "kills processes"
35-
spawn "ls" ["-la"] defaultSpawnOptions >>= \ls -> do
35+
spawn "ls" [ "-la" ] defaultSpawnOptions >>= \ls -> do
3636
_ <- kill SIGTERM ls
3737
onExit ls \exit ->
3838
case exit of
@@ -46,9 +46,9 @@ main = do
4646

4747
spawnLs :: Effect Unit
4848
spawnLs = do
49-
ls <- spawn "ls" ["-la"] defaultSpawnOptions
49+
ls <- spawn "ls" [ "-la" ] defaultSpawnOptions
5050
onExit ls \exit ->
51-
log $ "ls exited: " <> show exit
51+
log $ "ls exited: " <> show exit
5252
onData (stdout ls) (Buffer.toString UTF8 >=> log)
5353

5454
nonExistentExecutable :: Effect Unit -> Effect Unit
@@ -65,6 +65,6 @@ execLs = do
6565

6666
execSyncEcho :: String -> Effect Unit
6767
execSyncEcho str = do
68-
resBuf <- execSync "cat" (defaultExecSyncOptions {input = Just str})
68+
resBuf <- execSync "cat" (defaultExecSyncOptions { input = Just str })
6969
res <- Buffer.toString NE.UTF8 resBuf
7070
log res

0 commit comments

Comments
 (0)