ros2inspector watch
Keep a terminal open while you work: watch re-runs policy validation, or the built-in audit with --audit, whenever a source, interface, launch, config or build file changes, or a README or test file that affects a package's health score. After the first run it prints only new and resolved findings.
Usage
ros2inspector watch [PATH | -C PATH] [--policy FILE | --audit] [-i SECONDS] [--fail-on error|warning|info] [--once] [--verbose] [--no-cache]
PATH defaults to the current directory.
Options
| Option | Default | Description |
|---|---|---|
-C, --path | . | Workspace root (same as PATH) |
--policy, -p | <workspace>/ros2inspector_policy.yaml | Policy file; editing it reloads it |
--audit | false | Use the built-in audit rules instead of a policy file |
--interval, -i | 3.0 | Polling interval in seconds (at least 0.5) |
--fail-on | error | Severity that makes the exit code 1: error, warning or info |
--once | false | Run a single validation and exit, for scripts |
--verbose | false | Show tracebacks for analysis errors |
--no-cache | false | Re-parse source on every change |
Exit codes
On Ctrl+C, or after --once, the exit code reflects the last run:
| Code | Meaning |
|---|---|
0 | Clean |
1 | Findings at or above --fail-on |
2 | Invalid policy |
3 | Workspace or analysis error |
130 | Stopped before the first run finished |
Examples
ros2inspector watch --audit
ros2inspector watch ~/robot_ws --policy my_policy.yaml --interval 5
ros2inspector watch --once --fail-on warning