-
Notifications
You must be signed in to change notification settings - Fork 91
Fallback to syntax-check if ansible-lint is not installed or disabled #5
Conversation
@ganeshrn, I haven't created a separate ansiblePlaybook class. The reason is because, I didn't find any method to go into that class which can further be inherited by ansibleSyntaxCheck class. I find all the methods to be unique to ansibleSyntaxCheck class itself. Need your review and thoughts before implementing the ansiblePlaybook class. |
/cc @tomaciazek |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good work, but there are some issues and copy-paste left-overs.
The libraryChecker
name sounds misleading to me, given what it does and what it works with, but maybe that's just me.
d02ffe6
to
f8a9c68
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is use of console.debug
on purpose? If not, all instances should be converted to use of connection.console
.
I think debug is for devs (shows up in the JS console) and console as for end-users. |
Alright, if that is a conscious use, then I'm okay with that. If this is something that should be visible in the Ansible Server logs (available for the end-user), then it should be changed. |
That's for the devs. These messages appear in the log and can be useful for debugging purposes. I did not intend those messages for the users. That's why I do not want to use |
for more information, see https://pre-commit.ci
…e-server into syntax-check
the linter can easily disappear (python version upgrade) and we need to inform the user that he is running in without it. Think about divergent behaviour and bug reports from users not having the linter and expecting it to run. There will be LOTs. I am not saying that we should necessarily display a popup error message but at least we need to make it easy to discover the source of the problem. Two thinks come into my mind:
Ideally we should have prompted the user to install the linter automatically like vscode does for flake8 for example. Sadly that functionality is hard to implement. Microsoft did not make easy to reuse the install missing python dependency. |
@ssbarnea your suggestion sounds reasonable, however, I'd move the implementation/discussion out of this PR. I'm sure Priyam can't wait to get this merged after so many rounds of review. |
This change is done to support notification generation from the validation provider so that we can generate a notification for falling back to syntax-check from validation provider and not from the ansible lint service.
export class AnsiblePlaybook { | ||
private useProgressTracker = false; | ||
|
||
/** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is missing some text description.
Add logic to fallback to ansible syntax-check for diagnostics in-case ansible-lint is not installed (or disabled) in the user's environment.
Fixes: ansible/vscode-ansible#146