mcandre / toys

code demos for newbies
https://github.com/mcandre/toys
30 stars 6 forks source link

work around snyk crash #317

Open mcandre opened 2 years ago

mcandre commented 2 years ago

Snyk crashes when presented with an empty directory to scan. Examples:

In all such cases, we can improve the Snyk crash behavior by first checking for at least one accessible child path within ~/.conan/data. If so, continue on to running Snyk.

Else, present a clear "warning: no cached conan packages found", skip running Snyk, and treat the Snyk audit task as having been successful.

One of the benefits of this error handling, is that we will be able to copy & paste the same Snyk task between more projects, so that even projects that have no third party dependencies at all, can be more secure by default. In case they later introduce any conan dependencies.

Projects: