Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion core/quality/family_hooks.bzl
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
"""Hook helpers shared by the quality family files."""

load("//core/quality:pipeline.bzl", "drop_pipeline_tool")
load("//core/quality:real_core.bzl", "real_context", "real_resolve_list")
load("//core/quality:policy.bzl", "QualityPolicyInfo")
load("//core/quality:real_core.bzl", "real_context", "real_family_tier", "real_resolve_list")
load("//core/quality/private:native_config_impl.bzl", "bound_config_targets")

visibility(["//bicep/...", "//cc/...", "//core/...", "//dart/...", "//dotnet/...", "//erlang/...", "//go/...", "//haskell/...", "//java/...", "//javascript/...", "//julia/...", "//kubernetes/...", "//lua/...", "//ocaml/...", "//ruby/...", "//rust/...", "//scala/...", "//terraform/..."])

Expand All @@ -14,6 +16,14 @@ def without(resolved, tool):
"""Context that drops a tool from the pipeline."""
return real_context(resolved = drop_pipeline_tool(resolved, tool))

def without_in_standard_unless_bound(ctx, resolved, tool, family_id):
"""Context that drops a tool with no default rules at the standard tier, unless the user bound a config for it; None otherwise."""
if real_family_tier(ctx, family_id) != "standard":
return None
if tool in bound_config_targets(ctx.rule.attr, ctx.attr._policy[QualityPolicyInfo].declared, ""):
return None
return without(resolved, tool)

def default_files_hook(extensions, only_capability = None, except_capability = None):
def _hook(target, _ctx, _resolved, capability, _what, _shared):
if only_capability != None and capability != only_capability:
Expand Down
2 changes: 0 additions & 2 deletions core/quality/runner/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ rust_library(
"//core/quality/tiers/zizmor:standard.txt",
"//core/quality/tiers/zanuda:standard.txt",
"//core/quality/tiers/zanuda:strict.txt",
"//core/quality/tiers/pmd:standard.xml",
"//lua/private/quality:lua54.yml",
],
crate_name = "quality_runner",
Expand Down Expand Up @@ -189,7 +188,6 @@ rust_test(
"//core/quality/tiers/zizmor:standard.txt",
"//core/quality/tiers/zanuda:standard.txt",
"//core/quality/tiers/zanuda:strict.txt",
"//core/quality/tiers/pmd:standard.xml",
"//lua/private/quality:lua54.yml",
],
coverage_lib = ":quality_runner_lib",
Expand Down
17 changes: 0 additions & 17 deletions core/quality/runner/src/real_tools.rs
Original file line number Diff line number Diff line change
Expand Up @@ -452,23 +452,6 @@ fn selene_embedded_std_is_the_merged_file() {
assert!(std.contains("lua54"));
}

#[test]
fn pmd_standard_tier_covers_unused_code() {
let text = std::str::from_utf8(include_bytes!("../../tiers/pmd/standard.xml")).expect("utf8");
for rule in [
"UnusedPrivateMethod",
"UnusedPrivateField",
"UnusedLocalVariable",
"UnusedFormalParameter",
"UnusedAssignment",
] {
assert!(
text.contains(&format!("bestpractices.xml/{rule}\"")),
"{rule}"
);
}
}

#[test]
fn gplint_crashes_are_never_clean() {
let backend = backend_for("gplint", gplint_tool(), roundtrip_gplint);
Expand Down

This file was deleted.

14 changes: 0 additions & 14 deletions core/quality/testdata/runner_matrix_scala_dotnet.bzl
Original file line number Diff line number Diff line change
@@ -1,20 +1,6 @@
"""Scala plus .NET cohort matrix cells."""

SCALA_DOTNET_CASES = [
{
"name": "matrix_scala_scalafix_profile_standard",
"srcs": ["//core/quality/testdata/profiles/scala:Strict.scala"],
"capability": "lint",
"stages": ["scalafix;scala;core/quality/testdata/profiles/scala/Strict.scala"],
"tool_names": ["scalafix"],
"tool_binaries": ["//java/private/quality/tools:scalafix"],
"toolfile_tools": ["scalafix", "scalafix", "scalafix"],
"toolfile_srcs": ["//core/quality/testdata/profiles/scala:strict", "@maven//:org_scala_lang_scala_library_2_13_10", "//core/quality/tiers/scalafix:standard.conf"],
"toolfile_rels": ["dx-scalafix/owned/core/quality/testdata/profiles/scala/libstrict.jar", "dx-scalafix/aux/0-scala-library.jar", ""],
"config_tools": ["scalafix"],
"config_files": ["//core/quality/tiers/scalafix:standard.conf"],
"expected_file": ":matrix/matrix_scala_scalafix_profile_standard.expected.txt",
},
{
"name": "matrix_scala_scalafix_profile_strict",
"srcs": ["//core/quality/testdata/profiles/scala:Strict.scala"],
Expand Down
Loading
Loading