spring-shell
spring-shell copied to clipboard
gh-277: parse commented line like an empty line
Fixes GH-277. Idea: we parse a line and then evaluate despite it is commented. If there is a quote inside of comment then we get an exception "Missing a closing quote" (line 141 in spring-shell-core/src/main/java/org/springframework/shell/jline/ExtendedDefaultParser.java). To avoid this behavoir we should treat commented line like an empty. Then evaluate() from spring-shell-core/src/main/java/org/springframework/shell/Shell.java will take care of it with its "fail fast" on line 195.
Hello, @jvalkeal ! I didn't want to disturb you but it seems you are the only active official in this repo. Could you please guide me with my further steps? I guess I need your approval here.
Thank you for the PR! LGTM 👍
Can you please rebase it on the latest main branch and add a test for that case? It should then be good to merge for the upcoming 3.4.1 release.
Thank you upfront.
Thank you for the PR! LGTM 👍
Can you please rebase it on the latest
mainbranch and add a test for that case? It should then be good to merge for the upcoming 3.4.1 release.Thank you upfront.
@fmbenhassine I've rebased my branch on top of main and added unit tests to cover different cases and different implementations of Parser. Let me know if there is anything else I need to do to go further.
Thank you for the update! However I don't see the PR rebased on the latest main with those 48 commits and 109 files changed (not related to this PR). The PR should have a single commit with the change set you want to introduce. I don't know how I can help here but try to rebase your PR again. Otherwise you can open another one if it's easier for you.
@fmbenhassine I went through PR creation once again and it shows me PR is already opened with changes I've made. Maybe I should close this one and create PR one more time, I don't know. It seems like a bug here.
@fmbenhassine this is my another PR instead of this one: https://github.com/spring-projects/spring-shell/pull/1168