Skip to content

Commit

Permalink
Add ExplicitImports.jl tests
Browse files Browse the repository at this point in the history
  • Loading branch information
adrhill committed Oct 21, 2024
1 parent 024dafa commit 4d46306
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 227 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@
*.jl.cov
*.jl.mem
/Manifest.toml
/docs/Manifest.toml
/docs/build/
/test/Manifest.toml
224 changes: 0 additions & 224 deletions test/Manifest.toml

This file was deleted.

1 change: 1 addition & 0 deletions test/Project.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[deps]
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
ExplicitImports = "7d51a73a-1435-4ff3-83d9-f097790105c7"
JET = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b"
JuliaFormatter = "98e50ef6-434e-11e9-1051-2b60c6c9e899"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
25 changes: 24 additions & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@ using Test
using JuliaFormatter: JuliaFormatter
using Aqua: Aqua
using JET: JET
using ExplicitImports:
check_no_implicit_imports,
check_no_stale_explicit_imports,
check_all_explicit_imports_via_owners,
check_all_explicit_imports_are_public,
check_no_self_qualified_accesses,
check_all_qualified_accesses_via_owners,
check_all_qualified_accesses_are_public

@testset verbose = true "MethodURL.jl" begin
@testset verbose = true "Linting" begin
Expand All @@ -15,6 +23,21 @@ using JET: JET
@testset "Code linting (JET.jl)" begin
JET.test_package(MethodURL; target_defined_modules=true)
end

@testset "Code imports (ExplicitImports.jl)" begin
@testset "Improper implicit imports" begin
@test isnothing(check_no_implicit_imports(MethodURL))
end
@testset "Improper explicit imports" begin
@test isnothing(check_no_stale_explicit_imports(MethodURL))
@test isnothing(check_all_explicit_imports_via_owners(MethodURL))
@test isnothing(check_all_explicit_imports_are_public(MethodURL))
end
@testset "Improper qualified accesses" begin
@test isnothing(check_all_qualified_accesses_via_owners(MethodURL))
@test isnothing(check_no_self_qualified_accesses(MethodURL))
@test isnothing(check_all_qualified_accesses_are_public(MethodURL))
end
end
end
# Write your tests here.
end

0 comments on commit 4d46306

Please sign in to comment.