Commit graph

18 commits

Author SHA1 Message Date
Ruud van Asseldonk
a34aec267b Autoformat Python sources, make Mypy happy
The module name and path hack throws off Mypy, in different ways
depending on how you run it (outside Nix shell, inside Nix develop
shell, or as part of the flake check ...). Let's just forward-declare
it and sidestep problems.

Maybe I should make this script the source of truth and generate the
Pygments grammar from it. We could do that later, for now this works.
2025-03-15 20:54:25 +01:00
Ruud van Asseldonk
bdbb82ccf1 Add reminder to integrate generate_keywords on CI
I should do it, and if I don't do it now then I probably will not do it
soon. On the other hand, no need to let the perfect be the enemy of the
good; calling the script manually is already much better than having to
update all the places manually. So let's merge it as it is.
2025-03-15 20:46:00 +01:00
Ruud van Asseldonk
789c89b520 Generate the Vim plugin from builtins
This corrects one bug in the plugin there that went unnoticed: the
'enumerate' builtin was not highlighted previously. So that's a win
for generating things!
2025-03-15 20:43:21 +01:00
Ruud van Asseldonk
5bcc7e74c7 Generate builtins list for the smith fuzzer
This moves one more place of duplication of builtins into
generate_keywords.py as a single source of truth, resolving
a to do in the smith fuzzer.

This does once more shuffle all of these around in the fuzzer, which
makes the existing fuzz corpus mostly meaningless. Fortunately, this
should be the last time that this happens: with the new approach we
can modify the builtins with minimal changes to the meaning of the
fuzz corpus, which is something that I wanted for a long time.
2025-03-15 19:43:13 +01:00
Ruud van Asseldonk
34e347a387 Generate fuzz dictionary from Pygments grammar
I regularly add new methods, and it's becoming tedious to have to
remember to update all the places that reference these, so let's
generate them and automate the process. For now, I'm choosing the
Pygments grammar as the source of truth, and the first target to
generate is the fuzz dictionary.
2025-03-03 22:14:27 +01:00
Ruud van Asseldonk
c8de775eaf Remove unused import from repo sync script 2025-03-02 20:53:12 +01:00
Ruud van Asseldonk
2dbd9ae3d8 Update seed_fuzz_corpus for new fuzzers
Well, "new", they have been there for a while, but apparently I forgot
to update this script.
2025-03-02 20:51:55 +01:00
Ruud van Asseldonk
d28eb1f90f Print which repo update_repos.py is mutating 2024-12-31 13:39:39 +01:00
Ruud van Asseldonk
503dfbfd85 Generate Zed's extension.toml too
I think this is the last place where I manually had to sync the version
number!
2024-12-08 16:03:05 +01:00
Ruud van Asseldonk
854ed62fe4 Enable exporting the Zed extension as well 2024-08-02 23:12:52 +02:00
Ruud van Asseldonk
ce38b059e0 Finish initial version of tree-sitter-rcl dumper
It can generate commits, it's fine for now.
2024-08-02 21:33:05 +02:00
Ruud van Asseldonk
b0edb62363 Begin working on repository export script
I want to make a Zed extension, and it looks like Zed does not support
Tree-sitter grammars that do not live at the repository root, so let's
just make a separate repository to dump a generated copy of the grammar
in. It will also make integration with other Tree-sitter consumers
easier.
2024-08-02 21:33:05 +02:00
Ruud van Asseldonk
ff501c2a09 Remove historical fuzz modes from corpus
I migrated my corpus locally by running the expand tool followed by a
cmin.
2024-04-27 14:11:03 +02:00
Ruud van Asseldonk
a42ca7ca8e Reformat Python code, silence Mypy error
The .to_bytes() method has a default value for length, but apparently
Mypy does not know that yet. Maybe it is running for an older Python
version.
2024-02-15 23:37:52 +01:00
Ruud van Asseldonk
9216b44900 Adjust the schema of the fuzzer, expand corpus
I accidentally reused the mode letter for typecheck and for toml export.
So now is maybe a good time to create a copy of every input, reorder the
modes, then minimize the corpus again.
2024-02-15 22:25:49 +01:00
Ruud van Asseldonk
041308291d Prepend fuzz header from seed_fuzz_corpus.py
Without this, the inputs are immediately discarded by the fuzzer -- so
it turns out this seeding was not doing anything all the time! When I
run it now, it crashes instantly with a SIGSGEV. It is not caught by
libfuzzer itself so I can't see which input is crashing, but I suspect
it's my stack overflow example. Let's handle that and see if I can still
make the fuzzer crash.
2023-12-17 22:38:52 +01:00
Ruud van Asseldonk
d068e20d77 Add a script to seed the fuzz corpus from goldens
The fuzzer is having a hard time discovering interesting inputs to
key_by. So far it discovered that it can do

    [true].key_by({}.key_by)

which works, because {}.key_by(true) does not fail because the input is
empty, so it returns and empty dict, and then the output is {{}: true}.
But the fuzzer has not yet discovered that key_by is supposed to receive
a lambda, and it's not producing any interesting groupings.

But we do have a corpus of goldens that covers these cases. They are not
as small as the fuzz inputs, but they might be a good starting point. So
let's add a script to seed the fuzz corpus. So far I'm still not
impressed, but maybe I am just impatient and I need to let the fuzzer
run a bit longer.
2023-12-01 01:07:44 +01:00
Ruud van Asseldonk
30931686f8 Add a script to migrate the fuzz corpus
This is only for temporary usage, but let's commit it to not lose it.
2023-09-23 22:26:21 +02:00