diff options
| author | Chris Boesch <chrboesch@noreply.codeberg.org> | 2026-03-20 19:08:46 +0100 |
|---|---|---|
| committer | Chris Boesch <chrboesch@noreply.codeberg.org> | 2026-03-20 19:08:46 +0100 |
| commit | 95ad73013ada66c63652716fb83ab943e8da8b6c (patch) | |
| tree | ec72975e7798f1e99b680f49fa9a16729e4b44d7 /build.zig | |
| parent | e6d93d731a6d3b3366e6cb80df3b1a4cf22a81f3 (diff) | |
| parent | 2b5a603c433fe2a85cf70c0a95ed6764cda49702 (diff) | |
Merge pull request 'Added field .skip_hint to show information on why a file has been' (#375) from cor-draconia/exercises:skip_hints into main
Reviewed-on: https://codeberg.org/ziglings/exercises/pulls/375
Diffstat (limited to 'build.zig')
| -rw-r--r-- | build.zig | 20 |
1 files changed, 18 insertions, 2 deletions
@@ -72,6 +72,9 @@ pub const Exercise = struct { /// This exercise is not supported by the current Zig compiler. skip: bool = false, + /// Hint to the user, why this has been skipped + skip_hint: ?[]const u8 = null, + /// Returns the name of the main file with .zig stripped. pub fn name(self: Exercise) []const u8 { return std.fs.path.stem(self.main_file); @@ -347,8 +350,12 @@ const ZiglingStep = struct { const self: *ZiglingStep = @alignCast(@fieldParentPtr("step", step)); if (self.exercise.skip) { - print("Skipping {s}\n\n", .{self.exercise.main_file}); + print("Skipping {s}", .{self.exercise.main_file}); + + if (self.exercise.skip_hint) |hint| + print("\n{s}Reason: {s}{s}\n", .{ bold_text, hint, reset_text }); + print( "\n\n", .{}); return; } @@ -1038,7 +1045,8 @@ const exercises = [_]Exercise{ .{ .main_file = "074_comptime9.zig", .output = "My llama value is 2.", - .skip = true, + .skip = false, + .skip_hint = "This is actually correct as it is. :-)" }, .{ .main_file = "075_quiz8.zig", @@ -1089,41 +1097,49 @@ const exercises = [_]Exercise{ .output = "foo() A", .hint = "Read the facts. Use the facts.", .skip = true, + .skip_hint = "async has not been implemented in the current compiler version.", }, .{ .main_file = "085_async2.zig", .output = "Hello async!", .skip = true, + .skip_hint = "async has not been implemented in the current compiler version.", }, .{ .main_file = "086_async3.zig", .output = "5 4 3 2 1", .skip = true, + .skip_hint = "async has not been implemented in the current compiler version.", }, .{ .main_file = "087_async4.zig", .output = "1 2 3 4 5", .skip = true, + .skip_hint = "async has not been implemented in the current compiler version.", }, .{ .main_file = "088_async5.zig", .output = "Example Title.", .skip = true, + .skip_hint = "async has not been implemented in the current compiler version.", }, .{ .main_file = "089_async6.zig", .output = ".com: Example Title, .org: Example Title.", .skip = true, + .skip_hint = "async has not been implemented in the current compiler version.", }, .{ .main_file = "090_async7.zig", .output = "beef? BEEF!", .skip = true, + .skip_hint = "async has not been implemented in the current compiler version.", }, .{ .main_file = "091_async8.zig", .output = "ABCDEF", .skip = true, + .skip_hint = "async has not been implemented in the current compiler version.", }, .{ |
