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

Should we add standard scripts to /bin? #783

Closed
colinleach opened this issue Sep 11, 2024 · 10 comments
Closed

Should we add standard scripts to /bin? #783

colinleach opened this issue Sep 11, 2024 · 10 comments

Comments

@colinleach
Copy link
Contributor

From a PR that Erik just sent to the R track, I belatedly realized that new tracks get a bunch of useful scripts. These are in https://github.com/exercism/generic-track/tree/main/bin

  • add-practice-exercise
  • bootstrap
  • fetch-configlet
  • fetch-configlet.ps1
  • verify-exercises
  • verify-exercises-in-docker

Of these, Julia only has fetch-configlet.

My first impression is that at least add-practice-exercise and verify-exercises would be useful here, maybe the others.

Can anyone see a downside to this?

@depial
Copy link
Contributor

depial commented Sep 12, 2024

On a related note, I thought it would be nice if we could get configlet to generate a runtests.jl which is scaffolded in something like the following way (here for an exercise named practice-exercise):

using Test

include("practice-exercise.jl")

@testset verbose = true "tests" begin

    # insert all tests here

end

This might cut down on confusion about the new format versus the blank file which is presented now.

@colinleach
Copy link
Contributor Author

That looks simple and worthwhile. I'd support it.

Of course, a more thorough approach is to create generators to build the tests from problem-specifications. That has the advantage that tests can be kept up to date as canonical-data.json evolves, and the disadvantage that it's a LOT more work. As I discovered a few weeks ago, when I tried it.

@depial
Copy link
Contributor

depial commented Sep 12, 2024

That looks simple and worthwhile. I'd support it.

I've only briefly looked into it, but I'm still not exactly sure where I'd need to start. I initially thought the bin folder would have the appropriate files, but there's also the generators file which seems to have some relevant code.

@colinleach
Copy link
Contributor Author

I don't know details, but I think there was an attempt to add generators several years ago. It doesn't seem to have progressed very far.

@colinleach
Copy link
Contributor Author

I thought it would be nice if we could get configlet to generate a runtests.jl

Thinking about this some more, we probably can't mess with configlet, which is a complicated cross-track Go program. I guess options included writing a separate shell script and putting it in bin, or writing a Julia script and creating a scripts directory. Some tracks have a .templates directory for things they want to copy into new exercises: that could be an easy solution. I've done something similar on private forks, but I never pushed anything like this to an Exercism track repo.

@colinleach
Copy link
Contributor Author

I've not seen any pushback on the original question about adding scripts from generic-track. I'll wait till tomorrow or Saturday, then submit a PR.

A more clued-up maintainer might create a GitHub workflow to keep them synced automatically, but I confess I have no idea how to do that. I should probably learn, sometime.

@depial
Copy link
Contributor

depial commented Sep 13, 2024

Thinking about this some more, we probably can't mess with configlet, which is a complicated cross-track Go program.

Thanks for looking into that! I'm unfamiliar with the overarching program (and don't read Go), but the .templates idea sounds closest to what I was hoping was possible. Creating the scripts directory also sounds potentially interesting though.

I've not seen any pushback on the original question about adding scripts from generic-track. I'll wait till tomorrow or Saturday, then submit a PR.

Sounds good! I'll try to be around to review when that comes in.

@colinleach
Copy link
Contributor Author

Tangential comment: from the timing of this, you seem to be well to the east of me. I'm in Arizona, timezone UTC-7:00 all year (MST in US terminology).

@depial
Copy link
Contributor

depial commented Sep 13, 2024

I'm not too far east (Georgia EST). I just got started early today :)

@colinleach
Copy link
Contributor Author

Resolved with PR #785

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

2 participants