Closed simmsa closed 2 months ago
@rpauly18, could you take a look at this PR when you have time? It introduces a code compatibility test and action that fails if there are any ERROR
level code compatibility issues across the entire codebase. This addition is beneficial because it flags older function usage for contributed code and allows us to address legacy code sections before they cause issues for the end user.
Addressing issue #67.
Use MATLAB's built in
analyzeCodeCompatibility
function to run a code compatibility report. The output table provides insight into code that is not compatible with newer versions of MATLAB.This runs the code compatibility report on the entire
mhkit
directory, and parses output from the code compatibility report. If "Error" is found is the Severity column, exit status 1 is returned.The information in this output is relevant to core developers, but not for feature developers. Failing the code compatibility analysis should not make the test fail. We plan to add a separate GitHub action capture the output, but this action is mostly for visibility.
Remaining Tasks
As of this PR there are only "Warnings" and "Info" in the code compatibility report. These should be addressed, but that work falls outside the scope of this PR.
Below is the condensed output from this report:
Details:
COLMP Details (Warning):
parula(64)
queries the 64-color parula colormap.DATNM Details (Info):
'datenum'
is not recommended.'datetime'
instead.DATST Details (Info):
'datestr'
is not recommended.'datetime'
instead.DISPLAYPROG Details (Info):
DISPLAY
is not recommended.DISP
orFPRINTF
instead.GETFMT Details (Info):
get
for retrieving values of numeric display format is not recommended.'settings'
object instead.HISTC Details (Info):
'histc'
is not recommended.'histcounts'
instead.IDISVARLOW Details (Warning):
LEGPVPAIR Details (Warning):
'legend'
has changed and might interpret the name of an argument as a legend property instead of a label.VERLESSMATLAB Details (Info):
verLessThan('matlab', ...)
is not recommended.'isMATLABReleaseOlderThan'
instead.