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

fix(ansiblelint): Support to the latest output format #70

Merged
merged 1 commit into from
Feb 3, 2024

Conversation

academo
Copy link
Contributor

@academo academo commented Feb 2, 2024

I installed ansiblelint and tried to make it work with none-ls but it seems the latest version (v6.22.x) I installed changed the output to the outdated (v5.x)

This code change makes sure it can handle the v6 format and keeps backwards compatibility with the legacy v5 via some simple object detection.

This is the new format you get from ansiblelint v6

[
  {
    "type": "issue",
    "check_name": "syntax-check[specific]",
    "categories": [
      "core"
    ],
    "url": "https://ansible-lint.readthedocs.io/rules/syntax-check/",
    "severity": "blocker",
    "level": "error",
    "description": "'tasks' is not a valid attribute for a PlaybookInclude",
    "fingerprint": "62bced6ef793c4d2c8e8922429b1baf4d75f19a67d2c8cbe4c40967e90157b47",
    "location": {
      "path": "playbook/update-install-pusher.yml",
      "positions": {
        "begin": {
          "line": 7,
          "column": 3
        }
      }
    }
  }
]

The old format (v5)

[
  {
    "type": "issue",
    "check_name": "[syntax-check] 'tasks' is not a valid attribute for a PlaybookInclude",
    "categories": [
      "core",
      "unskippable"
    ],
    "severity": "blocker",
    "description": "...[truncated]...",
    "fingerprint": "575853e16b67ca74e2340f72a4ea1d83ed8c1b47ea351faa4409cb9676ba5716",
    "location": {
      "path": "playbook/update-install-pusher.yml",
      "lines": {
        "begin": {
          "line": 7,
          "column": 3
        }
      }
    },
    "content": {
      "body": "...[truncated]..."
    }
  }
]

@academo academo changed the title Update ansiblelint.lua to the latest output format fix(ansiblelint) Support to the latest output format Feb 2, 2024
@academo academo changed the title fix(ansiblelint) Support to the latest output format fix(ansiblelint): Support to the latest output format Feb 2, 2024
@mochaaP
Copy link
Member

mochaaP commented Feb 2, 2024

lgtm, needs more testing

@academo
Copy link
Contributor Author

academo commented Feb 2, 2024

@mochaaP I added in the description some examples of the output between versions for clarity in the changes.

@mochaaP mochaaP merged commit d991c89 into nvimtools:main Feb 3, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants