MCPcopy
hub / github.com/GitGuardian/ggshield / exit_code

Function exit_code

ggshield/__main__.py:46–60  ·  view source on GitHub ↗

exit_code guarantees that the return value of a scan is 0 when exit_zero is enabled

(ctx: click.Context, exit_code: int, **kwargs: Any)

Source from the content-addressed store, hash-verified

44@scan_group.result_callback()
45@click.pass_context
46def exit_code(ctx: click.Context, exit_code: int, **kwargs: Any) -> int:
47 """
48 exit_code guarantees that the return value of a scan is 0
49 when exit_zero is enabled
50 """
51 ctx_obj = ContextObj.get(ctx)
52 if (
53 exit_code == ExitCode.SCAN_FOUND_PROBLEMS
54 and ctx_obj.config.user_config.exit_zero
55 ):
56 logger.debug("scan exit_code forced to 0")
57 sys.exit(ExitCode.SUCCESS)
58
59 logger.debug("scan exit_code=%d", exit_code)
60 return exit_code
61
62
63# Plugin registry, lazily initialized when _load_plugins() is called.

Callers

nothing calls this directly

Calls 1

getMethod · 0.80

Tested by

no test coverage detected