Skip to content

Commit 85ba827

Browse files
committed
Refactor: Integrate linting into CI and add make fix command
1 parent 3a5c64f commit 85ba827

3 files changed

Lines changed: 9 additions & 16 deletions

File tree

.github/workflows/CI.yml

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,6 @@ on:
1414
- '**.yml'
1515

1616
jobs:
17-
fmt:
18-
timeout-minutes: 10
19-
runs-on: ${{ matrix.os }}
20-
strategy:
21-
fail-fast: false
22-
matrix:
23-
os: [ubuntu-latest]
24-
steps:
25-
- uses: actions/checkout@v4
26-
- uses: mlugg/setup-zig@v2
27-
- name: Run linter
28-
run: |
29-
make lint
3017
test-vendor:
3118
timeout-minutes: 10
3219
runs-on: ${{ matrix.os }}
@@ -37,6 +24,10 @@ jobs:
3724
steps:
3825
- uses: actions/checkout@v4
3926
- uses: mlugg/setup-zig@v2
27+
- name: Run lint
28+
if: matrix.os == 'ubuntu-latest'
29+
run: |
30+
make lint
4031
- name: Run tests
4132
run: |
4233
make test run

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ run:
1414
zig build run-multi -freference-trace $(ARGS)
1515
zig build run-header -freference-trace $(ARGS)
1616

17+
fix:
18+
zig fmt .
19+
1720
lint:
1821
zig fmt --check .
1922

@@ -30,4 +33,4 @@ clean:
3033
serve:
3134
cd server && go run main.go
3235

33-
.PHONY: run lint test docs clean serve
36+
.PHONY: run fix lint test docs clean serve

libs/curl.zig

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,8 +202,7 @@ pub fn create(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std.bui
202202
lib.root_module.addCMacro("_FILE_OFFSET_BITS", "64");
203203

204204
const system_name = getCurlOS(b.allocator, target);
205-
const curl_os = std.fmt.allocPrint(b.allocator, "\"{s}\"", .{system_name}) catch "\"unknown-pc-unknown\"";
206-
205+
const curl_os = std.fmt.allocPrint(b.allocator, "\"{s}\"", .{system_name}) catch orelse unreachable;
207206
lib.root_module.addCMacro("CURL_OS", curl_os);
208207

209208
return lib;

0 commit comments

Comments
 (0)