Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rewrite bin/init_exercise.py in Rust (#660)
* init_exercise: Generated the crate with 'cargo new' * init_exercise: Added command-line arguments via clap * init_exercise: Added configure command * init_exercise: Replaced the dont-update-config flag with the no-configure flag * init_exercise: Added init_app and process_matches functions * init_exercise: Added cmd module * init_exercise: Added process_matches to the generate module * init_exercise: Added exercise template generation * init_exercise: Added test suite and example.rs generation * init_exercise: Added get_canonical_data function * init_exercise: Added generate_standard_exercise_template function * init_exercise: Renamed generate_standard_exercise_template to generate_default_meta * init_exercise: Added update_cargo_toml function * init_exercise: Added prepend text to the test suite * init_exercise: Added generation of the property functions to the test suite * init_exercise: Applied suggestions from clippy * init_exercise: Added test suite functions generation * init_exercise: Added generate_readme function * init_exercise: Configured std::process::Command calls to wait until the process is finished running * init_exercise: Renamed 'init_exercise' crate to 'exercise' crate * exercise: Added shell script for building exercise crate * exercise: Updated build_exercise_crate.sh script to look for Windows builds * exercise: Removed redundant echos from build_exercise_crate.sh script * exercise: Removed run_configure argument from the generate_exercise function * exercise: Added configure_exercise call to the generate subcommand * exercise: Added utils module * exercise: Implemented the user configuration reading for the configure subcommand * exercise: Implemented the writing of the updated configuration to the config.json * exercise: Added run_configlate_command to the utils module * exercise: Replaced the configlet call code with the run_configlet_command function call * exercise: Added configlet fmt call to the configure_exercise funtion * exercise: Replace 'null' with 'hello-world' as default unlocked_by field value * exercise: Added configure_exercise call for the configure subcommand * exercise: Fixed typo: 'run_configlate_command' -> 'run_configlet_command' * exercise: configure subcommand now updates existing exercise config * exercise: configure subcommand now allows to move the existing exercise config depending on the chosen difficulty * exercise: Replaced the 'None' with 'hello-world' in the unlocked_by field input message * exercise: Moved the processing of ArgMatches to the main module for the generate subcommand * exercise: Replaced &Vec<Value> argument type with &[Value] * exercise: Replaced the 'no-configure' flag with the 'configure' flag for the generate and update subcommands * exercise: Added update_exercise call to the main module * exercise: Added check if exercise exists for the update subcommand * exercise: Moved get_canonical_data function to the utils module * exercise: Added get_tests_content function to the utils module * exercise: Added formatting functions for the 'property' and 'description' fields of the exercise * exercise: Implemented apply_diffs function for the update subcommand * exercise: Replaced apply_diffs function get_diffs function * exercise: Implemented the update of the tests file * exercise: Added use_maplit flag for the update subcommand * README: Replaced the 'init_exercise.py' script description with the 'exercise' crate description * README: Fixed typo - realease -> release * build_exercise_crate: Fixed the Windows release path check * exercise: Removed the authors field from the Cargo.toml and the '--help' output * exercise: Added space to the user difficulty input prompt * exercise: Added the newline at the end of the default generated '.meta/description.md' * exercise: Moved exercise_exists function to the utils module * exercise: Replaced the panic in the exercise exists checks with println and return * exercise: Made the [utility] link to point at the exercise crate url on the Github in the test suite template * exercise: Removed the blank line in the generated test case if no comments are present * exercise: 'update' subcommand now updates the version of the exercise in the Cargo.toml file * exercise: Moved the update_cargo_toml_version function to the utils module * exercise: Made 'configure' subcommand to retain the existing values as default values, if an exercise exists in config.json * exercise: Made 'configure' subcommand accept difficulties equal to or greater than the exercise which unlocks the configured exercise * exercise: Added an option to restart the positioning binary search * exercise: Moved the crate into the 'util' directory * travis: Added a script to check if the 'exercise' crate compiles if it was modified * check-exercise-crate: Replaced the 'cargo build --release' command with the 'cargo check' command * exercise: Replaced the locating of the 'rustfmt' utility via 'which' command with PATH variable parsing * exercise: Simplified the exercise_exists function * exercise: Fixed typo in the 'exercise does not exist' message * exercise: Specified the exercise difficulty prompt * exercise: Specified that the new exercise is generated via 'exercise' utility * exercise: Fixed comment typo * exercise: Inlined the urls in the generated tests suite template * exercise: Replaced the get_track_root function with lazy_static TRACK_ROOT value * README: Updated the 'exercise' crate section to mention the openssl dependency * exercise: Updated the crate's version to '1.0.0' * init_exercise.py: Removed the script from the track * Revert "init_exercise.py: Removed the script from the track" This reverts commit d8d464b. That commit caused a merge conflict. * fix readme possessive typo
- Loading branch information