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

lint jinja[spacing] warning when using backslash r ("\r") #2871

Closed
hyberdk opened this issue Jan 6, 2023 · 1 comment
Closed

lint jinja[spacing] warning when using backslash r ("\r") #2871

hyberdk opened this issue Jan 6, 2023 · 1 comment
Labels
bug new Triage required

Comments

@hyberdk
Copy link

hyberdk commented Jan 6, 2023

Summary

when using "\r" in a string, ansible-lint reports spacing issue.

Issue Type
  • Bug Report
OS / ENVIRONMENT

Ubuntu 20.04 running WSL

ansible-lint --version
ansible-lint 6.10.2 using ansible 2.13.6
  • ansible installation method: pip
  • ansible-lint installation method: pip
STEPS TO REPRODUCE

Create a playbook that looks like this:

---
- name: Test
  hosts: localhost
  tasks:
    - name: Lint fails with spacing issue
      ansible.builtin.debug:
        msg: "\r"
    - name: Lint fails with spacing issue sample two
      ansible.builtin.debug:
        msg: "blah\r"
    - name: Lint okay
      ansible.builtin.debug:
        msg: "test message"

In vscode, it will highlight the jinja[spacing] lint warning

image

ansible-lint --offline test_lint.yml 
WARNING: ansible-lint is no longer tested under Python 3.8 and will soon require 3.9. Do not report bugs for this version.
WARNING  Skipped installing collection dependencies due to running in offline mode.
WARNING  Overriding detected file kind 'yaml' with 'playbook' for given positional argument: test_lint.yml
WARNING  Listing 1 violation(s) that are fatal
jinja[spacing]: Jinja2 spacing could be improved:  -> 
 (warning)
test_lint.yml:5 Jinja2 template rewrite recommendation: `
`.


              Rule Violation Summary               
 count tag            profile rule associated tags 
     1 jinja[spacing] basic   formatting (warning) 

Passed with min profile: 0 failure(s), 1 warning(s) on 1 files.
Desired Behavior

there should be no lint warning.

Actual Behavior

there a lint warning, it should not happen.

@hyberdk hyberdk added bug new Triage required labels Jan 6, 2023
@hyberdk hyberdk changed the title lint warning when using backslash r ("\r") lint jinja[spacing] warning when using backslash r ("\r") Jan 6, 2023
@hyberdk
Copy link
Author

hyberdk commented Jan 6, 2023

found duplicate.. in #2671 closing this again, sorry about the duplicate.

@hyberdk hyberdk closed this as completed Jan 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug new Triage required
Projects
None yet
Development

No branches or pull requests

1 participant