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

SEA-265 Improvement of configure task #24

Merged
merged 5 commits into from
Jun 21, 2024

Conversation

GwendalLaurent
Copy link
Member

@GwendalLaurent GwendalLaurent commented Jun 4, 2024

Summary

This PR is linked to the PR SEA-265 Improvement of configure task on rebar3_grisp

In this PR a few improvements have been done for the configure task:

  • The grisp.io token is now trimmed at the beginning and at the end of the user input
  • A setting was represented as a tuple internally. It is now represented as a record
  • Some prompts now have hint/comments to explain them. They are displayed on top of the actual prompt. They are optional
  • The default values are displayed in blue. The comments are displayed in grey and warnings are displayed in orange
  • Internally, asking for an input is done through an event. This wasn't the case before

How to test ?

To test this PR you will need a local setup. Indeed, since the changes aren't pushed on the main branch the version of the plugin globally installed on your computer won't reflect the changes made for this PR. Thus we will need to use a throw off grisp project and use the _checkouts folder to use the correct versions of this repo as well as the rebar3_grisp repo. Both of them should be setup to checkout the branch named SEA-365-grisp-conf-upgrade

Example of the overall look of the task

Screenshot 2024-06-04 at 15 13 47

Copy link
Member

@ziopio ziopio left a comment

Choose a reason for hiding this comment

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

Fix hint

case is_list(String) of
true ->
Trimmed = string:trim(String),
unicode:characters_to_binary(Trimmed);
Copy link
Member

Choose a reason for hiding this comment

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

Just as a note, but is not needed.
This does not protect from " that if left unescaped will lead to crashes in the config file.
And if the token is between "" will also crash -> <<""mytoken"">>

Copy link
Member Author

Choose a reason for hiding this comment

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

The latest change:

Suggested change
unicode:characters_to_binary(Trimmed);
Whitespace = unicode_util:whitespace(),
Trimmed = string:trim(String, both, Whitespace ++ [$"]),

should fix this issue by removing the whitespaces and unescaped "

@IciaCarroBarallobre
Copy link
Member

It looks great! As soon as this is merged, I'll update the wiki tutorial and grisp_manager so everything looks the same :)

The only thing that's a bit strange to me is having the defaults in quotes.

@GwendalLaurent GwendalLaurent merged commit 684f7f2 into master Jun 21, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants