Declare cluster_manager as a global non-constant variable with a type declaration (albeit an abstract type)#177
Declare cluster_manager as a global non-constant variable with a type declaration (albeit an abstract type)#177DilumAluthge wants to merge 1 commit intomasterfrom
cluster_manager as a global non-constant variable with a type declaration (albeit an abstract type)#177Conversation
…pe declaration (albeit an abstract type)
|
@JamesWrigley It looks like this isn't sufficient to fix the JET error. Example CI log: |
|
That being said, this might still be a good change to make, because it makes it a bit more explicit that the global exists, and isa ClusterManager. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #177 +/- ##
=======================================
Coverage 79.34% 79.34%
=======================================
Files 10 10
Lines 1951 1951
=======================================
Hits 1548 1548
Misses 403 403 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
JET reports whenever a global variable that might be uninitialized is used.
const cluster_manager = Ref{ClusterManager}()
function subroutine()
isassigned(cluster_manager) || error("cluster manager uninitialized")
manager = cluster_manager[]
# use `manager`
endThis approach does not fundamentally solve the code design issue but exploits JET's permissive reporting approach though. |
|
@JamesWrigley What do you think? Should we go with the |
No description provided.