Skip to content

Commit f1b5675

Browse files
authored
Switch a bunch of 2-space tabs to 4-space tabs [NFC] (#54198)
Following https://docs.julialang.org/en/v1/manual/style-guide/#Indentation I found these with `ag "\n [^\s*#]" --julia`
1 parent 337b952 commit f1b5675

File tree

12 files changed

+73
-73
lines changed

12 files changed

+73
-73
lines changed

base/stat.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,15 +66,15 @@ struct StatStruct
6666
end
6767

6868
@eval function Base.:(==)(x::StatStruct, y::StatStruct) # do not include `desc` in equality or hash
69-
$(let ex = true
69+
$(let ex = true
7070
for fld in fieldnames(StatStruct)[2:end]
7171
ex = :(getfield(x, $(QuoteNode(fld))) === getfield(y, $(QuoteNode(fld))) && $ex)
7272
end
7373
Expr(:return, ex)
7474
end)
7575
end
7676
@eval function Base.hash(obj::StatStruct, h::UInt)
77-
$(quote
77+
$(quote
7878
$(Any[:(h = hash(getfield(obj, $(QuoteNode(fld))), h)) for fld in fieldnames(StatStruct)[2:end]]...)
7979
return h
8080
end)

stdlib/Markdown/src/parse/parse.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ function parse(stream::IO, block::MD, config::Config; breaking = false)
9595
end
9696

9797
parse(stream::IO, block::MD; breaking = false) =
98-
parse(stream, block, config(block), breaking = breaking)
98+
parse(stream, block, config(block), breaking = breaking)
9999

100100
function parse(stream::IO; flavor = julia)
101101
isa(flavor, Symbol) && (flavor = flavors[flavor])

test/broadcast.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -808,8 +808,8 @@ let
808808
end
809809

810810
let
811-
bc = Broadcasted(+, (Broadcasted(*, ([1, 2, 3], 4)), 5))
812-
@test isbits(Broadcast.flatten(bc).f)
811+
bc = Broadcasted(+, (Broadcasted(*, ([1, 2, 3], 4)), 5))
812+
@test isbits(Broadcast.flatten(bc).f)
813813
end
814814

815815
# Issue #26127: multiple splats in a fused dot-expression

test/compiler/codegen.jl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -621,10 +621,10 @@ g40612(a, b) = a[]|a[] === b[]|b[]
621621

622622
# issue #41438
623623
struct A41438{T}
624-
x::Ptr{T}
624+
x::Ptr{T}
625625
end
626626
struct B41438{T}
627-
x::T
627+
x::T
628628
end
629629
f41438(y) = y[].x
630630
@test A41438.body.layout != C_NULL
@@ -722,14 +722,14 @@ mutable struct A42645{T}
722722
end
723723
end
724724
mutable struct B42645{T}
725-
y::A42645{T}
725+
y::A42645{T}
726726
end
727727
x42645 = 1
728728
function f42645()
729-
res = B42645(A42645([x42645]))
730-
res.y = A42645([x42645])
731-
res.y.x = true
732-
res
729+
res = B42645(A42645([x42645]))
730+
res.y = A42645([x42645])
731+
res.y.x = true
732+
res
733733
end
734734
@test ((f42645()::B42645).y::A42645{Int}).x
735735

test/compiler/contextual.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,8 +223,8 @@ function generator49715(world, source, self, f, tt)
223223
end
224224

225225
@eval function doit49715(f, tt)
226-
$(Expr(:meta, :generated, generator49715))
227-
$(Expr(:meta, :generated_only))
226+
$(Expr(:meta, :generated, generator49715))
227+
$(Expr(:meta, :generated_only))
228228
end
229229

230230
@test_throws "oh no" doit49715(sin, Tuple{Int})

test/compiler/inference.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1097,7 +1097,7 @@ f21771(::Val{U}) where {U} = Tuple{g21771(U)}
10971097

10981098
# PR #28284, check that constants propagate through calls to new
10991099
struct t28284
1100-
x::Int
1100+
x::Int
11011101
end
11021102
f28284() = Val(t28284(1))
11031103
@inferred f28284()

test/core.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4298,13 +4298,13 @@ end
42984298
abstract type abstest_14825 end
42994299

43004300
mutable struct t1_14825{A <: abstest_14825, B}
4301-
x::A
4302-
y::B
4301+
x::A
4302+
y::B
43034303
end
43044304

43054305
mutable struct t2_14825{C, B} <: abstest_14825
4306-
x::C
4307-
y::t1_14825{t2_14825{C, B}, B}
4306+
x::C
4307+
y::t1_14825{t2_14825{C, B}, B}
43084308
end
43094309

43104310
@test t2_14825{Int,Int}.types[2] <: t1_14825

test/filesystem.jl

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -2,49 +2,49 @@
22

33
mktempdir() do dir
44

5-
# Create test file
6-
filename = joinpath(dir, "file.txt")
7-
text = "123456"
8-
write(filename, text)
9-
10-
# test filesystem truncate (shorten)
11-
file = Base.Filesystem.open(filename, Base.Filesystem.JL_O_RDWR)
12-
Base.Filesystem.truncate(file, 2)
13-
text = text[1:2]
14-
@test length(read(file)) == 2
15-
close(file)
16-
17-
# test filesystem truncate (lengthen)
18-
file = Base.Filesystem.open(filename, Base.Filesystem.JL_O_RDWR)
19-
Base.Filesystem.truncate(file, 20)
20-
@test length(read(file)) == 20
21-
close(file)
22-
23-
# test filesystem futime
24-
file = Base.Filesystem.open(filename, Base.Filesystem.JL_O_RDWR)
25-
Base.Filesystem.futime(file, 1.0, 2.0)
26-
@test Base.Filesystem.stat(file).mtime == 2.0
27-
close(file)
28-
29-
# test filesystem readbytes!
30-
file = Base.Filesystem.open(filename, Base.Filesystem.JL_O_RDWR)
31-
res = ones(UInt8, 80)
32-
Base.Filesystem.readbytes!(file, res)
33-
@test res == UInt8[text..., (i > 20 for i in (length(text) + 1):length(res))...]
34-
close(file)
5+
# Create test file
6+
filename = joinpath(dir, "file.txt")
7+
text = "123456"
8+
write(filename, text)
9+
10+
# test filesystem truncate (shorten)
11+
file = Base.Filesystem.open(filename, Base.Filesystem.JL_O_RDWR)
12+
Base.Filesystem.truncate(file, 2)
13+
text = text[1:2]
14+
@test length(read(file)) == 2
15+
close(file)
16+
17+
# test filesystem truncate (lengthen)
18+
file = Base.Filesystem.open(filename, Base.Filesystem.JL_O_RDWR)
19+
Base.Filesystem.truncate(file, 20)
20+
@test length(read(file)) == 20
21+
close(file)
22+
23+
# test filesystem futime
24+
file = Base.Filesystem.open(filename, Base.Filesystem.JL_O_RDWR)
25+
Base.Filesystem.futime(file, 1.0, 2.0)
26+
@test Base.Filesystem.stat(file).mtime == 2.0
27+
close(file)
28+
29+
# test filesystem readbytes!
30+
file = Base.Filesystem.open(filename, Base.Filesystem.JL_O_RDWR)
31+
res = ones(UInt8, 80)
32+
Base.Filesystem.readbytes!(file, res)
33+
@test res == UInt8[text..., (i > 20 for i in (length(text) + 1):length(res))...]
34+
close(file)
3535

3636
end
3737

3838
import Base.Filesystem: S_IRUSR, S_IRGRP, S_IROTH
3939
@testset "types of permission mask constants" begin
40-
@test S_IRUSR & ~S_IRGRP == S_IRUSR
41-
@test typeof(S_IRUSR) == typeof(S_IRGRP) == typeof(S_IROTH)
40+
@test S_IRUSR & ~S_IRGRP == S_IRUSR
41+
@test typeof(S_IRUSR) == typeof(S_IRGRP) == typeof(S_IROTH)
4242
end
4343

4444
@testset "Base.Filesystem docstrings" begin
45-
undoc = Docs.undocumented_names(Base.Filesystem)
46-
@test_broken isempty(undoc)
47-
@test undoc == [:File, :Filesystem, :cptree, :futime, :rename, :sendfile, :unlink]
45+
undoc = Docs.undocumented_names(Base.Filesystem)
46+
@test_broken isempty(undoc)
47+
@test undoc == [:File, :Filesystem, :cptree, :futime, :rename, :sendfile, :unlink]
4848
end
4949

5050
@testset "write return type" begin

test/gc/linkedlist.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# This file is a part of Julia. License is MIT: https://julialang.org/license
22

33
mutable struct ListNode
4-
key::Int64
5-
next::ListNode
6-
ListNode() = new()
7-
ListNode(x)= new(x)
8-
ListNode(x,y) = new(x,y);
4+
key::Int64
5+
next::ListNode
6+
ListNode() = new()
7+
ListNode(x)= new(x)
8+
ListNode(x,y) = new(x,y);
99
end
1010

1111
function list(N=16*1024^2)

test/math.jl

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -885,14 +885,14 @@ end
885885
end
886886

887887
@testset "isapprox" begin
888-
# #22742: updated isapprox semantics
889-
@test !isapprox(1.0, 1.0+1e-12, atol=1e-14)
890-
@test isapprox(1.0, 1.0+0.5*sqrt(eps(1.0)))
891-
@test !isapprox(1.0, 1.0+1.5*sqrt(eps(1.0)), atol=sqrt(eps(1.0)))
892-
893-
# #13132: Use of `norm` kwarg for scalar arguments
894-
@test isapprox(1, 1+1.0e-12, norm=abs)
895-
@test !isapprox(1, 1+1.0e-12, norm=x->1)
888+
# #22742: updated isapprox semantics
889+
@test !isapprox(1.0, 1.0+1e-12, atol=1e-14)
890+
@test isapprox(1.0, 1.0+0.5*sqrt(eps(1.0)))
891+
@test !isapprox(1.0, 1.0+1.5*sqrt(eps(1.0)), atol=sqrt(eps(1.0)))
892+
893+
# #13132: Use of `norm` kwarg for scalar arguments
894+
@test isapprox(1, 1+1.0e-12, norm=abs)
895+
@test !isapprox(1, 1+1.0e-12, norm=x->1)
896896
end
897897

898898
# test AbstractFloat fallback pr22716

0 commit comments

Comments
 (0)