mschuchard/linter-ansible-linting

Linter showing less accurate results than ansible-lint

caseylang opened this issue · 8 comments

It seems that this linter is showing less accurate results than the underlying ansible-lint:
screen shot 2016-09-28 at 5 05 36 pm
screen shot 2016-09-28 at 5 04 46 pm

Atom version: 1.10.2
language-ansible: 0.1.11
linter-ansible-linting: 1.2.0
linter: 1.11.16
ansible-lint: 3.3.0

Happy to provide additional information if needed.

The purpose of ansible-lint is for style linting. Ansible-lint happens to run a syntax check before doing style linting, because people were opening issues about what they thought were ansible-lint bugs that were really syntax errors in their playbooks.

If you want syntax linting, give linter-ansible-syntax a shot (except that I havent finished writing the code to trick it into linting individual task files). It is equipped for displaying syntax error info.

Speaking of which, how did you get ansible-lint to execute on a task file? it is only supposed to work on playbook files and role directories. I might need to summon Will Thames here unless you can shed some light on it.

Oh I see. This happened as an interesting side effect to my issue at ansible/ansible-lint#193.

I need to write some code for this new ability to lint any task list.

I am going to take some time to think about whether linter-ansible-syntax should start using ansible-lint for syntax linting now...

Soft ping: eighteen days with no reply.

Note for this issue: I investigated using ansible-lint for syntax checks and the only pro was it can check all files for YAML syntax errors (not really helpful) and there were several cons. Undid all the code for that feature and moved in other direction.

Sorry, I didn't realize I had a pending question. I didn't do anything except pass ansible-lint the path to the file.

Oh, I should I have been more specific. I was looking for acknowledgement that linter-ansible-linting is not going to output YAML syntax errors to the display, as its purpose is merely to output style warnings where appropriate and to output clean errors when they show up (I can't actually remember why I implemented that functionality in the first place except to maybe help users debug stack traces more easily and to not have an annoying Atom notification error).

You want either linter-ansible-syntax or a YAML syntax linter for this purpose.

Great thanks!

So linter-js-yaml probably is not going to be a good candidate to add language ['source.ansible'] to, so I need to keep pursuing the ansible playbook workaround for linter-ansible-syntax.

Plz parse syntax errors from ansible-linter. I've to check console for syntax errors all the time.