Skip to content

Commit cadef44

Browse files
authored
ci: confirm code formatting matches the standard expectations about language (#6)
1 parent 1001053 commit cadef44

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-5
lines changed

.github/workflows/test.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ jobs:
1414
uses: DeterminateSystems/nix-installer-action@v17
1515
- name: Run tests
1616
run: |
17+
shopt -s globstar
18+
nix develop -c zig fmt --check ./src/**/*.zig
1719
nix develop -c zig build test -Dcoverage
1820
- name: Upload reports
1921
uses: codecov/codecov-action@v5.4.2

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog][changelog], and this project adheres
66
to [Semantic Versioning][semver].
77

8+
## [Unreleased]
9+
10+
### Maintenance
11+
12+
- Confirm code formatting matches the standard expectations about language.
13+
814
## [0.1.1] - 2025-05-03
915

1016
### Maintenance

src/main.zig

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ pub fn main() !void {
1919
.allocator = allocator,
2020
.argv = &[_][]const u8{ "open", url },
2121
}) catch {
22-
try std.io.getStdOut().writer().print("{s}\n", .{ url });
22+
try std.io.getStdOut().writer().print("{s}\n", .{url});
2323
};
2424
}
2525

@@ -29,7 +29,7 @@ fn origin(remotes: []const u8) ![]const u8 {
2929
const line = remote.next();
3030
if (line) |val| {
3131
if (std.mem.startsWith(u8, val, "origin") and std.mem.endsWith(u8, val, "(push)")) {
32-
return std.mem.trim(u8, val[7..val.len-6], " ");
32+
return std.mem.trim(u8, val[7 .. val.len - 6], " ");
3333
}
3434
} else {
3535
return error.GitOriginMissing;
@@ -51,10 +51,10 @@ test "origin ssh" {
5151

5252
fn repo(remote: []const u8) ![]const u8 {
5353
if (std.mem.startsWith(u8, remote, "https://github.com/")) {
54-
return remote[19..remote.len-4];
54+
return remote[19 .. remote.len - 4];
5555
}
5656
if (std.mem.startsWith(u8, remote, "git@github.com:")) {
57-
return remote[15..remote.len-4];
57+
return remote[15 .. remote.len - 4];
5858
}
5959
return error.GitProtocolMissing;
6060
}
@@ -75,7 +75,7 @@ fn coverage(allocator: std.mem.Allocator, project: []const u8) ![]const u8 {
7575
return std.fmt.allocPrint(
7676
allocator,
7777
"https://app.codecov.io/gh/{s}",
78-
.{ project },
78+
.{project},
7979
);
8080
}
8181

0 commit comments

Comments
 (0)