-
Notifications
You must be signed in to change notification settings - Fork 132
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
Add configuration for quote style: either prefer single quote or double quote #647
Comments
I somewhat disagree with this feature request. Groovy isn't like Python, where the quoting style is a matter of personal taste. Single and double-quoted strings behave differently in Groovy.The CodeNarc rule has a good rationale: single-quoted strings are If you disagree with this, you can always suppress that ruleset. Also, I realize that you are basically forwarding a feature request from the npm-groovy-lint wrapper project. 😄 So you could always implement the feature in your wrapper and turn off those rules relating to single/double-quoted strings. |
Hi, @nre-ableton could you point me to some resources or benchmarks to better understand the performance difference between single quoted strings ( It's stated that single-quoted strings are more performanced but by how much? And why? I could only find this SO thread on the matter: https://stackoverflow.com/questions/9775672/string-vs-gstring-performance |
@CliveUnger I think that your SO link is probably the best benchmark I've seen on the subject. The performance gains will be quite small (at best), but it's not so much about the performance gain as the best practice (immutability vs. mutability). |
Would be great to have a rule for quote style, for example for teams where the agreement was to use double quotes always
Initial request nvuillam/npm-groovy-lint#177
The text was updated successfully, but these errors were encountered: