Skip to content

Commit 0bb7f5b

Browse files
authored
Merge pull request #352 from JuliaReach/schillic/ExplicitImports
Use ExplicitImports in tests and fix import issues
2 parents d7d01a6 + 3225297 commit 0bb7f5b

File tree

6 files changed

+34
-11
lines changed

6 files changed

+34
-11
lines changed

src/MathematicalSystems.jl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
module MathematicalSystems
22

3-
using LinearAlgebra, SparseArrays
4-
using LinearAlgebra: checksquare
5-
import RecipesBase
3+
using Base: /
4+
using LinearAlgebra: LinearAlgebra, Adjoint, Diagonal, I, Transpose,
5+
UniformScaling, checksquare, rank
6+
using SparseArrays: sparsevec, spzeros
67
using RecipesBase: @recipe
78
using Espresso: matchex
89
using MacroTools: @capture

src/init.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# optional dependencies
22
@static if !isdefined(Base, :get_extension)
3-
using Requires
3+
using Requires: @require
44
end
55

66
@static if !isdefined(Base, :get_extension)

test/Aqua.jl

Lines changed: 0 additions & 6 deletions
This file was deleted.

test/Project.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
[deps]
22
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
3+
ExplicitImports = "7d51a73a-1435-4ff3-83d9-f097790105c7"
34
InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
45
LazySets = "b4f0291d-fe17-52bc-9479-3d1a343d9043"
56
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
@@ -10,6 +11,7 @@ TypedPolynomials = "afbbf031-7a57-5f58-a1b9-b774a0fad08d"
1011

1112
[compat]
1213
Aqua = "0.8.9"
14+
ExplicitImports = "1"
1315
LazySets = "5"
1416
RecipesBase = "1"
1517
TypedPolynomials = "0.3, 0.4"

test/quality_assurance.jl

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
using MathematicalSystems, Test
2+
import Aqua, ExplicitImports
3+
4+
@testset "ExplicitImports tests" begin
5+
ignores = (:checksquare,)
6+
@test isnothing(ExplicitImports.check_all_explicit_imports_are_public(MathematicalSystems;
7+
ignore=ignores))
8+
@test isnothing(ExplicitImports.check_all_explicit_imports_via_owners(MathematicalSystems))
9+
ignores = (:AbstractRotation, :IsInfinite, :typename, :parse,
10+
:AbstractTriangular, :IteratorSize)
11+
@test isnothing(ExplicitImports.check_all_qualified_accesses_are_public(MathematicalSystems;
12+
ignore=ignores))
13+
@test isnothing(ExplicitImports.check_all_qualified_accesses_via_owners(MathematicalSystems))
14+
@test isnothing(ExplicitImports.check_no_implicit_imports(MathematicalSystems))
15+
@test isnothing(ExplicitImports.check_no_self_qualified_accesses(MathematicalSystems))
16+
ignores = (:LinearParametricContinuousSystem,
17+
:LinearParametricDiscreteSystem,
18+
:LinearControlParametricContinuousSystem,
19+
:LinearControlParametricDiscreteSystem) # false positives due to meta-programming
20+
@test isnothing(ExplicitImports.check_no_stale_explicit_imports(MathematicalSystems;
21+
ignore=ignores))
22+
end
23+
24+
@testset "Aqua tests" begin
25+
Aqua.test_all(MathematicalSystems)
26+
end

test/runtests.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,4 +67,4 @@ end
6767
include("macros.jl")
6868
end
6969

70-
include("Aqua.jl")
70+
include("quality_assurance.jl")

0 commit comments

Comments
 (0)