From 191c76f148ffb491e7157ae5dfd5085c4448c1fa Mon Sep 17 00:00:00 2001 From: Veikka Tuominen Date: Sat, 11 Sep 2021 10:41:55 +0300 Subject: [PATCH] CI: fix fmt step missing --check flag --- .github/workflows/ci.yml | 2 +- src/Compilation.zig | 2 +- src/LangOpts.zig | 18 +++++++----------- src/Parser.zig | 2 +- 4 files changed, 10 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a100463c..b7ea414e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,7 +26,7 @@ jobs: run: zig build - name: Fmt - run: zig fmt . + run: zig fmt . --check - name: Run Tests run: zig build test diff --git a/src/Compilation.zig b/src/Compilation.zig index ad3374e3..b3906723 100644 --- a/src/Compilation.zig +++ b/src/Compilation.zig @@ -150,7 +150,7 @@ pub fn defineSystemIncludes(comp: *Compilation) !void { defer base_dir.close(); base_dir.access("include/stddef.h", .{}) catch continue; - const path = try std.fs.path.join(comp.gpa, &.{dirname, "include"}); + const path = try std.fs.path.join(comp.gpa, &.{ dirname, "include" }); comp.builtin_header_path = path; try comp.system_include_dirs.append(path); break; diff --git a/src/LangOpts.zig b/src/LangOpts.zig index cfd31157..802a3611 100644 --- a/src/LangOpts.zig +++ b/src/LangOpts.zig @@ -31,17 +31,13 @@ const Standard = enum { gnu2x, const NameMap = std.ComptimeStringMap(Standard, .{ - .{ "c89", .c89 }, .{ "c90", .c89 }, .{ "iso9899:1990", .c89 }, - .{ "iso9899:199409", .iso9899}, - .{ "gnu89", .gnu89 }, .{ "gnu90", .gnu89 }, - .{ "c99", .c99 }, .{ "iso9899:1999", .c99 }, - .{ "gnu99", .gnu99 }, - .{ "c11", .c11 }, .{ "iso9899:2011", .c11 }, - .{ "gnu11", .gnu11 }, - .{ "c17", .c17 }, .{ "iso9899:2017", .c17 }, .{ "c18", .c17 }, .{ "iso9899:2018", .c17 }, - .{ "gnu17", .gnu17 }, .{ "gnu18", .gnu17 }, - .{ "c2x", .c2x }, - .{ "gnu2x", .gnu2x }, + .{ "c89", .c89 }, .{ "c90", .c89 }, .{ "iso9899:1990", .c89 }, + .{ "iso9899:199409", .iso9899 }, .{ "gnu89", .gnu89 }, .{ "gnu90", .gnu89 }, + .{ "c99", .c99 }, .{ "iso9899:1999", .c99 }, .{ "gnu99", .gnu99 }, + .{ "c11", .c11 }, .{ "iso9899:2011", .c11 }, .{ "gnu11", .gnu11 }, + .{ "c17", .c17 }, .{ "iso9899:2017", .c17 }, .{ "c18", .c17 }, + .{ "iso9899:2018", .c17 }, .{ "gnu17", .gnu17 }, .{ "gnu18", .gnu17 }, + .{ "c2x", .c2x }, .{ "gnu2x", .gnu2x }, }); pub fn atLeast(self: Standard, other: Standard) bool { diff --git a/src/Parser.zig b/src/Parser.zig index 1abb8f9b..2e049a04 100644 --- a/src/Parser.zig +++ b/src/Parser.zig @@ -4525,7 +4525,7 @@ fn castInt(p: *Parser, val: u64, specs: []const Type.Specifier) Error!Result { } /// Run a parser function but do not evaluate the result -fn parseNoEval(p: *Parser, func: fn(*Parser) Error!Result) Error!Result { +fn parseNoEval(p: *Parser, func: fn (*Parser) Error!Result) Error!Result { const no_eval = p.no_eval; defer p.no_eval = no_eval; p.no_eval = true;