Skip to content

Commit a0a0bda

Browse files
ryuheechullpil
authored andcommitted
Fix format
also add Makefile to help/document: - check format - format
1 parent 67ce113 commit a0a0bda

File tree

3 files changed

+18
-12
lines changed

3 files changed

+18
-12
lines changed

Makefile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.PHONY: format-check
2+
format-check:
3+
gleam format --check src test
4+
5+
.PHONY: format
6+
format:
7+
gleam format src test

src/echo.gleam

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,13 @@ pub fn main() {
1414
|> result.unwrap(3000)
1515

1616
// Start the web server process
17-
assert Ok(_) = web.stack() |> elli.start(on_port: port)
17+
assert Ok(_) =
18+
web.stack()
19+
|> elli.start(on_port: port)
1820

19-
[
20-
"Started listening on localhost:",
21-
int.to_string(port),
22-
" ✨",
23-
] |> string.concat
24-
|> io.println
21+
["Started listening on localhost:", int.to_string(port), " ✨"]
22+
|> string.concat
23+
|> io.println
2524

2625
// Put the main process to sleep while the web server does its thing
2726
erlang.sleep_forever()

src/echo/web/logger.gleam

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ fn format_log_line(request: Request(a), response: Response(b)) -> String {
2323
pub fn middleware(service: Service(a, b)) -> Service(a, b) {
2424
fn(request) {
2525
service(request)
26-
|> function.tap(fn(response) {
27-
response
28-
|> format_log_line(request, _)
29-
|> io.println
30-
})
26+
|> function.tap(fn(response) {
27+
response
28+
|> format_log_line(request, _)
29+
|> io.println
30+
})
3131
}
3232
}

0 commit comments

Comments
 (0)