cli
cli copied to clipboard
[Feature Request] Check that I meant to submit a test file.
I sometimes accidently submit the test file rather than the code file. This is because I'm running this a lot
ruby something_test.rb
and then sometimes my fingers just automatically type the same filename for exercism submit
.
It would be nice that i I submit one file and it matches the test pattern, the CLI asks whether I meant to submit just the test file before creating the iteration.
This will rely on our getting the prepare
command sorted out so that we can get the test pattern for each of the languages that people are doing exercises for.
Definitely doable, but it will not be in the next few weeks, I think.
Hi, is there anything an exercism user who's interested in this feature could do to help out? I have no prior experience with Go but would like to help if at all possible.
@McEileen Thank you! Let me sit down and think through exactly what needs done, that way we could break it into smaller steps that could be tackled without having to invent the universe first! 🍰
Sounds good! I had imagined that a hypothetical feature could check if the user is submitting a test file by
iterating through a map that has the languages as keys and the associated test file prefix as value. So, for example, "ruby": "_test.rb"
and "java": "Test.java"
would be two key-value pairs in the map. If the prefix of the file the user is submitting matched the language's associated test file prefix, the user would view an error that said they were trying to submit a test file.
I realize I'm not familiar with the prepare
command or the overall codebase for the cli, so I'll sit tight for the time being.
I had imagined that a hypothetical feature could check if the user is submitting a test file by iterating through a map that has the languages as keys and the associated test file prefix as value.
In principle you're right, but we don't want to hard-code these values into the CLI, because then every time we add a new language (or change how a language is doing something) we'd have to release a new CLI, and then everyone who didn't upgrade wouldn't get the right values.
The prepare
command was never fleshed out. It's got a bunch of pieces to it (API, configuration, checking headers to make sure the prepare command gets called if some value indicates that it's outdated, ec), so I've kept puttin' off as they say.