yaegassy / coc-ansible

ansible-language-server extension for coc.nvim
https://www.npmjs.com/package/@yaegassy/coc-ansible
MIT License
71 stars 3 forks source link

doesn't work when ansible-lint parseable is enabled #5

Closed twouters closed 2 years ago

twouters commented 2 years ago

When parseable mode is enabled for ansible-lint (parseable: true in .ansible-lint) the plugin is unable to parse ansible-lint's output.

I'm not sure if this is an issue of this plugin, or ansible-language-server.

[coc.nvim] Could not parse ansible-lint output. Please check your ansible-lint installation & configuration. More info in 
`Ansible Server` output.

output (:CocCommand workspace.showOutput) when parseable is enabled:

[Error  - 2:11:13 PM] Exception while parsing ansible-lint output: Unexpected token c in JSON at position 0
Tried to parse the following:
tasks/main.yml:144: package-latest Package installs should not use latest

[Info  - 2:11:13 PM] [ansible-lint] INFO     Added ANSIBLE_ROLES_PATH=~/.ansible/roles:/usr/share/ansible/roles:/etc/ansible/roles:roles:roles
WARNING  Listing 1 violation(s) that are fatal
You can skip specific rules or tags by adding them to your configuration file:
# .ansible-lint
warn_list:  # or 'skip_list' to silence them completely
  - package-latest  # Package installs should not use latest

Finished with 1 failure(s), 0 warning(s) on 1 files.

output when parseable is disabled:

[Info  - 2:13:34 PM] [ansible-lint] INFO     Added ANSIBLE_ROLES_PATH=~/.ansible/roles:/usr/share/ansible/roles:/etc/ansible/roles:roles:roles
You can skip specific rules or tags by adding them to your configuration file:
# .ansible-lint
warn_list:  # or 'skip_list' to silence them completely
  - package-latest  # Package installs should not use latest

Finished with 1 failure(s), 0 warning(s) on 1 files.

ansible-lint's output when parseable is enabled:

WARNING  Listing 3 violation(s) that are fatal
tasks/main.yml:118: yaml line too long (162 > 160 characters) (line-length)
tasks/main.yml:144: package-latest Package installs should not use latest
tasks/main.yml:289: yaml line too long (263 > 160 characters) (line-length)
You can skip specific rules or tags by adding them to your configuration file:
# .ansible-lint
warn_list:  # or 'skip_list' to silence them completely
  - package-latest  # Package installs should not use latest
  - yaml  # Violations reported by yamllint

Finished with 3 failure(s), 0 warning(s) on 1 files.

ansible-lint's output when parseable is disabled:

WARNING  Listing 3 violation(s) that are fatal
yaml: line too long (162 > 160 characters) (line-length)
tasks/main.yml:118

package-latest: Package installs should not use latest
tasks/main.yml:144 Task/Handler: install dependencies

yaml: line too long (263 > 160 characters) (line-length)
tasks/main.yml:289

You can skip specific rules or tags by adding them to your configuration file:
# .ansible-lint
warn_list:  # or 'skip_list' to silence them completely
  - package-latest  # Package installs should not use latest
  - yaml  # Violations reported by yamllint

Finished with 3 failure(s), 0 warning(s) on 1 files.
twouters commented 2 years ago

definitely an ansible-language-server issue

twouters commented 2 years ago

for reference: https://github.com/ansible/ansible-language-server/issues/43