Skip to content

Commit

Permalink
csmock-snyk-plugin: no supported projects fix
Browse files Browse the repository at this point in the history
Fix: https://issues.redhat.com/browse/OSH-329

If no supported project is detected using the snyk plugin, it no longer crashes but it does return 0
  • Loading branch information
jperezdealgaba committed Oct 10, 2023
1 parent e1a8936 commit 28a1e66
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion py/plugins/snyk.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,11 @@ def scan_hook(results, mock, props):
mock.exec_chroot_cmd("/bin/rm -fv %s" % auth_token_dst)

# check exit code of snyk code itself
if ec not in [0, 1]:
if ec == 3:

Check warning

Code scanning / vcs-diff-lint

Plugin.handle_args.scan_hook: Unnecessary "elif" after "return", remove the leading "el" from "elif" Warning

Plugin.handle_args.scan_hook: Unnecessary "elif" after "return", remove the leading "el" from "elif"
# If there are no supported project, we just return a successful scan without results

Check warning

Code scanning / vcs-diff-lint

Line too long (102/100) Warning

Line too long (102/100)
results.print_with_ts("snyk-code: no supported projects detected")
return 0
elif ec not in [0, 1]:
results.error("snyk code returned unexpected exit status: %d" % ec, ec=ec)

# returning non-zero would prevent csmock from archiving SNYK_LOG
Expand Down

0 comments on commit 28a1e66

Please sign in to comment.