From 3b9d897ac4c36443bdaf1bdaa0840edea1d15b96 Mon Sep 17 00:00:00 2001 From: Charlie Egan Date: Thu, 31 Oct 2024 19:38:02 +0000 Subject: [PATCH] Remove leaked-internal-reference comments (#1231) Signed-off-by: Charlie Egan --- bundle/regal/config/exclusion_test.rego | 8 ++++---- .../providers/packagename/packagename_test.rego | 4 ---- bundle/regal/main/main_test.rego | 3 --- .../imports/circular-import/circular_import_test.rego | 6 ------ 4 files changed, 4 insertions(+), 17 deletions(-) diff --git a/bundle/regal/config/exclusion_test.rego b/bundle/regal/config/exclusion_test.rego index e2a1c7cf..802fbab3 100644 --- a/bundle/regal/config/exclusion_test.rego +++ b/bundle/regal/config/exclusion_test.rego @@ -48,7 +48,7 @@ test_all_cases_are_as_expected if { some pattern, subcases in cases res := {file | some file, exp in subcases - act := config._exclude(pattern, file) # regal ignore:leaked-internal-reference + act := config._exclude(pattern, file) exp != act } count(res) > 0 @@ -92,7 +92,7 @@ test_excluded_file_cli_overrides_config if { } test_trailing_slash if { - config._trailing_slash("foo/**/bar") == {"foo/**/bar", "foo/**/bar/**"} # regal ignore:leaked-internal-reference - config._trailing_slash("foo") == {"foo", "foo/**"} # regal ignore:leaked-internal-reference - config._trailing_slash("foo/**") == {"foo/**"} # regal ignore:leaked-internal-reference + config._trailing_slash("foo/**/bar") == {"foo/**/bar", "foo/**/bar/**"} + config._trailing_slash("foo") == {"foo", "foo/**"} + config._trailing_slash("foo/**") == {"foo/**"} } diff --git a/bundle/regal/lsp/completion/providers/packagename/packagename_test.rego b/bundle/regal/lsp/completion/providers/packagename/packagename_test.rego index 207cedb5..fba5d2aa 100644 --- a/bundle/regal/lsp/completion/providers/packagename/packagename_test.rego +++ b/bundle/regal/lsp/completion/providers/packagename/packagename_test.rego @@ -140,18 +140,14 @@ test_package_name_completion_on_typing_multiple_suggestions_when_invoked if { } test_build_suggestions if { - # regal ignore:leaked-internal-reference provider._suggestions("foo.bar.baz", {"text": "foo"}) == ["foo.bar.baz"] - # regal ignore:leaked-internal-reference provider._suggestions("foo.bar.baz", {"text": "bar"}) == ["bar.baz"] - # regal ignore:leaked-internal-reference provider._suggestions("foo.bar.baz", {"text": "ba"}) == ["bar.baz", "baz"] } test_build_suggestions_invoked if { - # regal ignore:leaked-internal-reference provider._suggestions("foo.bar.baz", {"text": ""}) == [ "foo.bar.baz", "bar.baz", diff --git a/bundle/regal/main/main_test.rego b/bundle/regal/main/main_test.rego index cc3f8156..55b3cc2c 100644 --- a/bundle/regal/main/main_test.rego +++ b/bundle/regal/main/main_test.rego @@ -352,7 +352,6 @@ test_main_lint if { test_rules_to_run_not_excluded if { cfg := {"rules": {"testing": {"test": {"level": "error"}}}} - # regal ignore:leaked-internal-reference rules_to_run := main._rules_to_run with config.merged_config as cfg with config.for_rule as {"level": "error"} with input.regal.file.name as "p.rego" @@ -370,7 +369,6 @@ test_notices if { "severity": "none", } - # regal ignore:leaked-internal-reference notices := main.lint.notices with main._rules_to_run as {"idiomatic": {"testme"}} with data.regal.rules.idiomatic.testme.notices as {notice} @@ -397,7 +395,6 @@ test_report_custom_rule_failure if { } test_aggregate_bundled_rule if { - # regal ignore:leaked-internal-reference agg := main.aggregate with main._rules_to_run as {"foo": {"bar"}} with data.regal.rules as {"foo": {"bar": {"aggregate": {"baz"}}}} diff --git a/bundle/regal/rules/imports/circular-import/circular_import_test.rego b/bundle/regal/rules/imports/circular-import/circular_import_test.rego index 7bcbaa6a..90070aeb 100644 --- a/bundle/regal/rules/imports/circular-import/circular_import_test.rego +++ b/bundle/regal/rules/imports/circular-import/circular_import_test.rego @@ -98,7 +98,6 @@ test_aggregate_rule_surfaces_refs if { } test_import_graph if { - # regal ignore:leaked-internal-reference r := rule._import_graph with input as {"aggregate": { { "aggregate_data": {"refs": {{"location": {"col": 12, "row": 3}, "package_path": "data.policy.b"}}}, @@ -130,7 +129,6 @@ test_import_graph if { } test_import_graph_self_import if { - # regal ignore:leaked-internal-reference r := rule._import_graph with input as {"aggregate": {{ "aggregate_data": {"refs": {{"location": {"col": 12, "row": 4}, "package_path": "data.example"}}}, "aggregate_source": {"file": "example.rego", "package_path": ["example"]}, @@ -141,7 +139,6 @@ test_import_graph_self_import if { } test_self_reachable if { - # regal ignore:leaked-internal-reference r := rule._self_reachable with rule._import_graph as { "data.policy.a": {"data.policy.b"}, "data.policy.b": {"data.policy.c"}, "data.policy.c": {"data.policy.a"}, @@ -151,7 +148,6 @@ test_self_reachable if { } test_groups if { - # regal ignore:leaked-internal-reference r := rule._groups with rule._import_graph as { "data.policy.a": {"data.policy.b"}, "data.policy.b": {"data.policy.c"}, @@ -170,14 +166,12 @@ test_groups if { } test_groups_empty_graph if { - # regal ignore:leaked-internal-reference r := rule._groups with rule._import_graph as {"data.policy.a": {}} r == set() } test_package_locations if { - # regal ignore:leaked-internal-reference r := rule._package_locations with input as {"aggregate": { { "aggregate_data": {"refs": {{"location": {"col": 12, "row": 3}, "package_path": "data.policy.b"}}},