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

Function test_scan_cmd

tests/test_plugin/plugin.py:16–29  ·  view source on GitHub ↗

Test scan command provided by the test plugin. This is a placeholder command to verify plugin commands work.

(file_path: str | None = None, text: str | None = None)

Source from the content-addressed store, hash-verified

14@click.argument("file_path", required=False)
15@click.option("--text", "-t", help="Text to scan instead of a file")
16def test_scan_cmd(file_path: str | None = None, text: str | None = None) -> None:
17 """
18 Test scan command provided by the test plugin.
19
20 This is a placeholder command to verify plugin commands work.
21 """
22 from ggshield.core import ui
23
24 if text:
25 ui.display_info(f"Would scan text: {text[:50]}...")
26 elif file_path:
27 ui.display_info(f"Would scan file: {file_path}")
28 else:
29 ui.display_error("Please provide a file path or --text option")
30
31
32@click.command("test-info")

Callers

nothing calls this directly

Calls 2

display_infoMethod · 0.80
display_errorMethod · 0.80

Tested by

no test coverage detected