diff --git a/docs/make.jl b/docs/make.jl index c073e43..1d04d5a 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -1,14 +1,14 @@ using Documenter, DataTables makedocs( - modules = [DataTables], - sitename = "DataTables.jl", - analytics = "UA-132838790-1", - pages = [ + modules=[DataTables], + sitename="DataTables.jl", + analytics="UA-132838790-1", + pages=[ "Introduction" => "index.md" ] ) deploydocs( - repo = "github.com/queryverse/DataTables.jl.git" + repo="github.com/queryverse/DataTables.jl.git" ) diff --git a/src/DataTables.jl b/src/DataTables.jl index 0c4dcda..c4827de 100644 --- a/src/DataTables.jl +++ b/src/DataTables.jl @@ -11,7 +11,7 @@ struct DataTable{T,TCOLS} <: AbstractVector{T} end function fromNT(nt) - nt = map(i->i isa ReadOnlyArrays.ReadOnlyArray ? i : ReadOnlyArrays.ReadOnlyArray(i), nt) + nt = map(i -> i isa ReadOnlyArrays.ReadOnlyArray ? i : ReadOnlyArrays.ReadOnlyArray(i), nt) tx = typeof(nt) et = NamedTuple{propertynames(nt),Tuple{(eltype(fieldtype(tx, i)) for i in 1:fieldcount(typeof(nt)))...}} return DataTable{et,typeof(nt)}(nt) @@ -21,7 +21,7 @@ swap_dva_in(A) = A swap_dva_in(A::Array{<:DataValue}) = DataValueArray(A) function DataTable(;cols...) - return fromNT(map(col->swap_dva_in(col), values(cols))) + return fromNT(map(col -> swap_dva_in(col), values(cols))) end function DataTable(table) @@ -49,7 +49,7 @@ end @inline function Base.getindex(dt::DataTable{T}, i::Int) where {T} @boundscheck checkbounds(dt, i) - return map(col->@inbounds(getindex(col, i)), columns(dt)) + return map(col -> @inbounds(getindex(col, i)), columns(dt)) end function Base.show(io::IO, dt::DataTable) diff --git a/test/runtests.jl b/test/runtests.jl index d74b1da..a88e028 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -3,7 +3,7 @@ using Test @testset "DataTables" begin - dt1 = DataTable(a = [1,2,3], b = [4.,5.,6.], c = ["John", "Sally", "Jim"]) + dt1 = DataTable(a=[1,2,3], b=[4.,5.,6.], c=["John", "Sally", "Jim"]) @testset "Core" begin @@ -31,13 +31,13 @@ using Test @test sprint(show, dt1) == "3x3 DataTable\na │ b │ c \n──┼─────┼──────\n1 │ 4.0 │ John \n2 │ 5.0 │ Sally\n3 │ 6.0 │ Jim " - @test sprint((stream, data)->show(stream, "text/plain", data), dt1) == + @test sprint((stream, data) -> show(stream, "text/plain", data), dt1) == "3x3 DataTable\na │ b │ c \n──┼─────┼──────\n1 │ 4.0 │ John \n2 │ 5.0 │ Sally\n3 │ 6.0 │ Jim " - @test sprint((stream, data)->show(stream, "text/html", data), dt1) == + @test sprint((stream, data) -> show(stream, "text/html", data), dt1) == "
a | b | c |
---|---|---|
1 | 4.0 | "John" |
2 | 5.0 | "Sally" |
3 | 6.0 | "Jim" |