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

Don't automerge packages whose names end with jl #555

Merged
merged 2 commits into from
Feb 5, 2024
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
4 changes: 3 additions & 1 deletion src/AutoMerge/guidelines.jl
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ function meets_name_ascii(pkg)
end

const guideline_julia_name_check = Guideline(;
info="Name does not include \"julia\" or start with \"Ju\".",
info="Name does not include \"julia\", start with \"Ju\", or end with \"jl\".",
check=data -> meets_julia_name_check(data.pkg),
)

Expand All @@ -254,6 +254,8 @@ function meets_julia_name_check(pkg)
"Lowercase package name $(lowercase(pkg)) contains the string \"julia\"."
elseif startswith(pkg, "Ju")
return false, "Package name starts with \"Ju\"."
elseif endswith(lowercase(pkg), "jl")
return false, "Lowercase package name $(lowercase(pkg)) ends with \"jl\"."
else
return true, ""
end
Expand Down
4 changes: 3 additions & 1 deletion test/automerge-unit.jl
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,14 @@ end
@test !AutoMerge.meets_name_length("Flux")[1]
@test !AutoMerge.meets_name_length("Flux")[1]
end
@testset "Name does not include \"julia\" or start with \"Ju\"" begin
@testset "Name does not include \"julia\", start with \"Ju\", or end with \"jl\"" begin
@test AutoMerge.meets_julia_name_check("Zygote")[1]
@test AutoMerge.meets_julia_name_check("RegistryCI")[1]
@test !AutoMerge.meets_julia_name_check("JuRegistryCI")[1]
@test !AutoMerge.meets_julia_name_check("ZygoteJulia")[1]
@test !AutoMerge.meets_julia_name_check("Zygotejulia")[1]
@test !AutoMerge.meets_julia_name_check("Sortingjl")[1]
@test !AutoMerge.meets_julia_name_check("BananasJL")[1]
@test !AutoMerge.meets_julia_name_check("AbcJuLiA")[1]
end
@testset "Package name is ASCII" begin
Expand Down
Loading