Skip to content

Commit

Permalink
[packchk] Rework Message M396
Browse files Browse the repository at this point in the history
- M396 to ERROR
- no check for ascending date anymore
- added case to test data

Co-authored-by: Thorsten de Buhr <thorstendb-ARM@users.noreply.github.com>
  • Loading branch information
grasci-arm and thorstendb-ARM authored Jan 26, 2023
1 parent 8d665c5 commit cfe36f4
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
2 changes: 1 addition & 1 deletion tools/packchk/src/PackChk_Msgs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ const MsgTable PackChk::msgTable = {
{ "M393", { MsgLevel::LEVEL_WARNING3, CRLF_B, "Package has development version '%DEVVERSION%': '%RELEASEVER%'" } },
{ "M394", { MsgLevel::LEVEL_ERROR, CRLF_B, "Not Semantic Versioning, ignoring version: '%RELEASEVER%'" } },
{ "M395", { MsgLevel::LEVEL_WARNING3, CRLF_B, "Release date attribute is not set for release version: '%RELEASEVER%'" } },
{ "M396", { MsgLevel::LEVEL_WARNING, CRLF_B, "Release %TAG% not consecutive (newest first): '%RELEASEVER%', '%RELEASEDATE%' (prev.: '%LATESTVER%', '%LATESTDATE%', see Line %LINE%)" } },
{ "M396", { MsgLevel::LEVEL_ERROR, CRLF_B, "Release %TAG% not consecutive (newest first): '%RELEASEVER%', '%RELEASEDATE%' (prev.: '%LATESTVER%', '%LATESTDATE%', see Line %LINE%)" } },
{ "M397", { MsgLevel::LEVEL_WARNING, CRLF_B, "File extension '.pdsc' must be lowercase: '%PATH%'" } },
{ "M398", { MsgLevel::LEVEL_ERROR, CRLF_B, "Attribute 'Dname' missing in expression using 'Pname=\"%NAME%\"" } },
{ "M399", { MsgLevel::LEVEL_WARNING3, CRLF_B, "Attribute '%TAG%' is ignored, because '%TAG2%' + '%TAG3%' is specified" } },
Expand Down
7 changes: 0 additions & 7 deletions tools/packchk/src/ValidateSyntax.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -391,13 +391,6 @@ bool ValidateSyntax::CheckPackageReleaseDate(RtePackage* pKg)
}
}

if(!latestDate.empty() && !releaseDate.empty()) {
int res = AlnumCmp::Compare(latestDate, releaseDate); // sorting of release version is fixed. The latest version is at the top the earliest release tag is at the bottom
if(res < 0) { // allow same date
LogMsg("M396", TAG("Date"), RELEASEVER(releaseVersion), RELEASEDATE(releaseDate), LATESTVER(latestVersion), LATESTDATE(latestDate), LINE(latestLineNo), lineNo);
}
}

latestVersion = releaseVersion;
latestDate = releaseDate;
latestLineNo = lineNo;
Expand Down
3 changes: 3 additions & 0 deletions tools/packchk/test/data/SemVerTest/Arm.SemVerTest_DFP.pdsc
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
OK: Same date different Version
</release>

<release version="4.6.3" date="2023-01-01">
Patch with newer date is allowed, versions must be in order.
</release>
<release version="4.6.2" date="2021-03-16">
<!-- ERROR M329: Description not set for Release Information '4.6.2' -->
</release>
Expand Down

0 comments on commit cfe36f4

Please sign in to comment.