fablo
fablo copied to clipboard
Bug: duplicate Fabric version validation - _verifyFabricVersion is unreachable dead code
Summary
In src/commands/validate/index.ts, two separate methods validate the exact same condition - whether fabricVersion >= 2.0.0:
_validateFabricVersion()(line 153) - emits aCRITICALerror -> callsprocess.exit(1)immediately-
_verifyFabricVersion()(line 562) - emits a regularERROR-> just adds to error list Since_validateFabricVersionis called first (line 118 invalidate()) and exits the process on failure,_verifyFabricVersion(called at line 150) is unreachable dead code when the version check fails.
Steps to Reproduce
- Set
fabricVersionto"1.4.0"in afablo-config.json -
- Run
fablo validate
- Run
-
- Observe that
_validateFabricVersionfires first and exits withprocess.exit(1)
- Observe that
-
_verifyFabricVersionnever executes
Expected Behavior
There should be a single, clear Fabric version validation - not two methods checking the same thing with different severity levels.
Proposed Fix
Remove the redundant _verifyFabricVersion method (lines 562-567) and its call (line 150). The existing _validateFabricVersion already handles this correctly with a CRITICAL exit.
Happy to open a PR for this fix.
i've opened PR #764 with a fix for this issue :)