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

feat: Add help information to the TUI #167

Merged
merged 2 commits into from
Aug 10, 2023

Conversation

xmnlab
Copy link
Member

@xmnlab xmnlab commented Aug 9, 2023

Pull Request description

  • Adds the help information in the TUI for each question;
  • Allow using jinja2 tags for default value for each question.

I am planning for my next step to move from inquirer to survey, but I need to do more tests to see if that would fix the issues with the input for long texts. Also, if necessary, we can combine both survey and inquirer. I am still investigating that.

How to test these changes

  • ...

Pull Request checklists

This PR is a:

  • bug-fix
  • new feature
  • maintenance

About this PR:

  • it includes tests.
  • the tests are executed on CI.
  • the tests generate log file(s) (path).
  • pre-commit hooks were executed locally.
  • this PR requires a project documentation update.

Author's checklist:

  • I have reviewed the changes and it contains no misspelling.
  • The code is well commented, especially in the parts that contain more complexity.
  • New and old tests passed locally.

Additional information

Reviewer's checklist

Copy and paste this template for your review's note:

## Reviewer's Checklist

- [ ] I managed to reproduce the problem locally from the `main` branch
- [ ] I managed to test the new changes locally
- [ ] I confirm that the issues mentioned were fixed/resolved .

@xmnlab xmnlab marked this pull request as ready for review August 10, 2023 00:04
@xmnlab
Copy link
Member Author

xmnlab commented Aug 10, 2023

the result looks like this:

$ scicookie
>> HELP: https://osl-incubator.github.io/scicookie/guide.html#information-about-the-project
>> DEFAULT: Roronoa Zoro
[?] Type the author's name: 
>> HELP: https://osl-incubator.github.io/scicookie/guide.html#information-about-the-project
>> DEFAULT: zoro@one.piece
[?] Type the author's email: 
>> HELP: https://osl-incubator.github.io/scicookie/guide.html#information-about-the-project
>> DEFAULT: OSL Python package
[?] Type the project's title: 
>> HELP: https://osl-incubator.github.io/scicookie/guide.html#information-about-the-project
>> DEFAULT: This Project aims to ...
[?] Type a short description about the project: 
>> HELP: https://osl-incubator.github.io/scicookie/guide.html#information-about-the-project
>> DEFAULT: osl-template
[?] Type the code name for your project (e.g. the repository name): osl-template
>> HELP: https://osl-incubator.github.io/scicookie/guide.html#information-about-the-project
>> DEFAULT: osl_template
[?] Type the code name for your package (the one used to import your package):

the question now looks much longer, and inquirer doesn't handle it very well. so maybe it could print the question first and in the [?] we could keep just the answer.

@xmnlab
Copy link
Member Author

xmnlab commented Aug 10, 2023

I moved the question text to outside the inquirer object, and the result looks like this:

 $ scicookie
Type the author's name (default: Roronoa Zoro):
>> HELP: https://osl-incubator.github.io/scicookie/guide.html#information-about-the-project
[?] : Ivan
Type the author's email (default: zoro@one.piece):
>> HELP: https://osl-incubator.github.io/scicookie/guide.html#information-about-the-project
[?] : ivan@ogasawara.com
Type the project's title (default: OSL Python package):
>> HELP: https://osl-incubator.github.io/scicookie/guide.html#information-about-the-project
[?] : My Little Project
Type a short description about the project (default: This Project aims to ...):
>> HELP: https://osl-incubator.github.io/scicookie/guide.html#information-about-the-project
[?] : This is a very little project
Type the code name for your project (e.g. the repository name) (default: osl-template):
>> HELP: https://osl-incubator.github.io/scicookie/guide.html#information-about-the-project
[?] : my-little-project
Type the code name for your package (the name used to import your package) (default: my_little_project):
>> HELP: https://osl-incubator.github.io/scicookie/guide.html#information-about-the-project
[?] : my_little_project
Type the project version (default: 0.1.0):
>> HELP: https://osl-incubator.github.io/scicookie/guide.html#information-about-the-project
[?] : 

maybe in the feature, we could have a dedicated field for example, and remove it from the quesiton text.

@xmnlab
Copy link
Member Author

xmnlab commented Aug 10, 2023

PS: there is no test yet for the "TUI" ... no sure yet how to test it .. I will need to take some time to think about that.

Copy link
Member

@Saransh-cpp Saransh-cpp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great, thanks @xmnlab! No idea how to test the TUI, haven't done anything like this before 🙂

@xmnlab
Copy link
Member Author

xmnlab commented Aug 10, 2023

thanks for the review @Saransh-cpp

@xmnlab xmnlab merged commit 8c05a6d into osl-incubator:main Aug 10, 2023
@xmnlab xmnlab deleted the add-help-message branch August 10, 2023 02:37
@github-actions
Copy link

🎉 This PR is included in version 0.6.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants