Skip to content

Commit d32451e

Browse files
authored
Add tests with Aqua.jl (JuliaArrays#1212)
* remove coveralls badge * move docs badges to the top * add Aqua badge * rename test/ambiguities.jl -> test/aqua.jl * add Aqua.jl as a test dependency * use Aqua.jl in test * disable Project.toml formatting in Julia v1.6 * add compat for Aqua.jl
1 parent 61ed9cd commit d32451e

File tree

5 files changed

+52
-16
lines changed

5 files changed

+52
-16
lines changed

Project.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,13 @@ Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
1616
StaticArraysStatisticsExt = "Statistics"
1717

1818
[compat]
19+
Aqua = "0.7"
1920
PrecompileTools = "1"
2021
StaticArraysCore = "~1.4.0"
2122
julia = "1.6"
2223

2324
[extras]
25+
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
2426
BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"
2527
InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
2628
OffsetArrays = "6fe1bfb0-de20-5000-8ca7-80f57d26f881"
@@ -29,4 +31,4 @@ Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
2931
Unitful = "1986cc42-f94f-5a68-af5c-568840ba703d"
3032

3133
[targets]
32-
test = ["InteractiveUtils", "Test", "BenchmarkTools", "OffsetArrays", "Statistics", "Unitful"]
34+
test = ["InteractiveUtils", "Test", "BenchmarkTools", "OffsetArrays", "Statistics", "Unitful", "Aqua"]

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
*Statically sized arrays for Julia*
44

5-
[![Build Status](https://github.com/JuliaArrays/StaticArrays.jl/workflows/CI/badge.svg)](https://github.com/JuliaArrays/StaticArrays.jl/actions?query=workflow%3ACI)
6-
[![Coverage Status](https://coveralls.io/repos/github/JuliaArrays/StaticArrays.jl/badge.svg?branch=master)](https://coveralls.io/github/JuliaArrays/StaticArrays.jl?branch=master)
7-
[![codecov.io](https://codecov.io/github/JuliaArrays/StaticArrays.jl/branch/master/graph/badge.svg)](http://codecov.io/github/JuliaArrays/StaticArrays.jl/branch/master)
85
[![Stable](https://img.shields.io/badge/docs-stable-blue.svg)](https://JuliaArrays.github.io/StaticArrays.jl/stable)
96
[![Dev](https://img.shields.io/badge/docs-dev-blue.svg)](https://JuliaArrays.github.io/StaticArrays.jl/dev)
7+
[![Build Status](https://github.com/JuliaArrays/StaticArrays.jl/workflows/CI/badge.svg)](https://github.com/JuliaArrays/StaticArrays.jl/actions?query=workflow%3ACI)
8+
[![codecov.io](https://codecov.io/github/JuliaArrays/StaticArrays.jl/branch/master/graph/badge.svg)](http://codecov.io/github/JuliaArrays/StaticArrays.jl/branch/master)
9+
[![Aqua QA](https://raw.githubusercontent.com/JuliaTesting/Aqua.jl/master/badge.svg)](https://github.com/JuliaTesting/Aqua.jl)
1010
[![deps](https://juliahub.com/docs/StaticArrays/deps.svg)](https://juliahub.com/ui/Packages/StaticArrays/yY9vm?t=2)
1111
[![version](https://juliahub.com/docs/StaticArrays/version.svg)](https://juliahub.com/ui/Packages/StaticArrays/yY9vm)
1212

test/ambiguities.jl

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

test/aqua.jl

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
if VERSION v"1.7-"
2+
Aqua.test_all(StaticArrays, piracy=false)
3+
Aqua.test_piracy(StaticArrays, treat_as_own=[
4+
StaticArray
5+
Size
6+
SArray
7+
MArray
8+
SizedArray
9+
FieldArray
10+
StaticArrays.StaticArrayStyle
11+
StaticArrays.SOneTo
12+
StaticArrays.StaticArraysCore
13+
StaticArrays.check_array_parameters
14+
StaticArrays.convert_ntuple
15+
],
16+
broken=true)
17+
18+
elseif VERSION v"1.6-"
19+
Aqua.test_all(StaticArrays, piracy=false, ambiguities=false, project_toml_formatting=false)
20+
Aqua.test_piracy(StaticArrays, treat_as_own=[
21+
StaticArray
22+
Size
23+
SArray
24+
MArray
25+
SizedArray
26+
FieldArray
27+
StaticArrays.StaticArrayStyle
28+
StaticArrays.SOneTo
29+
StaticArrays.StaticArraysCore
30+
StaticArrays.check_array_parameters
31+
StaticArrays.convert_ntuple
32+
],
33+
broken=true)
34+
35+
# Allow no new ambiguities (see #18), unless you fix some old ones first!
36+
# TODO: Revisit and fix. See
37+
# https://github.com/JuliaLang/julia/pull/36962
38+
# https://github.com/JuliaLang/julia/issues/36951
39+
# Let's not allow new ambiguities. If any change makes the ambiguity count decrease, the
40+
# change should decrement `allowable_ambiguities` accordingly
41+
allowable_ambiguities = 1
42+
@test length(detect_ambiguities(StaticArrays)) == allowable_ambiguities
43+
44+
end

test/runtests.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using StaticArrays, Test, Random, LinearAlgebra
22
using InteractiveUtils
3+
using Aqua
34

45
# We generate a lot of matrices using rand(), but unit tests should be
56
# deterministic. Therefore seed the RNG here (and further down, to avoid test
@@ -45,7 +46,7 @@ if TEST_GROUP ∈ ["", "all", "group-A"]
4546
addtests("empty_array_syntax.jl")
4647
end
4748

48-
addtests("ambiguities.jl")
49+
addtests("aqua.jl")
4950
addtests("unbound_args.jl")
5051
addtests("custom_types.jl")
5152
addtests("convert.jl")

0 commit comments

Comments
 (0)