julia-vscode / StaticLint.jl

Static Code Analysis for Julia
Other
145 stars 28 forks source link

Request: Mark concretely-typed arguments as unusual #366

Open ParadaCarleton opened 1 year ago

ParadaCarleton commented 1 year ago

e.g. Float64 here: image

fredrikekre commented 1 year ago

Why?

ParadaCarleton commented 1 year ago

Why?

Sorry, made a mistake in the title--this is for function arguments, although it might also apply (to a slightly lesser extent) to fields in a struct.

The reason I'd like a blue squiggly is because new users often make the mistake of overtyping their functions. It's very rare that you actually need a function to only allow Float64s.

dzhang314 commented 1 month ago

I strongly disagree with this suggestion. I write lots of high-performance code (e.g., MultiFloats.jl) that depends on exact bitwise representation, so my functions are correctly and appropriately specialized to concrete types.

Maybe you don't write code like that, and that's fine, but I think this is way too opinionated to turn on in the linter by default.