No fallback to syntax-check when ansible-lint shows invalid yaml
See original GitHub issueProblem
When I’m working on ansible roles in vscode, and I have autosave enabled after a relatively short delay (like 1 second), ansible-lint get’s triggered before I’m actually done with my change.
This results in 2 notifications:
The error is about invalid yaml content, which is true - in that moment.
Solution
There is no need to fall back to ansible syntax-check
if a usable ansible-lint is in place. Imo, a fallback should only happen if there’s either no ansible-lint, or the installed one can’t be used for whatever reason.
Instead of having 2 notifications, I’d prefer to have a more silent message, for example in the status bar telling me about broken yaml.
Alternatives
No response
Additional context
No response
Issue Analytics
- State:
- Created a year ago
- Comments:25 (5 by maintainers)
Top Results From Across the Web
syntax-check — Ansible Lint Documentation - Read the Docs
This is a valid approach for special cases, like testing fixtures that are invalid on purpose. One of the most common sources of...
Read more >Check your YAML for errors with yamllint - Red Hat
The yamllint command is an invaluable tool when you write YAML. It misses some Ansible-specific warnings, but it's a good fallback command for ......
Read more >ansible-lint Changelog - PyUp.io
Improve errors with invalid yaml files (2589) ssbarnea - Avoid jinja[invalid] with vars on task ... Refactor parsing of ansible syntax check (2529)...
Read more >Ansible 2.2 Documentation - Read the Docs
This may be confusing when you expect your playbook to not show any ... Empty variables and variables set to null in yaml...
Read more >プレイブックをチェック : lint|Ansible の使い方 - Zenn
git がインストールされていない環境に ansible-lint をインストール ... description │ Linter failed to process a YAML file, possible not an ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
For vscode-yaml, I think the issue is at https://github.com/redhat-developer/vscode-yaml/blob/main/Jenkinsfile#L48 . This is the only place I see the
--pre-release
flag used, and it only publishes a generic version on platforms that aren’t supported, but there’s nothing published for the other (supported?) platforms. If vscode-yaml doesn’t publish platform-specific code (I think that’s the case?), then there’s no need for this. You could probably remove--target win32-ia32 win32-arm64 linux-armhf alpine-x64 alpine-arm64
.@yaegassy I think you’re right.
Latest ansible and lint are no longer showing the red error notification. Time to update… yay. Thx again!