Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update exercise generator tooling #382

Open
BNAndras opened this issue Oct 26, 2023 · 5 comments
Open

Update exercise generator tooling #382

BNAndras opened this issue Oct 26, 2023 · 5 comments

Comments

@BNAndras
Copy link
Member

./bin/generate_practice_exercise pop-count
Fetching latest version of configlet...
Fetching configlet...
Downloaded configlet 4.0.0-beta.16 to ./bin/configlet
Adding instructions and configuration files...
sed: 1: "config.json.tmp": command c expects \ followed by text

The offending line is sed -i 's/"average_run_time": \([[:digit:]]\+\)$/"average_run_time": \1.0/' config.json.tmp. Per #306, average_run_time should be an integer in the first place so we don't need to work around jq.

@BNAndras
Copy link
Member Author

After I removed the sed line, I received a subsequent error while compiling gleam_stdlib on gleam 0.31.0.

Downloading packages
 Downloaded 4 packages in 0.06s
  Compiling thoas
===> Analyzing applications...
===> Compiling thoas
  Compiling gleam_stdlib
error: Syntax error
   ┌─ /Volumes/SSD/Git/Exercism/Mine/gleam/exercise_generator/build/packages/gleam_stdlib/src/gleam/bit_string.gleam:11:1
   │
11 │ if erlang {
   │ ^^ I was not expecting this.

Expected one of: 
An import, const, type, if block, or function.

I was able to remedy this by updating the dependencies inside the exercise_generator's gleam.toml file to their latest versions. Then the script ran through the end and generate the files I expected.

@BNAndras
Copy link
Member Author

The exercise generator generates Gleam files that don't pass the gleam format check in the CI. It'd be a good idea to have the generator kick out formatted code for the test suite and the stub file.

@BNAndras BNAndras changed the title Keep average_run_time an integer in ./bin/generate_practice_exercise Update exercise generator tooling Oct 29, 2023
@jiegillet
Copy link
Contributor

I was the one who made the generator and added that line about the average run_time. The required format used to be the opposite of what it is now, it used to require a float, and it was so annoying :D

Also, calling the generator from bin/generate_practice_exercise does format the output.

It's more than probable that the dependencies need to be updated though.

@BNAndras
Copy link
Member Author

Thanks, I'll take another look since that script didn't seem to format the files when I ported pop-count.

@ErikSchierboom
Copy link
Member

The required format used to be the opposite of what it is now, it used to require a float, and it was so annoying :D

It was, which is why I changed it :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants