Compare commits

...

2 Commits

Author SHA1 Message Date
Don Isaac
e0316675d9 Merge branch 'main' into don/ci/zlint 2025-03-13 13:27:59 -07:00
Don Isaac
43569304c8 ci: add zlint 2025-03-10 23:11:34 -07:00
5 changed files with 19 additions and 25 deletions

View File

@@ -20,3 +20,11 @@ jobs:
bun-version: ${{ env.BUN_VERSION }}
- name: Lint
run: bunx oxlint --config oxlint.json --quiet --format github
lint-zig:
name: "ZLint"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run ZLint
uses: DonIsaac/zlint-action@main

View File

@@ -1,9 +0,0 @@
pub const bindgen = true;
pub const main = @import("./bun.js/bindings/bindings-generator.zig").main;
pub export fn PLCrashReportHandler(_: ?*anyopaque) void {}
pub export fn mkdirp(_: ?*anyopaque) void {}
pub const build_options = @import("build_options");
pub const bun = @import("./BunObject.zig");
pub const JavaScriptCore = @import("./jsc.zig");
pub const C = @import("./c.zig");

View File

@@ -17740,9 +17740,9 @@ pub const AstBuilder = struct {
}
pub fn pushScope(p: *AstBuilder, kind: Scope.Kind) *js_ast.Scope {
try p.scopes.ensureUnusedCapacity(p.allocator, 1);
try p.current_scope.children.ensureUnusedCapacity(p.allocator, 1);
const scope = try p.allocator.create(Scope);
p.scopes.ensureUnusedCapacity(p.allocator, 1) orelse bun.outOfMemory();
p.current_scope.children.ensureUnusedCapacity(p.allocator, 1) orelse bun.outOfMemory();
const scope = p.allocator.create(Scope) orelse bun.outOfMemory();
scope.* = .{
.kind = kind,
.label_ref = null,

View File

@@ -669,19 +669,6 @@ pub const AST = struct {
pub const Tag = enum { cmd, assigns };
pub fn to_pipeline_item(this: CmdOrAssigns, alloc: Allocator) PipelineItem {
switch (this) {
.cmd => |cmd| {
const cmd_ptr = try alloc.create(Cmd);
cmd_ptr.* = cmd;
return .{ .cmd = cmd_ptr };
},
.assigns => |assigns| {
return .{ .assign = assigns };
},
}
}
pub fn to_expr(this: CmdOrAssigns, alloc: Allocator) !Expr {
switch (this) {
.cmd => |cmd| {

8
zlint.json Normal file
View File

@@ -0,0 +1,8 @@
{
"$schema": "https://raw.githubusercontent.com/DonIsaac/zlint/refs/tags/v0.7.1/zlint.schema.json",
"ignore": ["zig-out", "vendor", "test", "build", "packages"],
"rules": {
"no-unresolved": "error",
"homeless-try": "warn"
}
}