From 1deaab2ad75f6a7a6703eac25b8022fbc35b03d6 Mon Sep 17 00:00:00 2001 From: Sam Tebbs Date: Sun, 6 Oct 2019 19:03:02 +0100 Subject: [PATCH] Add formatting check to CI --- .github/workflows/main.yml | 2 ++ src/kernel/serial.zig | 10 +++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 56e092f..272aef6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -29,3 +29,5 @@ jobs: sudo apt-get install qemu qemu-system --fix-missing - name: Run runtime tests run: zig*/zig build test -Drt-test=true ${{ matrix.build_mode }} + - name: Check formatting + run: zig*/zig fmt --check src diff --git a/src/kernel/serial.zig b/src/kernel/serial.zig index 1dd5a1b..042e5e7 100644 --- a/src/kernel/serial.zig +++ b/src/kernel/serial.zig @@ -13,15 +13,13 @@ const PARITY_BIT = false; pub const DEFAULT_BAUDRATE = 38400; -const SerialError = error { - InvalidBaud -}; +const SerialError = error{InvalidBaud}; pub const Port = enum(u16) { COM1 = 0x3F8, COM2 = 0x2F8, COM3 = 0x3E8, - COM4 = 0x2E8 + COM4 = 0x2E8, }; // Compute a value that encodes the serial properties @@ -69,7 +67,9 @@ pub fn init(baud: u32, port: Port) SerialError!void { } pub fn write(char: u8, port: Port) void { - while (!transmitIsEmpty(port)) { arch.halt(); } + while (!transmitIsEmpty(port)) { + arch.halt(); + } arch.outb(@enumToInt(port), char); }