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

Don't quote strings that start with 0 when running ansible-lint --fix. #4167

Merged
merged 1 commit into from
May 24, 2024

Conversation

kousu
Copy link
Contributor

@kousu kousu commented May 16, 2024

In order to try to handle the mess that are octals in YAML, some special-case code was added to handle leading-zeros. But it caught too much, and would quote strings like 00-header and 0.0.0.0, even when .yamllint doesn't require them:

quoted-strings:
    required: false

and it generates awkward lists, like

   loop:
     - "00-header"
     - 10-help-text
     - 50-landscape-sysinfo
     - 50-motd-news
     - 88-esm-announce
     - 97-overlayroot

Fixes #4166

@kousu kousu requested a review from a team as a code owner May 16, 2024 00:25
@kousu kousu requested review from Qalthos and shatakshiiii and removed request for a team May 16, 2024 00:25
In order to try to handle [the mess that are octals in YAML](ansible#2965),
some [special-case code was added](ansible#3030)
to handle leading-zeros. But it caught too much, and would force quotes strings
like on 00-header and 0.0.0.0, even when .yamllint doesn't require them:

```
quoted-strings:
    required: false
```

and it generates awkward lists, like

```diff
   loop:
     - "00-header"
     - 10-help-text
     - 50-landscape-sysinfo
     - 50-motd-news
     - 88-esm-announce
     - 97-overlayroot
```
@ssbarnea ssbarnea merged commit 4588273 into ansible:main May 24, 2024
25 of 26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Octal-like strings are quoted unnecessarily
2 participants