aws-cloudformation / cfn-lint-visual-studio-code

CloudFormation Linter IDE integration, autocompletion, and documentation
https://marketplace.visualstudio.com/items?itemName=kddejong.vscode-cfn-lint
Apache License 2.0
258 stars 136 forks source link

Scans all yaml files with cfn-lint at startup. #198

Open b3cft opened 3 years ago

b3cft commented 3 years ago

Issue Type: Bug

I have a couple of hundred cloudformation templates and serverless templates in my default workspace.

Every time I start or reload vscode it scans all the yaml files with cfn-lint.

It pushes to load average up to approx 200, until the WSL stops responding and disconnects. Then reconnecting it does it again. Rinse, repeat.

I've had to start running

pkill -f cfn-lint

multiple times in a terminal session when vscode or my machine reloads to keep it under control.

Is there a way to add a setting, to only lint files on open, rather than scan the whole workspace on load?

Extension version: 0.20.0 VS Code version: Code - Insiders 1.61.0-insider (aec6ee09fa1021cb59c7f4f4d000b027febc967d, 2021-09-03T05:14:10.486Z) OS version: Windows_NT x64 10.0.22000 Restricted Mode: No Remote OS version: Linux x64 5.10.43.3-microsoft-standard-WSL2

System Info |Item|Value| |---|---| |CPUs|AMD Ryzen 9 3900X 12-Core Processor (24 x 3793)| |GPU Status|2d_canvas: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
rasterization: enabled
skia_renderer: enabled_on
video_decode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled| |Load (avg)|undefined| |Memory (System)|63.94GB (40.65GB free)| |Process Argv|--crash-reporter-id d84130c3-89a0-47ae-a4ce-aa1e8a9d5382| |Screen Reader|no| |VM|0%| |Item|Value| |---|---| |Remote|WSL: Ubuntu-20.04| |OS|Linux x64 5.10.43.3-microsoft-standard-WSL2| |CPUs|AMD Ryzen 9 3900X 12-Core Processor (24 x 3792)| |Memory (System)|31.33GB (28.20GB free)| |VM|0%|
A/B Experiments ``` vsliv695:30137379 vsins829:30139715 vsliv368cf:30146710 vsreu685:30147344 python383cf:30185419 vspor879:30202332 vspor708:30202333 vspor363:30204092 pythonvspyt639:30291487 pythontb:30258533 vshan820:30294714 pythonvsuse255:30319630 3f5j7703:30294757 vscod805cf:30301675 vsccppwtct:30312693 bridge0708:30335490 pygetstartedt2:30353727 dockerwalkthru:30348713 bridge0723:30353136 javagetstartedt:30350119 pydsgst2:30361790 ```
kddejong commented 3 years ago

The default configuration, if the VS Code docs are correct, is that it will only scan on files being open.

Do you have a .cfnlintrc file?

b3cft commented 3 years ago

No, I don't have .cfnlintrc file in the workspace or my home dir.

wayne-folkes commented 2 years ago

I am running into this issue as well and dont have a cfnlintrc either. Is there some way to only limit the behavior of this plugin to only evaluate the open file?

gmergulhao commented 1 year ago

also running into this issue, which causes 100% ram utilization since cfn-lint runs for 100+ templates. same behaviour with pip installed cfn-lint versions 0.50, 0.60, 0.63, 0.65 running python 3.10 x64

kddejong commented 1 year ago

I may have to add some debugging output to get more details but can you provide me the abbreviated Output from the plugin? We should see the execution for every file that was opened or saved. We should only see executions for the files that are open.

image