@miller-tech/uap 1.42.4 → 1.42.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
Binary file
|
|
@@ -6,10 +6,10 @@ import sys
|
|
|
6
6
|
from pathlib import Path
|
|
7
7
|
|
|
8
8
|
sys.path.insert(0, str(Path(__file__).parent))
|
|
9
|
-
from _common import
|
|
9
|
+
from _common import emit, parse_cli, run, worktree_root # noqa: E402
|
|
10
10
|
|
|
11
11
|
MUTATING_RE = re.compile(
|
|
12
|
-
r"\b(kubectl|helm|doctl|aws|gcloud)\b
|
|
12
|
+
r"\b(kubectl|helm|doctl|aws|gcloud)\b[^\n;&|]{0,48}?\b(apply|patch|create|edit|delete|install|upgrade|rollout|scale|set)\b",
|
|
13
13
|
re.I,
|
|
14
14
|
)
|
|
15
15
|
IAC_PATHS = (
|
|
@@ -23,9 +23,15 @@ IAC_PATHS = (
|
|
|
23
23
|
|
|
24
24
|
def main() -> None:
|
|
25
25
|
op, args = parse_cli()
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
# iac-parity governs live-state MUTATING shell COMMANDS (kubectl apply,
|
|
27
|
+
# helm install, ...). File edits -- including editing IaC manifests, or any
|
|
28
|
+
# content that merely names infra tools -- are never live-state mutations,
|
|
29
|
+
# so only Bash commands are in scope.
|
|
30
|
+
if op.lower() != "bash":
|
|
31
|
+
emit(True, "not a bash command")
|
|
32
|
+
cmd = args.get("command") or args.get("cmd") or ""
|
|
33
|
+
|
|
34
|
+
if not MUTATING_RE.search(cmd):
|
|
29
35
|
emit(True, "not a mutating IaC-scope command")
|
|
30
36
|
|
|
31
37
|
root = worktree_root() # git status must run against the working tree, not MAIN_ROOT
|