Skip to content

Commit e89b712

Browse files
authored
CI: run zig fmt (#1599)
* run zig fmt * CI: run zig fmt * ensure that .zon files use LF as their end of line sequence
1 parent 521acc1 commit e89b712

File tree

5 files changed

+9
-4
lines changed

5 files changed

+9
-4
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
* text=auto
22
*.zig text=auto eol=lf
3+
*.zon text=auto eol=lf

.github/workflows/main.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ jobs:
3636

3737
- run: zig env
3838

39+
- name: Run zig fmt
40+
run: zig fmt --check .
41+
3942
- name: Build
4043
run: zig build
4144

src/features/semantic_tokens.zig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ const Builder = struct {
128128

129129
fn addDirect(self: *Builder, param_token_type: TokenType, token_modifiers: TokenModifiers, loc: offsets.Loc) error{OutOfMemory}!void {
130130
std.debug.assert(loc.start <= loc.end);
131-
std.debug.assert(self.previous_source_index <= self.source_index);
131+
std.debug.assert(self.previous_source_index <= self.source_index);
132132
if (loc.start < self.previous_source_index) return;
133133
if (loc.start < self.source_index) return;
134134
var token_type = param_token_type;
@@ -701,7 +701,7 @@ fn writeNodeTokens(builder: *Builder, node: Ast.Node.Index) error{OutOfMemory}!v
701701
.@"asm",
702702
.asm_simple,
703703
=> {
704-
const asm_node: Ast.full.Asm = ast.fullAsm(tree,node).?;
704+
const asm_node: Ast.full.Asm = ast.fullAsm(tree, node).?;
705705

706706
try writeToken(builder, main_token, .keyword);
707707
try writeToken(builder, asm_node.volatile_token, .keyword);

tests/lsp_features/folding_range.zig

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,8 @@ test "foldingRange - weird code" {
264264
try testFoldingRange(
265265
\\if ( {fn foo()}
266266
\\
267-
, &.{},
267+
,
268+
&.{},
268269
);
269270
}
270271

tests/lsp_features/semantic_tokens.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1440,7 +1440,7 @@ test "semantic tokens - weird code" {
14401440
.{ "=", .operator, .{} },
14411441
.{ "asm", .keyword, .{} },
14421442
.{ "fn", .keyword, .{} },
1443-
.{ "bar", .function, .{.declaration = true} },
1443+
.{ "bar", .function, .{ .declaration = true } },
14441444
});
14451445
}
14461446

0 commit comments

Comments
 (0)