-
-
Notifications
You must be signed in to change notification settings - Fork 145
Add ListOps exercise #605
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
Add ListOps exercise #605
Conversation
d811055 to
f1a49af
Compare
|
Thanks for your contribution! I'm not a maintainer, but have opinions on some of your questions.
Let students figure that out to add to the difficulty. Or reduce difficulty by providing it. Both options are OK.
Please don't. They are synced to the problem specifications. If you would like to add PHP specific instructions (like the tasks you suggested), you can add
I suggest to generally suppress warnings by adding
I would recommend doing so. Or better: Reformat
I see it as hard. The track has no (I haven't seen any, yet) |
cee862e to
c0b5270
Compare
|
Thank you for your feedback @mk-mxp !
Okay, I added it so it should be easier to learn things thanks to this exercise.
Okay, I did add a file to explain "callable". I don't intend on adding tasks for now at least.
I think you approach is right. I will let it for another Pull Request.
Okay, I put it at |
|
Just thinking @mk-mxp, maybe I can just remove the class thing and have the methods in the global scope, that would make the exercise way easier. Edit: I just removed the static. I saw that nealy all of the exercise have their functions embeded in a class. |
|
list-ops is the next week exercise, does anyone have time to review this ? I can merge it, but I would prefer a review before as this is the first time I contribute a full exercise. Once this is merged I will most likely address all the remaining exercises from 48in24 for the php track. |
|
@homersimpsons We will get that merged in time. I think I need too long to get #591 merged. Could you add I'll look at your code again this weekend. If I remember correctly there were no show stoppers in it. |
4b3f257 to
6768414
Compare
done |
ErikSchierboom
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work!
mk-mxp
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you do not want to change the exercise as suggested, I'm OK with merging it as is. Just tell me your choice.
Thanks for contributing!
| } | ||
|
|
||
| /** | ||
| * @testdox append entries to a list and return the new list -> empty lists |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I love this! It looks even better with a capital letter at the beginning of the sentence. And I suggest adding the UUID of the test case, like here:
| * @testdox append entries to a list and return the new list -> empty lists | |
| * @testdox Append entries to a list and return the new list -> empty lists | |
| * uuid: 485b9452-bf94-40f7-a3db-c3cf4850066a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just copy-pasted those from the JavaScipt track.
The @testdox matches the description in the tests.toml file, do you think I should still diverge from this description and use a capital letter ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The description in the problem spec is written to be used like sprintf('It %s', $description). We have no testing framework, that does so (like jest in JavaScript or TypeScript). That's why I think, we should adjust it to our needs. It looks a bit misplaced in the online editor when not Capitalised. Try it in Lucky Numbers vs. City Office, for example. Open the successful test result and see the difference.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The description in the problem spec is written to be used like
sprintf('It %s', $description).
So maybe we should update this is the test runner instead ? So we can keep this consistent with the toml.
Or you prefer we do this on a test by test basis ?
We have no testing framework, that does so (like jest in JavaScript or TypeScript)
https://pestphp.com/ does this, but I personally prefer PHPUnit. (pest is using phpunit under the hood).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer having that in the test. Because this makes PHPUnit output the testdox nicely on the command line when working with the CLI.
I put some hope onto tomasnorre's test generator to take care of that. But for now, I would be happy if you do it. I will merge with or without capitals...
|
Note that the job "Configlet Generate / configlet-generate (pull_request)" is failing because it is trngi to pull the branch from this repository instead of from my fork ... |
I need to investigate, what |
This will ease the exercise a bit.
84f5f48 to
77e641b
Compare
@homersimpsons So you have been faster than me typing...anyways, the problem was: Your local branch |
9bf93af to
69affc2
Compare
|
Thanks for contributing! Very nice work... |
This is the first time I add an exercise. I followed the walkthrough at https://exercism.org/docs/building/tracks/practice-exercises.
Do not hesitate to tell me if anything is wrong. I may try to implement other exercises so better be right from the beginning.
Some notes:
example.phpI tried to follow the instructions (not using std's functions), so maybe I could also put it as exemplar (with some added phpdoc)filter,map,foldlandfoldr? => Added to ease completion of the exercise@testdoxcomments, how should I go to fix them ? => I do not think it is relevant to fix them hereconfig.jsonshould I revert it to only add the relevant part forlist-ops? => I kept the diff as small as possible here@neenjaw I put you as a reviewer as it looks like you are the maintainer for the exercises.