aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/patches
diff options
context:
space:
mode:
authorManlio Perillo <manlio.perillo@gmail.com>2023-04-16 12:23:10 +0200
committerManlio Perillo <manlio.perillo@gmail.com>2023-04-18 18:16:19 +0200
commit6b17a188936d489e2777e541c84112b2609532d5 (patch)
tree99303fde89f0b921f44705433b7fc1a39d0b6fef /patches
parentb59bef29b9c74270539e2f775d2f0394ec435f2d (diff)
Ensure the exercises use the canonical format
Add the check-exercises.py tool in the new tools directory. It is used to check that the exercises are correctly formatted, printing on stderr the invalid ones and the diff in the unified format. Update the exercises that don't use the canonical zig fmt format. Update some patches that cause the generated zig file to be incorrectly formatted.
Diffstat (limited to 'patches')
-rw-r--r--patches/patches/024_errors4.patch2
-rw-r--r--patches/patches/059_integers.patch8
-rw-r--r--patches/patches/083_anonymous_lists.patch4
3 files changed, 7 insertions, 7 deletions
diff --git a/patches/patches/024_errors4.patch b/patches/patches/024_errors4.patch
index 5996a99..48e0821 100644
--- a/patches/patches/024_errors4.patch
+++ b/patches/patches/024_errors4.patch
@@ -5,6 +5,6 @@
> if (err == MyNumberError.TooSmall) {
> return 10;
> }
->
+>
> return err;
> };
diff --git a/patches/patches/059_integers.patch b/patches/patches/059_integers.patch
index 50a89a0..7075ebe 100644
--- a/patches/patches/059_integers.patch
+++ b/patches/patches/059_integers.patch
@@ -1,8 +1,8 @@
22,24c22,24
-< 0o131, // octal
+< 0o131, // octal
< 0b1101000, // binary
-< 0x66, // hex
+< 0x66, // hex
---
-> 0o132, // octal
+> 0o132, // octal
> 0b1101001, // binary
-> 0x67, // hex
+> 0x67, // hex
diff --git a/patches/patches/083_anonymous_lists.patch b/patches/patches/083_anonymous_lists.patch
index b981909..94b594b 100644
--- a/patches/patches/083_anonymous_lists.patch
+++ b/patches/patches/083_anonymous_lists.patch
@@ -1,4 +1,4 @@
23c23
-< const hello = .{'h', 'e', 'l', 'l', 'o'};
+< const hello = .{ 'h', 'e', 'l', 'l', 'o' };
---
-> const hello: [5]u8 = .{'h', 'e', 'l', 'l', 'o'};
+> const hello: [5]u8 = .{ 'h', 'e', 'l', 'l', 'o' };