-
Notifications
You must be signed in to change notification settings - Fork 74
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
RFE: Default ansible-lint params in settings to --fix
#985
Comments
thinking about htis more, let's not do this....... I think we need to support lint as a formatter e.g. so the user can "File: Save without formatting" |
@cidrblock I was planning on creating an issue on a similar topic, but I think the overall challenge is better addressed as you mentioned, through a formatting provider. I encountered an issue trying to create this type of functionality, specifically when using the Here's the problem: if auto-save is triggered while you're still modifying a task (which is malformed in some way), the extension invokes ansible-lint and attempts to fix the file, sometimes it does this so quickly, that it is leading to a conflict in VS Code with the following error message:
I believe formatting providers can handle these scenarios more effectively, especially the formatting on save, in fact I saw you can even format only the parts of a file you modified now as well on save. Overall, I support this idea as it aligns with what I was trying to achieve. While you could use pre-commit hooks, you are likely to surprise new users, when the opinionated fixes take place, and force them to re-commit, for example. It would be much more transparent if they could see it while the file was open. |
This will enable fixing automatically for users.
We'll need to watch closely for feedback :)
The text was updated successfully, but these errors were encountered: