Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sort ambiguities and type piracies by function name #233

Merged
merged 2 commits into from
Nov 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- In `test_deps_compat`, the two subtests `check_extras` and `check_weakdeps` are now run by default. ([#202](https://github.com/JuliaTesting/Aqua.jl/pull/202)) [BREAKING]
- `test_deps_compat` now reqiures compat entries for all dependencies. Stdlibs no longer get ignored. This change is motivated by similar changes in the General registry. ([#215](https://github.com/JuliaTesting/Aqua.jl/pull/215)) [BREAKING]
- `test_piracy` is renamed to `test_piracies`. ([#230](https://github.com/JuliaTesting/Aqua.jl/pull/230)) [BREAKING]
- `test_ambiguities` and `test_piracies` now return issues in a defined order. This order may change in a patch release of Aqua.jl. ([#233](https://github.com/JuliaTesting/Aqua.jl/pull/233))

### Removed

Expand Down
2 changes: 2 additions & 0 deletions src/ambiguities.jl
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,8 @@ function test_ambiguities_impl(
end
end

sort!(ambiguities, by = (ms -> (ms[1].name, ms[2].name)))

if !isempty(ambiguities)
printstyled("$(length(ambiguities)) ambiguities found", color = :red)
println()
Expand Down
4 changes: 3 additions & 1 deletion src/piracies.jl
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,11 @@ function is_pirate(meth::Method; treat_as_own = Union{Function,Type}[])
end

function hunt(mod::Module; skip_deprecated::Bool = true, kwargs...)
filter(all_methods(mod; skip_deprecated = skip_deprecated)) do method
piracies = filter(all_methods(mod; skip_deprecated = skip_deprecated)) do method
method.module === mod && is_pirate(method; kwargs...)
end
sort!(piracies, by = (m -> m.name))
return piracies
end

end # module
Expand Down