Skip to content
Open
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
7 changes: 0 additions & 7 deletions src/register.jl
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,6 @@ function set_metadata!(regbr::RegBranch, status::ReturnStatus)
regbr.metadata[complaint] = "Package version must be greater than 0.0.0"
elseif check == :new_package_label
add_label!(regbr, "new package")
elseif check == :not_standard_first_version
regbr.metadata[complaint] =
"""This looks like a new registration that registers version $(data.version).
Ideally, you should register an initial release with 0.0.1, 0.1.0 or 1.0.0 version numbers"""
elseif check == :version_less_than_all_existing
regbr.metadata[complaint] = "Version $(data.version) less than least existing version $(data.least)"
elseif check == :version_exists
Expand Down Expand Up @@ -190,9 +186,6 @@ function check_version!(version::VersionNumber, existing::Vector{VersionNumber},
@assert issorted(existing)
if isempty(existing)
add!(status, :new_package_label)
if !(version in [v"0.0.1", v"0.1", v"1"])
add!(status, :not_standard_first_version, (version = version,))
end
else
idx = searchsortedlast(existing, version)
if idx <= 0
Expand Down
9 changes: 3 additions & 6 deletions test/regedit.jl
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,8 @@ end
for ver in [v"0.0.2", v"0.3.2", v"4.3.2"]
status = ReturnStatus()
check_version!(ver, VersionNumber[], status)
@test hascheck(status, :not_standard_first_version)
@test hascheck(status, :new_package_label)
@test length(status.triggered_checks) == 2
@test length(status.triggered_checks) == 1
@test !haserror(status)
end

Expand Down Expand Up @@ -401,15 +400,13 @@ end

# Non-standard first version.
(project_files = ["Example2"],
status = Symbol[:new_package, :new_package_label,
:not_standard_first_version],
status = Symbol[:new_package, :new_package_label],
regbranch = (error = false, warning = true,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also needs to set warning = false.

kind = "New package", labels = String["new package"]))

# Version zero.
(project_files = ["Example5"],
status = Symbol[:new_package, :new_package_label, :version_zero,
:not_standard_first_version],
status = Symbol[:new_package, :new_package_label, :version_zero],
regbranch = (error = true, warning = true,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same.

kind = "New package", labels = String["new package"]))

Expand Down