From b07aeed92cf0dc0a370a89018ff7a79834ca9280 Mon Sep 17 00:00:00 2001 From: Nikita Pivkin Date: Thu, 18 Apr 2024 15:19:20 +0700 Subject: [PATCH] fmt rego --- Makefile | 2 +- lib/sh/sh_test.rego | 32 ++++++++++++++++---------------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/Makefile b/Makefile index f19936a6..78f513c0 100644 --- a/Makefile +++ b/Makefile @@ -9,7 +9,7 @@ rego: fmt-rego test-rego .PHONY: fmt-rego fmt-rego: - opa fmt -w checks/ + opa fmt -w lib/ checks/ .PHONY: test-rego test-rego: diff --git a/lib/sh/sh_test.rego b/lib/sh/sh_test.rego index dfa46e76..a2fcffc4 100644 --- a/lib/sh/sh_test.rego +++ b/lib/sh/sh_test.rego @@ -1,28 +1,28 @@ package lib.sh test_parse_commands_with_ampersands { - cmds := sh.parse_commands("apt update && apt install curl") - count(cmds) == 2 - cmds[0] == ["apt", "update"] - cmds[1] == ["apt", "install", "curl"] + cmds := sh.parse_commands("apt update && apt install curl") + count(cmds) == 2 + cmds[0] == ["apt", "update"] + cmds[1] == ["apt", "install", "curl"] } test_parse_commands_empty_input { - cmds := sh.parse_commands("") - count(cmds) == 0 + cmds := sh.parse_commands("") + count(cmds) == 0 } test_parse_commands_with_semicolon { - cmds := sh.parse_commands("apt update;apt install curl") - count(cmds) == 2 - cmds[0] == ["apt", "update"] - cmds[1] == ["apt", "install", "curl"] + cmds := sh.parse_commands("apt update;apt install curl") + count(cmds) == 2 + cmds[0] == ["apt", "update"] + cmds[1] == ["apt", "install", "curl"] } test_parse_commands_mixed { - cmds := sh.parse_commands("apt update; apt install curl && apt install git") - count(cmds) == 3 - cmds[0] == ["apt", "update"] - cmds[1] == ["apt", "install", "curl"] - cmds[2] == ["apt", "install", "git"] -} \ No newline at end of file + cmds := sh.parse_commands("apt update; apt install curl && apt install git") + count(cmds) == 3 + cmds[0] == ["apt", "update"] + cmds[1] == ["apt", "install", "curl"] + cmds[2] == ["apt", "install", "git"] +}