Skip to content

Commit

Permalink
Refactor tag search, some minor development
Browse files Browse the repository at this point in the history
  • Loading branch information
VarLad committed Mar 7, 2024
1 parent 6ff242b commit 2916b05
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 21 deletions.
22 changes: 1 addition & 21 deletions src/PerfChecker.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,27 +23,7 @@ struct CheckerResult
tags::Vector{Symbol}
end

function find_by_tags(tags::Vector{Symbol}, results::CheckerResult; exact_match = true)
results = []
if exact_match
for j in results
if tags == j.tags
push!(results, tags)
else
end
else
for j in results
for i in tags
if i in j.tags
push!(results, tags)
break
end
end
end
end

return results
end
find_by_tags(tags::Vector{Symbol}, results::CheckerResult; exact_match = true) = findall(x -> exact_match ? (tags == x.tags) : (!isempty(x.tags tags)), results)

# SECTION - Exports
export @check
Expand Down
23 changes: 23 additions & 0 deletions src/versions.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
const VerConfig = Tuple{Symbol, Vector{VersionNumber}, Bool}

struct PackVer
pack::String
ver::VerConfig
end

to_version_numbers(x) = to_version_numbers(x...)
to_version_numbers(s::Symbol, x...) = to_version_numbers(Val(s), x...)

function findmaxversion(d::String,m::String)
l=m[1:1]
a_path=joinpath(d,"registries","General",l,m)
if isdir(d)&&isdir(a_path)
di=Pkg.Operations.load_versions(a_path)
return maximum(keys(di))
end
return v"0.0.0"
end

findmaxversion(m::String)=maximum(findmaxversion.(DEPOT_PATH,m))

function to_version_numbers(ver::VerConfig) end

0 comments on commit 2916b05

Please sign in to comment.