summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2021-01-08feat(cli): Improve the list command with options, and then someAbdou Seck
1. `rustlings list` should now display more than just the exercise names. Information such as file paths and exercises statuses should be displayed. The `--paths` option limits the displayed fields to only the path names; while the `--names` option limits the displayed fields to only exercise names. You can also control which exercises are displayed, by using the `--filter` option, or the `--solved` or `--unsolved` flags. Some use cases: - Fetching pending exercise files with the keyword "conversion" to pass to my editor: ```sh vim $(rustlings list --filter "conversion" --paths --unsolved) ``` - Fetching exercise names with keyword "conversion" to pass to `rustlings run`: ```sh for exercise in $(rustlings list --filter "conversion" --names) do rustlings run ${exercise} done ``` 2. This should also fix #465, and will likely fix #585, as well. That bug mentioned in those issues has to do with the way the `watch` command handler fetches the pending exercises. Going forward, the least recently updated exercises along with all the other exercises in a pending state are fetched.
2021-01-08Add looks_done method to Exercise to expose a resolution stateAbdou Seck
2020-12-29release: 4.3.0mokou
2020-11-11feat: Crab? (#586)Brock
Crab?
2020-11-10feat: add "rustlings list" commandCaleb Webber
2020-11-05fix: log error output when inotify limit is exceededCaleb Webber
closes #472
2020-10-30fix: more unique temp_fileRoberto Vidal
2020-09-27chore: fixed test nameAlexx Roche
2020-08-10chore: Run cargo fmtÉtienne Barrié
2020-07-23feat(cli): Added 'cls' command to 'watch' mode (#474)Adi Vaknin
2020-07-08feat: Remind the user of the hint option (#425)Alexx Roche
Suggestion from AbdouSeck https://github.com/rust-lang/rustlings/issues/424#issuecomment-639870331 for when the student's code has errors.
2020-06-14chore: Move from master branch to main branchmokou
2020-06-04feat: Add a --nocapture option to display test harnesses' outputsAbdou Seck
This new feature can be accessed by invoking rustlings with --nocapture. Both unit and integration tests added. closes #262 BREAKING CHANGES: The following function take a new boolean argument: * `run` * `verify` * `test` * `compile_and_test`
2020-06-04Collapse nested if statementsAbdou Seck
2020-06-03Use .to_string rather than format macroAbdou Seck
2020-04-11fix(run): compile clippy exercise filesRohan Jain
Additionally to running clippy, also compile the exercise file so that `rustling run clippy1` works after a successful completion of the exercise. closes #291 Signed-off-by: Rohan Jain <crodjer@gmail.com>
2020-04-06feature: makes "compile" exercise print output, resolves #270Roberto Vidal
When running "compile"-mode exercises in interactive `verify` mode, we print their output when we prompt the learner if they want to continue. This improves the "experimentation" experience, since trying different things does produce a visible change.
2020-02-26feat: Add clippy lintsMario Reder
- adds a new 'clippy' category for exercises - clippy exercises should throw no warnings - install script now also installs clippy is related to https://github.com/rust-lang/rust-clippy/issues/2604
2020-02-20refactor: exercise evaluationRoberto Vidal
Exercise evaluation (compilation + execution) now uses Results Success/failure messages are standardized
2019-12-26feat: Show a completion message when watchingKate Hart
The completion message is shown only once all exercises succeed and are not annotated with "I AM NOT DONE." The watch command will also exit closes #251
2019-11-18feat(watch): show hint while watchingvyaslav
2019-11-12fix(run): makes `run` never promptRoberto Vidal
`watch` and `verify` do prompt the user to actively move to the next exercise. This change fixes `run` to never prompt. Previously it was inconsistent between "test" and "compile" exercises. BREAKING CHANGE: we again change the behavior of the `run` command
2019-11-11feat(cli): check for rustc before doing anythingRoberto Vidal
Addresses #190.
2019-11-11Address feedbackmarisa
2019-11-11fix testsmarisa
2019-11-11Merge branch 'master' into refactor-hintsmarisa
2019-11-11feat(hint): Add test for hintmarisa
2019-11-11feat: Refactor hint systemmarisa
Hints are now accessible using the CLI subcommand `rustlings hint <exercise name`. BREAKING CHANGE: This fundamentally changes the way people interact with exercises.
2019-11-11feat: improve `watch` execution modeRoberto Vidal
The `watch` command now requires user action to move to the next exercise. BREAKING CHANGE: this changes the behavior of `watch`.
2019-11-11feat: Index exercises by namemarisa
BREAKING CHANGE: This changes the way you use `rustlings run` by now requiring an abridged form of the previous filename, e.g: `rustlings run exercises/if/if1.rs` becomes `rustlings run if1`
2019-11-09improvement(watch): clear screen before each `verify()`WofWca
Closes #146
2019-11-09watch: clears terminal before entering loopJubilee Young
If someone is sliding in and out of "watch" mode, it can make it hard to tell which error messages are still relevant. This patch resolves that by clearing the terminal entirely before entering watch's loop.
2019-10-21feat: Added exercise for struct update syntaxViacheslav Avramenko
2019-07-11Check if changed exercise file exists before calling verify.Fredrik Jambrén
2019-06-10chore: Remove missed highlighting char from Issue #133Dan Wilhelm
2019-06-05Remove highlighting and syntectliv
2019-05-22Cargo fmt the rustlings application codeEddy Petrisor
Signed-off-by: Eddy Petrisor <eddy.petrisor@gmail.com>
2019-05-07Revert --nocapture flagliv
This closes #149 and #152
2019-04-22add a slightly more helpful error messageliv
2019-04-22fix the --nocapture functionalityliv
2019-04-22damn itliv
2019-04-22use -- --nocapture when testingliv
2019-04-12Clean up test includes for File and PathChris Pearce
2019-04-12Remove unwrap on canonicalize resultChris Pearce
2019-04-12Extract exercise struct to encapsulate path logicChris Pearce
2019-04-07Auto merge of #140 - cjpearce:fix/test-race-condition, r=komaedabors
Fix intermittent test failure caused by race condition First public pull request 😬 There's an intermittent integration test failure when you use multiple test threads (at least for me on a mac). I narrowed it down to two tests each spawning a process using `Command` which then try to compile the same file at the same time. If the timing doesn't work out, they both try to compile, and then one process runs `clean` before the other can run the executable - causing a panic. ![Screenshot 2019-04-07 at 19 54 55](https://user-images.githubusercontent.com/3453268/55688324-20520980-596f-11e9-8474-5215d61a4387.png) You can prevent it from happening by running with a single thread (`cargo test -- --test-threads=1`), because the `Command` blocks. That's not a particularly good solution though because it's not something you can configure in `Cargo.toml`. I considered making the affected tests just run serially, but it occurred to me that this could also happen if someone accidentally runs rustlings in watch mode in two terminals without realising it. I wound't consider this that unlikely given it's a tool for learning. I fixed it by ensuring that the executables made from separate processes don't conflict by appending a process id to the output executable name. I also extracted the commands into a single file next to `clean` so that we don't have to repeat the generated file name everywhere and risk missing something.
2019-04-07Fix test failing due to panicChris Pearce
2019-04-07Add process id to temp file nameChris Pearce
2019-04-07Extract command builders into utilChris Pearce
2019-03-27fix watch command path executionliv