Skip to content

Commit e852ca0

Browse files
authored
Format files using DocumentFormat
1 parent c2b6e26 commit e852ca0

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

docs/make.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
using Documenter, ExcelFiles
22

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

src/ExcelFiles.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ function _readxl(file::ExcelReaders.ExcelFile, sheetname::AbstractString, startr
6262

6363
# This somewhat complicated conditional makes sure that column names
6464
# that are integer numbers end up without an extra ".0" as their name
65-
colnames = [isa(i, AbstractFloat) ? ( modf(i)[1] == 0.0 ? Symbol(Int(i)) : Symbol(string(i)) ) : Symbol(i) for i in vec(headervec)]
65+
colnames = [isa(i, AbstractFloat) ? (modf(i)[1] == 0.0 ? Symbol(Int(i)) : Symbol(string(i))) : Symbol(i) for i in vec(headervec)]
6666
else
6767
colnames = gennames(ncol)
6868
end
@@ -74,9 +74,9 @@ function _readxl(file::ExcelReaders.ExcelFile, sheetname::AbstractString, startr
7474

7575
for i = 1:ncol
7676
if header
77-
vals = data[2:end,i]
77+
vals = data[2:end, i]
7878
else
79-
vals = data[:,i]
79+
vals = data[:, i]
8080
end
8181

8282
# Check whether all non-NA values in this column

test/runtests.jl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ using Test
5151
end
5252

5353
df, names = create_columns_from_iterabletable(load(filename, "Sheet1!C4:O7", header=false))
54-
@test names == [:x1,:x2,:x3,:x4,:x5,:x6,:x7,:x8,:x9,:x10,:x11,:x12,:x13]
54+
@test names == [:x1, :x2, :x3, :x4, :x5, :x6, :x7, :x8, :x9, :x10, :x11, :x12, :x13]
5555
@test length(df[1]) == 4
5656
@test length(df) == 13
5757
@test df[1] == [1., 1.5, 2., 2.5]
@@ -100,15 +100,15 @@ using Test
100100
@test DataValues.isna(df[12][4])
101101
@test df[13] == [NA, 3.4, "HKEJW", NA]
102102

103-
# Test for saving DataFrame to XLSX
104-
input = (Day = ["Nov. 27","Nov. 28","Nov. 29"], Highest = [78,79,75]) |> DataFrame
103+
# Test for saving DataFrame to XLSX
104+
input = (Day=["Nov. 27", "Nov. 28", "Nov. 29"], Highest=[78, 79, 75]) |> DataFrame
105105
file = save("file.xlsx", input)
106106
output = load("file.xlsx", "Sheet1") |> DataFrame
107107
@test input == output
108108
rm("file.xlsx")
109109

110-
# Test for saving DataFrame to XLSX with sheetname keyword
111-
input = (Day = ["Nov. 27","Nov. 28","Nov. 29"], Highest = [78,79,75]) |> DataFrame
110+
# Test for saving DataFrame to XLSX with sheetname keyword
111+
input = (Day=["Nov. 27", "Nov. 28", "Nov. 29"], Highest=[78, 79, 75]) |> DataFrame
112112
file = save("file.xlsx", input, sheetname="SheetName")
113113
output = load("file.xlsx", "SheetName") |> DataFrame
114114
@test input == output
@@ -138,10 +138,10 @@ using Test
138138
@test DataValues.isna(df[12][4])
139139
@test df[13] == [NA, 3.4, "HKEJW", NA]
140140

141-
# Too few colnames
141+
# Too few colnames
142142
@test_throws ErrorException create_columns_from_iterabletable(load(filename, "Sheet1!C4:O7", header=true, colnames=[:c1, :c2, :c3, :c4]))
143143

144-
# Test for constructing DataFrame with empty header cell
144+
# Test for constructing DataFrame with empty header cell
145145
data, names = create_columns_from_iterabletable(load(filename, "Sheet2!C5:E7"))
146146
@test names == [:Col1, :x1, :Col3]
147147

0 commit comments

Comments
 (0)