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

Add tests! #25

Closed
ewels opened this issue Feb 28, 2022 · 4 comments
Closed

Add tests! #25

ewels opened this issue Feb 28, 2022 · 4 comments

Comments

@ewels
Copy link
Owner

ewels commented Feb 28, 2022

Suddenly a lot of people seem to be interested in using this package, and I'm now responsible for not breaking stuff.

Breaking up the code into smaller functions and writing some tests would certainly help my confidence when making changes..

@willmcgugan
Copy link
Collaborator

The price of success!

@ewels

This comment was marked as resolved.

@Jorricks
Copy link
Contributor

Jorricks commented Mar 3, 2022

I agree.
I also think that splitting up the new help function into smaller functions will greatly improve the extensibility.
For my use-case, I have a CLI for people who are truly new to CLIs xD
They need some more guidance than you'd put in a normal CLI, so I basically prepare this small text fragment in the help to include some sample commands for them and some context.

To be more in line with the rest of the CLI I also wish to use a rich panel for this, but in order to be able to do that, I need to extend the help code of course :p
If I would the do that now, I need to copy-paste 200+ lines and make a small edit in there instead of just overwrite a 20 line function (which is much more visible how my change comes in).

Still, I think you are doing a great job.
Personally, I wouldn't mind helping you out with this refactor.
Just let me know if you are already working on it or not. 👍

@ewels
Copy link
Owner Author

ewels commented Mar 3, 2022

@Jorricks sounds like a fascinating use case! I'd love to see a mockup of the kind of thing you're aiming for. Maybe this could be added to the library somehow as some kind of opt-in thing? (I'm already keen on extending default click functionality in a few places, eg. #11).

But yes, code refactoring is needed really. If you fancy making a start that would be much appreciated! If you do start rearranging code, please try to do it in small PRs for a little bit at a time, to make it easy to review. This kind of refactoring can easily end up with huge diffs where the entire package is moving and those are a nightmare to look over.

BrutalSimplicity added a commit to BrutalSimplicity/rich-click that referenced this issue Oct 23, 2022
BrutalSimplicity added a commit to BrutalSimplicity/rich-click that referenced this issue Oct 23, 2022
… formatting

- Adhere to click `HelpFormatter` interface
- Add tests :D

See ewels#89 ewels#88 ewels#25 ewels#19
@ewels ewels closed this as completed Apr 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants