JuliaPackaging / Scratch.jl

Scratch spaces for all your persistent mutable data needs
MIT License
58 stars 11 forks source link

Fix a JET warning #44

Closed fingolfin closed 11 months ago

fingolfin commented 11 months ago

In the 'else' path, JET cannot prove that SCRATCH_DIR_OVERRIDE[] is (still) 'nothing', and thus reports a possible error. This then is also shown when analyzing packages that use Scratch. This can be resolved by assigning it first to a temporary variable.

codecov[bot] commented 11 months ago

Codecov Report

Merging #44 (90ebed6) into master (7df2dd3) will increase coverage by 0.11%. Report is 1 commits behind head on master. The diff coverage is 66.66%.

@@            Coverage Diff             @@
##           master      #44      +/-   ##
==========================================
+ Coverage   87.61%   87.73%   +0.11%     
==========================================
  Files           1        1              
  Lines         105      106       +1     
==========================================
+ Hits           92       93       +1     
  Misses         13       13              
Files Coverage Δ
src/Scratch.jl 87.73% <66.66%> (+0.11%) :arrow_up:

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

fingolfin commented 11 months ago

Hmm, seems Scratch is broken on Julia nightly?

fingolfin commented 11 months ago

@staticfloat @fredrikekre @giordano any concerns about this PR? Otherwise I'd like to merge it and make a new release, to get my package "JET clean" ;-)

giordano commented 11 months ago

Looks good to me.

staticfloat commented 11 months ago

Looks fine to me; shall we add a JET pass to the CI in a follow-on PR so that we don't accidentally regress it?

fingolfin commented 11 months ago

@staticfloat I've added JET to the test suite, let me know if that's what you had in mind.