Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

undefined references #321

Closed
maxfreu opened this issue Oct 10, 2022 · 4 comments · Fixed by #324
Closed

undefined references #321

maxfreu opened this issue Oct 10, 2022 · 4 comments · Fixed by #324

Comments

@maxfreu
Copy link
Contributor

maxfreu commented Oct 10, 2022

The vscode linter tells me that there are some undefined references in /src, a hopefully complete list:

rebuild(lookup; data=i, order=o, span=sp)

Base.values(os::OpenStack{<:Any}) = (fs[k] for k in keys(fs))

Iyperm[i] = li

merge(acc, (; key=extrema(columns)))

if ext isa Nothing
return true
else
return Extents.intersects(geomextent, rasterext)

layer_vals = map(_ -> missing, layer_keys)

rasterize!(x, geom; fill=_featurefillval(feature, fill), kw...)

Maybe you want to take a second look.

@rafaqz
Copy link
Owner

rafaqz commented Oct 10, 2022

Thanks, yeah I need to use some linting.Also be nice to have 100% test coverage one day...

@rafaqz
Copy link
Owner

rafaqz commented Oct 12, 2022

Ok these seem to be in a few categories: obscure edge cases I never tested like reversing affine transformed dims, 3d polygons which are rare but really need testing, and actually bad bugs like rasterize for features.

If you are ever interested in helping improve test coverage it would be good to do some kind of drive push this up into the high 90s at some stage.

I also wonder if its possible to run this JET.jl in the tests so this cant happen again.

@maxfreu
Copy link
Contributor Author

maxfreu commented Oct 12, 2022

I just ran the entire package through JET, which creates a wall of text. I'm quite impressed, it not only found the bugs listed above, but also bugs in HDF5 and DiskArrays. Some of them could have been prevented by using a linter, but not all; it also traced generated code, which a linter is probably not able to do. The errors are mostly: undefined variables, "may throw xy" errors (mostly through undefined keywords / used kwargs without default), invalid builtin function calls, no method matching, trying to iterate over nothing, and some more. Maybe it's possible to filter / focus on one error type after the other, e.g. addressing undefined references first. The code I ran is super simple:

# in Rasters environment
]add Jet
using JET
report_package()

Including JET into the tests should also be possible, but requires some more effort.

@rafaqz
Copy link
Owner

rafaqz commented Oct 13, 2022

I've been running that too! Got quite excited by how reliable everything will be once we have it set up. But it would be good to be able to turn off "may throw" reports and other junk, because we know, those errors are intentionally there...

I also found I needed to activate the package as an environment for the dependencies to work properly. Oh you said that

There is also this: https://github.com/julia-vscode/StaticLint.jl

Which is I guess what you are getting in VSCode. But I havent tried it standalone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants