From 3609d93a5e827b1970ecc23f723ab7bf2af6fa36 Mon Sep 17 00:00:00 2001 From: Gabriele Bozzola Date: Tue, 23 Jul 2024 02:01:53 -0700 Subject: [PATCH] Add (broken) tests for ExplicitImports --- Project.toml | 1 + test/Project.toml | 1 + test/aqua.jl | 16 ++++++++++++++++ 3 files changed, 18 insertions(+) diff --git a/Project.toml b/Project.toml index 50fbb50c..33c91518 100644 --- a/Project.toml +++ b/Project.toml @@ -33,6 +33,7 @@ ClimaComms = "0.5.6, 0.6" ClimaCore = "0.12, 0.13, 0.14" ClimaCoreTempestRemap = "0.3.13" Dates = "1" +ExplicitImports = "1" Interpolations = "0.15" NCDatasets = "0.13.1, 0.14" julia = "1.9" diff --git a/test/Project.toml b/test/Project.toml index 272abf00..a144275e 100644 --- a/test/Project.toml +++ b/test/Project.toml @@ -7,6 +7,7 @@ ClimaCore = "d414da3d-4745-48bb-8d80-42e94e092884" ClimaCoreTempestRemap = "d934ef94-cdd4-4710-83d6-720549644b70" ClimaUtilities = "b3f4f4ca-9299-4f7f-bd9b-81e1242a7513" Dates = "ade2ca70-3891-5945-98fb-dc099432e06a" +ExplicitImports = "7d51a73a-1435-4ff3-83d9-f097790105c7" Interpolations = "a98d9a8b-a2ab-59e6-89dd-64a1c18fca59" JuliaFormatter = "98e50ef6-434e-11e9-1051-2b60c6c9e899" LazyArtifacts = "4af54fe1-eca0-43a8-85a7-787d91b784e3" diff --git a/test/aqua.jl b/test/aqua.jl index 4b6ecebb..e8ec8e77 100644 --- a/test/aqua.jl +++ b/test/aqua.jl @@ -1,6 +1,11 @@ using Test using ClimaUtilities using Aqua +import ExplicitImports +import NCDatasets +import ClimaComms +import Interpolations +import ClimaCoreTempestRemap @testset "Aqua tests (performance)" begin # This tests that we don't accidentally run into @@ -30,4 +35,15 @@ end Aqua.test_piracies(ClimaUtilities) end +@testset "Explicit Imports" begin + @test isnothing(ExplicitImports.check_no_implicit_imports(ClimaUtilities)) broken = + true + @test isnothing( + ExplicitImports.check_no_stale_explicit_imports(ClimaUtilities), + ) broken = true + @test isnothing( + ExplicitImports.check_all_qualified_accesses_via_owners(ClimaUtilities), + ) broken = true +end + nothing