scripts: compliance: Harden the execution of npx

Instead of relying on various exceptions that can happen when one tries
to execute a program that is not installed in the system (typically
FileNotFoundError but sometimes PermissionError), use shutil.which() to
ensure the npx executable is available before running it.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
1 file changed