Skip to content

Commit d6d6e17

Browse files
authored
Format files using DocumentFormat
1 parent fc96313 commit d6d6e17

File tree

4 files changed

+30
-30
lines changed

4 files changed

+30
-30
lines changed

docs/make.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
using Documenter, ReadStat
22

33
makedocs(
4-
modules = [ReadStat],
5-
sitename = "ReadStat.jl",
6-
analytics="UA-132838790-1",
7-
pages = [
4+
modules=[ReadStat],
5+
sitename="ReadStat.jl",
6+
analytics="UA-132838790-1",
7+
pages=[
88
"Introduction" => "index.md"
99
]
1010
)
1111

1212
deploydocs(
13-
repo = "github.com/queryverse/ReadStat.jl.git"
13+
repo="github.com/queryverse/ReadStat.jl.git"
1414
)

src/C_interface.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ function readstat_get_var_count(metadata::Ptr{Nothing})
2020
end
2121

2222
function readstat_value_is_missing(value::ReadStatValue, variable::Ptr{Nothing})
23-
return Bool(ccall((:readstat_value_is_missing, libreadstat), Cint, (ReadStatValue,Ptr{Nothing}), value, variable))
23+
return Bool(ccall((:readstat_value_is_missing, libreadstat), Cint, (ReadStatValue, Ptr{Nothing}), value, variable))
2424
end
2525

2626
function readstat_variable_get_index(variable::Ptr{Nothing})

src/ReadStat.jl

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,19 @@ export ReadStatDataFrame, read_dta, read_sav, read_por, read_sas7bdat, read_xpor
2020
##
2121
##############################################################################
2222

23-
const READSTAT_TYPE_STRING = Cint(0)
24-
const READSTAT_TYPE_CHAR = Cint(1)
25-
const READSTAT_TYPE_INT16 = Cint(2)
26-
const READSTAT_TYPE_INT32 = Cint(3)
27-
const READSTAT_TYPE_FLOAT = Cint(4)
28-
const READSTAT_TYPE_DOUBLE = Cint(5)
23+
const READSTAT_TYPE_STRING = Cint(0)
24+
const READSTAT_TYPE_CHAR = Cint(1)
25+
const READSTAT_TYPE_INT16 = Cint(2)
26+
const READSTAT_TYPE_INT32 = Cint(3)
27+
const READSTAT_TYPE_FLOAT = Cint(4)
28+
const READSTAT_TYPE_DOUBLE = Cint(5)
2929
const READSTAT_TYPE_LONG_STRING = Cint(6)
3030

31-
const READSTAT_ERROR_OPEN = Cint(1)
32-
const READSTAT_ERROR_READ = Cint(2)
33-
const READSTAT_ERROR_MALLOC = Cint(3)
31+
const READSTAT_ERROR_OPEN = Cint(1)
32+
const READSTAT_ERROR_READ = Cint(2)
33+
const READSTAT_ERROR_MALLOC = Cint(3)
3434
const READSTAT_ERROR_USER_ABORT = Cint(4)
35-
const READSTAT_ERROR_PARSE = Cint(5)
35+
const READSTAT_ERROR_PARSE = Cint(5)
3636

3737
##############################################################################
3838
##
@@ -63,7 +63,7 @@ mutable struct ReadStatDataFrame
6363
measures::Vector{Cint}
6464
alignments::Vector{Cint}
6565
val_label_keys::Vector{String}
66-
val_label_dict::Dict{String, Dict{Any,String}}
66+
val_label_dict::Dict{String,Dict{Any,String}}
6767
rows::Int
6868
columns::Int
6969
filelabel::String
@@ -74,7 +74,7 @@ mutable struct ReadStatDataFrame
7474

7575
ReadStatDataFrame() =
7676
new(Any[], Symbol[], DataType[], String[], String[], Csize_t[], Cint[], Cint[],
77-
String[], Dict{String, Dict{Any,String}}(), 0, 0, "", Dates.unix2datetime(0), 0, Cint[], Bool[])
77+
String[], Dict{String,Dict{Any,String}}(), 0, 0, "", Dates.unix2datetime(0), 0, Cint[], Bool[])
7878
end
7979

8080
include("C_interface.jl")
@@ -139,7 +139,7 @@ get_measure(variable::Ptr{Nothing}) = readstat_variable_get_measure(variable)
139139
get_alignment(variable::Ptr{Nothing}) = readstat_variable_get_measure(variable)
140140

141141
function handle_variable!(var_index::Cint, variable::Ptr{Nothing},
142-
val_label::Cstring, ds_ptr::Ptr{ReadStatDataFrame})
142+
val_label::Cstring, ds_ptr::Ptr{ReadStatDataFrame})
143143
col = var_index + 1
144144
ds = unsafe_pointer_to_objref(ds_ptr)::ReadStatDataFrame
145145
missing_count = readstat_variable_get_missing_ranges_count(variable)
@@ -167,7 +167,7 @@ end
167167

168168
function get_type(val::Value)
169169
data_type = readstat_value_type(val)
170-
return [String, Int8, Int16, Int32, Float32, Float64, String][data_type + 1]
170+
return [String, Int8, Int16, Int32, Float32, Float64, String][data_type+1]
171171
end
172172

173173
Base.convert(::Type{Int8}, val::Value) = ccall((:readstat_int8_value, libreadstat), Int8, (Value,), val)
@@ -182,7 +182,7 @@ end
182182
as_native(val::Value) = convert(get_type(val), val)
183183

184184
function handle_value!(obs_index::Cint, variable::Ptr{Nothing},
185-
value::ReadStatValue, ds_ptr::Ptr{ReadStatDataFrame})
185+
value::ReadStatValue, ds_ptr::Ptr{ReadStatDataFrame})
186186
ds = unsafe_pointer_to_objref(ds_ptr)::ReadStatDataFrame
187187
var_index = readstat_variable_get_index(variable) + 1
188188
data = ds.data
@@ -226,9 +226,9 @@ function readfield!(dest::DataValueVector{String}, row, val::ReadStatValue)
226226
end
227227

228228
for (j_type, rs_name) in (
229-
(Int8, :readstat_int8_value),
230-
(Int16, :readstat_int16_value),
231-
(Int32, :readstat_int32_value),
229+
(Int8, :readstat_int8_value),
230+
(Int16, :readstat_int16_value),
231+
(Int32, :readstat_int32_value),
232232
(Float32, :readstat_float_value),
233233
(Float64, :readstat_double_value))
234234
@eval function readfield!(dest::DataValueVector{$j_type}, row, val::ReadStatValue)
@@ -267,7 +267,7 @@ function Parser()
267267
parser = ccall((:readstat_parser_init, libreadstat), Ptr{Nothing}, ())
268268
info_fxn = @cfunction(handle_info!, Cint, (Cint, Cint, Ptr{ReadStatDataFrame}))
269269
meta_fxn = @cfunction(handle_metadata!, Cint, (Ptr{Nothing}, Ptr{ReadStatDataFrame}))
270-
var_fxn = @cfunction(handle_variable!, Cint, (Cint, Ptr{Nothing}, Cstring, Ptr{ReadStatDataFrame}))
270+
var_fxn = @cfunction(handle_variable!, Cint, (Cint, Ptr{Nothing}, Cstring, Ptr{ReadStatDataFrame}))
271271
val_fxn = @cfunction(handle_value!, Cint, (Cint, Ptr{Nothing}, ReadStatValue, Ptr{ReadStatDataFrame}))
272272
label_fxn = @cfunction(handle_value_label!, Cint, (Cstring, Value, Cstring, Ptr{ReadStatDataFrame}))
273273
ccall((:readstat_set_metadata_handler, libreadstat), Int, (Ptr{Nothing}, Ptr{Nothing}), parser, meta_fxn)
@@ -284,7 +284,7 @@ end
284284
function parse_data_file!(ds::ReadStatDataFrame, parser::Ptr{Nothing}, filename::AbstractString, filetype::Val)
285285
retval = readstat_parse(filename, filetype, parser, ds)
286286
readstat_parser_free(parser)
287-
retval == 0 || error("Error parsing $filename: $(error_message(retval))")
287+
retval == 0 || error("Error parsing $filename: $(error_message(retval))")
288288
end
289289

290290
read_dta(filename::AbstractString) = read_data_file(filename, Val(:dta))

test/runtests.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ using DataValues
33
using Test
44

55
@testset "ReadStat: $ext files" for (reader, ext) in
6-
((read_dta, "dta"),
7-
(read_sav, "sav"),
8-
(read_sas7bdat, "sas7bdat"),
9-
(read_xport, "xpt"))
6+
((read_dta, "dta"),
7+
(read_sav, "sav"),
8+
(read_sas7bdat, "sas7bdat"),
9+
(read_xport, "xpt"))
1010

1111
dtafile = joinpath(dirname(@__FILE__), "types.$ext")
1212
rsdf = reader(dtafile)

0 commit comments

Comments
 (0)