Skip to content
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

double_quoted_strings does not permit space escape sequence #16

Closed
optiz0r opened this issue Jul 29, 2021 · 0 comments · Fixed by #20
Closed

double_quoted_strings does not permit space escape sequence #16

optiz0r opened this issue Jul 29, 2021 · 0 comments · Fixed by #20
Assignees
Labels
bug Something isn't working

Comments

@optiz0r
Copy link

optiz0r commented Jul 29, 2021

Describe the Bug

The double_quoted_strings raises a false positive for a double quoted string which contains the \s escape sequence. This sequence is only valid within double-quoted strings, not in single quoted strings, so the type of quotes cannot be changed, and a string using this sequence may legitimately not contain any variables.

Expected Behavior

No lint warning to be raised

Steps to Reproduce

Include the following code in a manifest: "\s"

Example:

split(strip($foo),"\s")

Environment

  • Version 2.4.2
  • Platform CentOS, puppet 6

Additional Context

https://github.com/rodjek/puppet-lint/blob/master/lib/puppet-lint/plugins/check_strings/double_quoted_strings.rb#L7 should include \\s as an additional case for a valid string to not fail the check.

@optiz0r optiz0r added the bug Something isn't working label Jul 29, 2021
@sanfrancrisko sanfrancrisko self-assigned this Aug 16, 2021
@da-ar da-ar closed this as completed in #20 Sep 13, 2021
da-ar pushed a commit that referenced this issue Sep 13, 2021
Prior to this commit, if the `\s` escape sequence was used, this
would cause a F+ from the `double_quoted_strings` check.

This commit updates the `double_quoted_string` check to permit the
`\s` string literal.
da-ar added a commit that referenced this issue Sep 13, 2021
…strings_f+

(GH-16) Do not warn on "\s" string literal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants