spring-shell icon indicating copy to clipboard operation
spring-shell copied to clipboard

gh-277: parse commented line like an empty line

Open polo7 opened this issue 1 year ago • 1 comments
trafficstars

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.

polo7 avatar Jun 08 '24 00:06 polo7

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.

polo7 avatar Jun 24 '24 20:06 polo7

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.

fmbenhassine avatar Apr 25 '25 09:04 fmbenhassine

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.

@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.

polo7 avatar Apr 28 '25 18:04 polo7

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 avatar Apr 28 '25 20:04 fmbenhassine

@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.

polo7 avatar Apr 29 '25 08:04 polo7

@fmbenhassine this is my another PR instead of this one: https://github.com/spring-projects/spring-shell/pull/1168

polo7 avatar May 01 '25 19:05 polo7