diff --git a/.gitignore b/.gitignore index e2f1f69..cb946a9 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,8 @@ /docs/build/ /docs/Manifest.toml -/perf/Manifest.toml \ No newline at end of file +/perf/Manifest.toml + +.gitignore + +.DS_Store \ No newline at end of file diff --git a/Project.toml b/Project.toml index 66c77c4..d7f2987 100644 --- a/Project.toml +++ b/Project.toml @@ -15,8 +15,10 @@ julia = "1.7" [extras] Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595" +ExplicitImports = "7d51a73a-1435-4ff3-83d9-f097790105c7" +JET = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" TestItemRunner = "f8b46487-2199-4994-9208-9a1283c18c0a" [targets] -test = ["Aqua", "Test", "TestItemRunner"] +test = ["Aqua", "ExplicitImports", "JET", "Test", "TestItemRunner"] diff --git a/src/ConstraintCommons.jl b/src/ConstraintCommons.jl index 0aefa38..0c5b2be 100644 --- a/src/ConstraintCommons.jl +++ b/src/ConstraintCommons.jl @@ -1,8 +1,8 @@ module ConstraintCommons #!SECTION -- Imports -using Dictionaries -using TestItems +import Dictionaries: AbstractDictionary, Dictionary, set! +import TestItems: @testitem #!SECTION -- Exports diff --git a/src/nothing.jl b/src/nothing.jl index 9d8ff87..bfd88d5 100644 --- a/src/nothing.jl +++ b/src/nothing.jl @@ -15,6 +15,7 @@ consisempty(::Nothing) = true consisempty(items) = @inline isempty(items) @testitem "Set: nothing" tags=[:set, :nothing] begin - @test !(ConstraintCommons.consin(42, nothing)) - @test ConstraintCommons.consisempty(nothing) + import ConstraintCommons: consin, consisempty + @test !(consin(42, nothing)) + @test consisempty(nothing) end diff --git a/src/symbols.jl b/src/symbols.jl index 33db468..b11a4b0 100644 --- a/src/symbols.jl +++ b/src/symbols.jl @@ -8,5 +8,6 @@ function symcon(s1::Symbol, s2::Symbol, connector::AbstractString = "_") end @testitem "Symbols" tags=[:symbols] begin - @test ConstraintCommons.symcon(:a, :b) === :a_b + import ConstraintCommons: symcon + @test symcon(:a, :b) === :a_b end diff --git a/test/Aqua.jl b/test/Aqua.jl index 807aa76..3f1aa29 100644 --- a/test/Aqua.jl +++ b/test/Aqua.jl @@ -1,8 +1,4 @@ @testset "Aqua.jl" begin - import Aqua - import ConstraintCommons - import Dictionaries - # TODO: Fix the broken tests and remove the `broken = true` flag Aqua.test_all( ConstraintCommons; diff --git a/test/ExplicitImports.jl b/test/ExplicitImports.jl new file mode 100644 index 0000000..4b3f1f9 --- /dev/null +++ b/test/ExplicitImports.jl @@ -0,0 +1,3 @@ +@testset "Look for Explicit Imports" begin + @test check_no_implicit_imports(ConstraintCommons) === nothing +end diff --git a/test/JET.jl b/test/JET.jl new file mode 100644 index 0000000..51fda87 --- /dev/null +++ b/test/JET.jl @@ -0,0 +1,3 @@ +@testset "Code linting (JET.jl)" begin + JET.test_package(ConstraintCommons; target_defined_modules = true) +end diff --git a/test/runtests.jl b/test/runtests.jl index dda1c95..fab954e 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,7 +1,14 @@ +using ConstraintCommons + +using Aqua +using ExplicitImports +using JET using Test using TestItemRunner @testset "Package tests: ConstraintCommons" begin include("Aqua.jl") + include("ExplicitImports.jl") + include("JET.jl") include("TestItemRunner.jl") end