Run the zon format check with our zig fmt (#1175)

* Format all the zon assets to prepare for running the the format check with our zig fmt

* Update ci.yml

* Remove zon files from the old formatter

* Add a formatting violation to test the CI

* Undo the check
This commit is contained in:
IntegratedQuantum 2025-03-07 22:34:55 +01:00 committed by GitHub
parent 5a9e537ed4
commit b303244773
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
63 changed files with 131 additions and 181 deletions

View File

@ -27,3 +27,8 @@ jobs:
git diff --color=always;
exit 1;
fi
- run: |
if zig build fmt -- --zon *.zon assets/*.zon assets/*/*.zon assets/*/*/*.zon assets/*/*/*/*.zon assets/*/*/*/*/*.zon assets/*/*/*/*/*/*.zon assets/*/*/*/*/*/*/*.zon assets/*/*/*/*/*/*/*/*.zon assets/*/*/*/*/*/*/*/*/*.zon assets/*/*/*/*/*/*/*/*/*/*.zon | grep -q . ; then
git diff --color=always;
exit 1;
fi

View File

@ -7,8 +7,6 @@
.music = "cubyz:heart-of-the-beast",
.structures = .{
.{
.id = "cubyz:ground_patch",

View File

@ -9,6 +9,5 @@
.music = "cubyz:heart-of-the-beast",
.structures = .{
},
.structures = .{},
}

View File

@ -9,25 +9,25 @@
.stoneBlock = "cubyz:obsidian",
.stripes = .{
.{
.direction= .{4, 1, 3},
.block= "cubyz:magma",
.distance= 16,
.offset= 5,
.width= 2,
.direction = .{4, 1, 3},
.block = "cubyz:magma",
.distance = 16,
.offset = 5,
.width = 2,
},
.{
.direction= .{2, 2.5, 3},
.block= "cubyz:magma",
.distance= 14,
.offset= 6,
.width= 1,
.direction = .{2, 2.5, 3},
.block = "cubyz:magma",
.distance = 14,
.offset = 6,
.width = 1,
},
.{
.direction= .{3, 4, 2},
.block= "cubyz:magma",
.distance= 14,
.offset= 7,
.width= 1,
.direction = .{3, 4, 2},
.block = "cubyz:magma",
.distance = 14,
.offset = 7,
.width = 1,
},
},
.structures = .{

View File

@ -8,6 +8,5 @@
.caves = 1,
.music = "cubyz:heart-of-the-beast",
.structures = .{
},
.structures = .{},
}

View File

@ -1,8 +1,7 @@
.{
.properties = .{
},
.properties = .{},
.radius = 16,
.chance = 0
.chance = 0,
.minHeight = 2,
.maxHeight = 10,
.roughness = 1,

View File

@ -1,8 +1,7 @@
.{
.properties = .{
},
.properties = .{},
.radius = 16,
.chance = 0
.chance = 0,
.minHeight = 50,
.maxHeight = 80,
.roughness = 1,

View File

@ -1,6 +1,5 @@
.{
.properties = .{
},
.properties = .{},
.minHeight = 22,
.maxHeight = 40,
.minRadius = 256,

View File

@ -1,6 +1,5 @@
.{
.properties = .{
},
.properties = .{},
.minHeight = 20,
.maxHeight = 48,
.minRadius = 200,

View File

@ -1,6 +1,5 @@
.{
.properties = .{
},
.properties = .{},
.minHeight = 22,
.maxHeight = 40,
.minRadius = 64,

View File

@ -1,7 +1,6 @@
.{
.chance = 0,
.properties = .{
},
.properties = .{},
.radius = 32,
.minHeight = 22,
.maxHeight = 40,

View File

@ -1,6 +1,5 @@
.{
.properties = .{
},
.properties = .{},
.minHeight = 20,
.maxHeight = 24,
.minRadius = 200,

View File

@ -1,7 +1,6 @@
.{
.chance = 0.02,
.properties = .{
},
.properties = .{},
.minHeight = 22,
.maxHeight = 40,
@ -12,8 +11,7 @@
.validPlayerSpawn = false,
.ground_structure = .{
},
.ground_structure = .{},
.structures = .{
.{
.id = "cubyz:simple_tree",

View File

@ -1,6 +1,5 @@
.{
.properties = .{
},
.properties = .{},
.minHeight = 22,
.maxHeight = 40,
.minRadius = 256,

View File

@ -1,7 +1,6 @@
.{
.chance = 0.02,
.properties = .{
},
.properties = .{},
.minHeight = 22,
.maxHeight = 40,
@ -12,8 +11,7 @@
.validPlayerSpawn = false,
.ground_structure = .{
},
.ground_structure = .{},
.stoneBlock = "cubyz:chalk/white",
.structures = .{
.{

View File

@ -1,7 +1,5 @@
.{
.properties = .{
.dry
},
.properties = .{.dry},
.minHeight = 40,
.maxHeight = 44,
.minRadius = 256,

View File

@ -1,6 +1,5 @@
.{
.properties = .{
},
.properties = .{},
.chance = 0.04,
.minHeight = 20,
.maxHeight = 40,

View File

@ -21,7 +21,7 @@
},
.{
.direction = .{1, 1, 5},
.block= "cubyz:sandstone",
.block = "cubyz:sandstone",
.distance = 10,
.offset = 6,
.width = 1,

View File

@ -71,5 +71,4 @@
.chance = 8,
},
},
}

View File

@ -1,6 +1,5 @@
.{
.properties = .{
},
.properties = .{},
.chance = 0.01,
.minHeight = 22,
.maxHeight = 40,

View File

@ -1,7 +1,5 @@
.{
.properties = .{
.mountain
},
.properties = .{.mountain},
.radius = 320,
.minHeight = 128,
.maxHeight = 128,

View File

@ -1,7 +1,5 @@
.{
.properties = .{
.mountain
},
.properties = .{.mountain},
.radius = 60,
.minHeight = 864,
.maxHeight = 864,

View File

@ -1,7 +1,5 @@
.{
.properties = .{
.mountain
},
.properties = .{.mountain},
.radius = 280,
.minHeight = 256,
.maxHeight = 256,

View File

@ -1,7 +1,5 @@
.{
.properties = .{
.mountain
},
.properties = .{.mountain},
.radius = 240,
.minHeight = 384,
.maxHeight = 384,

View File

@ -1,7 +1,5 @@
.{
.properties = .{
.mountain
},
.properties = .{.mountain},
.radius = 200,
.minHeight = 480,
.maxHeight = 480,

View File

@ -1,7 +1,5 @@
.{
.properties = .{
.mountain
},
.properties = .{.mountain},
.radius = 160,
.minHeight = 576,
.maxHeight = 576,

View File

@ -1,7 +1,5 @@
.{
.properties = .{
.mountain
},
.properties = .{.mountain},
.radius = 120,
.minHeight = 672,
.maxHeight = 672,

View File

@ -1,7 +1,5 @@
.{
.properties = .{
.mountain
},
.properties = .{.mountain},
.radius = 90,
.minHeight = 768,
.maxHeight = 768,

View File

@ -1,5 +1,5 @@
.{
.chance= 0,
.chance = 0,
.properties = .{
.wet,
},

View File

@ -1,7 +1,5 @@
.{
.properties = .{
.mountain
},
.properties = .{.mountain},
.radius = 320,
.minHeight = 128,
.maxHeight = 128,

View File

@ -1,7 +1,5 @@
.{
.properties = .{
.mountain
},
.properties = .{.mountain},
.radius = 40,
.minHeight = 600,
.maxHeight = 600,

View File

@ -1,7 +1,5 @@
.{
.properties = .{
.mountain
},
.properties = .{.mountain},
.radius = 260,
.minHeight = 256,
.maxHeight = 256,

View File

@ -1,7 +1,5 @@
.{
.properties = .{
.mountain
},
.properties = .{.mountain},
.radius = 220,
.minHeight = 384,
.maxHeight = 384,

View File

@ -1,7 +1,5 @@
.{
.properties = .{
.mountain
},
.properties = .{.mountain},
.radius = 180,
.minHeight = 480,
.maxHeight = 480,

View File

@ -1,7 +1,5 @@
.{
.properties = .{
.mountain
},
.properties = .{.mountain},
.radius = 140,
.minHeight = 576,
.maxHeight = 576,

View File

@ -1,7 +1,5 @@
.{
.properties = .{
.mountain
},
.properties = .{.mountain},
.radius = 100,
.minHeight = 672,
.maxHeight = 672,

View File

@ -1,7 +1,5 @@
.{
.properties = .{
.mountain
},
.properties = .{.mountain},
.radius = 80,
.minHeight = 640,
.maxHeight = 640,

View File

@ -8,7 +8,7 @@
.rotation = .no_rotation,
.degradable = true,
.hasItem = false,
.collide= false,
.collide = false,
.drops = .{},
.model = .none,

View File

@ -2,7 +2,7 @@
.tags = .{.wood},
.blockHealth = 4,
.drops = .{
.{ .items = .{.auto} },
.{.items = .{.auto}},
},
.absorbedLight = 0x202830,
.rotation = .branch,

View File

@ -2,7 +2,7 @@
.tags = .{.wood},
.blockHealth = 4,
.drops = .{
.{ .items = .{.auto} },
.{.items = .{.auto}},
},
.absorbedLight = 0x202830,
.rotation = .branch,

View File

@ -7,7 +7,7 @@
.solid = false,
.viewThrough = true,
.absorbedLight = 0x010101,
.collide= false,
.collide = false,
.rotation = .torch,
.model = .{
.base = "cubyz:bolete/floor",

View File

@ -2,7 +2,7 @@
.tags = .{.wood},
.blockHealth = 2.5,
.drops = .{
.{ .items = .{.auto} },
.{.items = .{.auto}},
},
.absorbedLight = 0x202830,
.rotation = .branch,

View File

@ -11,7 +11,7 @@
.model = "cubyz:plane",
.rotation = .carpet,
.texture = "cubyz:daisies",
.item= .{
.item = .{
.texture = "daisies.png",
},
.lodReplacement = "cubyz:air",

View File

@ -11,7 +11,7 @@
.model = "cubyz:plane",
.rotation = .carpet,
.texture = "cubyz:dandelions",
.item= .{
.item = .{
.texture = "dandelions.png",
},
.lodReplacement = "cubyz:air",

View File

@ -8,7 +8,7 @@
.viewThrough = true,
.absorbedLight = 0x010101,
.emittedLight = 0x392862,
.collide= false,
.collide = false,
.rotation = .torch,
.model = .{
.base = "cubyz:glimmergill/floor",

View File

@ -6,7 +6,7 @@
.degradable = true,
.transparent = true,
.hasBackFace = true,
.collide= false,
.collide = false,
.absorbedLight = 0x0084ff,
.emittedLight = 0xff7b00,
.model = "cubyz:cube",

View File

@ -4,7 +4,7 @@
.drops = .{
.{.items = .{.auto}},
},
.rotation= .stairs,
.model= "cubyz:cube",
.texture= "cubyz:limestone_bricks",
.rotation = .stairs,
.model = "cubyz:cube",
.texture = "cubyz:limestone_bricks",
}

View File

@ -4,7 +4,7 @@
.drops = .{
.{.items = .{.auto}},
},
.rotation= .stairs,
.model= "cubyz:cube",
.texture= "cubyz:limestone_tiles",
.rotation = .stairs,
.model = "cubyz:cube",
.texture = "cubyz:limestone_tiles",
}

View File

@ -2,7 +2,7 @@
.tags = .{.wood},
.blockHealth = 4,
.drops = .{
.{ .items = .{.auto} },
.{.items = .{.auto}},
},
.absorbedLight = 0x202830,
.rotation = .branch,

View File

@ -24,7 +24,7 @@
},
},
.allowOres = true,
.rotation= .stairs,
.model= "cubyz:cube",
.texture= "cubyz:marble",
.rotation = .stairs,
.model = "cubyz:cube",
.texture = "cubyz:marble",
}

View File

@ -4,7 +4,7 @@
.drops = .{
.{.items = .{.auto}},
},
.rotation= .stairs,
.model= "cubyz:cube",
.texture= "cubyz:marble_bricks",
.rotation = .stairs,
.model = "cubyz:cube",
.texture = "cubyz:marble_bricks",
}

View File

@ -4,7 +4,7 @@
.drops = .{
.{.items = .{.auto}},
},
.rotation= .stairs,
.model= "cubyz:cube",
.texture= "cubyz:marble_tile",
.rotation = .stairs,
.model = "cubyz:cube",
.texture = "cubyz:marble_tile",
}

View File

@ -2,7 +2,7 @@
.tags = .{.wood},
.blockHealth = 4,
.drops = .{
.{ .items = .{.auto} },
.{.items = .{.auto}},
},
.absorbedLight = 0x202830,
.rotation = .branch,

View File

@ -2,7 +2,7 @@
.tags = .{.wood},
.blockHealth = 4,
.drops = .{
.{ .items = .{.auto} },
.{.items = .{.auto}},
},
.absorbedLight = 0x202830,
.rotation = .branch,

View File

@ -11,7 +11,7 @@
.model = "cubyz:plane",
.rotation = .carpet,
.texture = "cubyz:red_leaf_pile",
.item= .{
.item = .{
.texture = "red_leaf_pile.png",
},
.lodReplacement = "cubyz:air",

View File

@ -7,7 +7,7 @@
.solid = false,
.viewThrough = true,
.absorbedLight = 0x010101,
.collide= false,
.collide = false,
.rotation = .torch,
.model = .{
.base = "cubyz:toadstool/floor",

View File

@ -8,7 +8,7 @@
.emittedLight = 0xa58d73,
.viewThrough = true,
.absorbedLight = 0x010101,
.collide= false,
.collide = false,
.rotation = .torch,
.model = .{
.base = "cubyz:torch",

View File

@ -6,7 +6,7 @@
.degradable = true,
.transparent = true,
.hasBackFace = true,
.collide= false,
.collide = false,
.absorbedLight = 0x090501,
.model = "cubyz:cube",
.texture = "cubyz:water",

View File

@ -2,7 +2,7 @@
.tags = .{.wood},
.blockHealth = 4,
.drops = .{
.{ .items = .{.auto} },
.{.items = .{.auto}},
},
.absorbedLight = 0x202830,
.rotation = .branch,

View File

@ -11,7 +11,7 @@
.model = "cubyz:plane",
.rotation = .carpet,
.texture = "cubyz:yellow_leaf_pile",
.item= .{
.item = .{
.texture = "yellow_leaf_pile.png",
},
.lodReplacement = "cubyz:air",

View File

@ -111,4 +111,4 @@
.inputs = .{"cubyz:void_stone"},
.output = "2 cubyz:void_stone_wall",
},
},
}

View File

@ -78,7 +78,7 @@ fn checkDirectory(dir: std.fs.Dir) !void {
std.log.err("File name should end with .zig.zon so it gets syntax highlighting on github.", .{});
failed = true;
}
if(child.kind == .file and (std.mem.endsWith(u8, child.basename, ".zon") or std.mem.endsWith(u8, child.basename, ".vs") or std.mem.endsWith(u8, child.basename, ".fs") or std.mem.endsWith(u8, child.basename, ".glsl"))) {
if(child.kind == .file and (std.mem.endsWith(u8, child.basename, ".vs") or std.mem.endsWith(u8, child.basename, ".fs") or std.mem.endsWith(u8, child.basename, ".glsl"))) {
try checkFile(dir, child.path);
}
}
@ -94,7 +94,5 @@ pub fn main() !void {
dir = try std.fs.cwd().openDir("assets", .{.iterate = true});
try checkDirectory(dir);
try checkFile(std.fs.cwd(), "build.zig.zon");
if(failed) std.posix.exit(1);
}