Lint.jl
Lint.jl copied to clipboard
Advise on the use of ! (bang) for mutating functions
Hi!
I would be great if Lint.jl could catch situations where mutating functions are not named with the bang at the end.
i.e.
my_fill(x) = fill!(x, zero(eltype(x)))
function add_one(x)
for i in 1:length(x)
x[i] = x[i] + one(eltype(x))
end
x
end
These functions should be named my_fill!
and add_one!
instead.
Best regards,