-
Notifications
You must be signed in to change notification settings - Fork 303
quoted-strings: Add allow-double-quotes-for-escaping #777
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
base: master
Are you sure you want to change the base?
Conversation
|
Hello Timo, thanks for the detailed and non-AI-generated story and reason behind this pull request 😉 The problem you describe looks the same as #609 and #753. Instead of your proposal
Can you please clean your code to use the consistent coding style of the rest of yamllint, as well as a commit message that matches the contribution guidelines, and same for the PR title? See recent commits for examples. |
e0863fa to
c622fb8
Compare
single-unless-contains-escaped quote type to quoted strings.c622fb8 to
6fcdc82
Compare
6fcdc82 to
ea55e79
Compare
|
@adrienverge Thanks for your feedback!
This is a great suggestion and i implemented it like that!
I tried building it like that but i am unsure if that was what you had envisioned.
For now i would like to avoid checking for specific escapes if thats ok, this does open up a new talking point though if there should be a feature that checks for valid escape sequence [1].
I changed the PR title and reworded the commit however could point out your issues with the code styling? Im not trying to be confrontational im just confused. There is also an issue with this, specifically with Thank you for your time! |
This pr adds a new option to the quoted string rule set:
single-unless-contains-escapedI was drawing a blank on the name of it so if its unfavorable i'm completely open to change it.
The reason behind this PR is the following problem:
At our company we use yamllint to lint yamfiles and some time ago some Idiot with the name Timo decided it would be a good idea to force single quote strings. And it want an issue until now as our ci pipelines only lint files that got changed. However recently i had to lint a file with URLs in them and they would trigger the line too long error. As it is there is no good way of breaking down a long string styled with single quotes without intoducing something like spaces. I changing the configuration to require double quotes but that go veto'd so im asking for this feature.
It allows a user to force single quote strings unless it contains a backslash, which would usually indicate an escape character and then allows the use of double quotes.
Affermations: