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
Style/QuotedSymbols
endless loop caused by escaped quote character
#10148
Labels
Comments
joshua-v-jones
changed the title
Endless loop generating slashes in a file
Endless loop generating slashes in a file to correct 1.22.0
Sep 30, 2021
I can replicate this, looking into it now. |
dvandersluis
changed the title
Endless loop generating slashes in a file to correct 1.22.0
Sep 30, 2021
Style/QuotedSymbols
Endless loop generating slashes in a file to correct 1.22.0
dvandersluis
changed the title
Sep 30, 2021
Style/QuotedSymbols
Endless loop generating slashes in a file to correct 1.22.0Style/QuotedSymbols
endless loop caused by escaped quote character
dvandersluis
added a commit
to dvandersluis/rubocop
that referenced
this issue
Oct 1, 2021
…ters incorrectly. Two cases are improved here: 1. Escaped double quotes (`\"`) within a double-quoted string are handled correctly (replaced with an unescaped double quote) when converting to a single-quoted string. 2. Escaped backslashes (`\\`) are treated properly and not doubled for both single- and double-quoted strings.
8 tasks
bbatsov
pushed a commit
that referenced
this issue
Oct 2, 2021
…correctly. Two cases are improved here: 1. Escaped double quotes (`\"`) within a double-quoted string are handled correctly (replaced with an unescaped double quote) when converting to a single-quoted string. 2. Escaped backslashes (`\\`) are treated properly and not doubled for both single- and double-quoted strings.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
On upgrading rubocop from version 1.1.0 to 1.22.0 there was a problem running the auto-correct command. The issue causes a file to be continuously filled with '/'s.
Expected behavior
Normally, rubocop would replace the double ticks with single ticks in this statement:
:"Le produit avec le SKU \"%1\" n’existe pas"
Would be replaced with
:'Le produit avec le SKU \"%1\" n’existe pas'
Actual behavior
Rubocop gets caught in an endless loop continuously generating '/'s like below:
:"Le produit avec le SKU \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"%1\" n’existe pas"
The file with this line is never corrected and CLI does not progress.
Steps to reproduce the problem
Create a ruby file with the line above.
Run rubocop -a
The command line will hang and when forced to exit the file should contain many '/'s.
RuboCop version
1.22.0
no output possible as the code hangs on an endless loop.
The text was updated successfully, but these errors were encountered: