Ability to change message categories
Support an option that allows the user to change the message category of a message from, for example, Warning to Error.
The message category associated with every message ("error", "warning", etc.) cannot be changed. If the goal is to convey a heightened sense of severity for specific messages, -append option may be used to cause custom text to be appended to the message when it is issued. If the goal is to elicit a build failure by causing PC-lint Plus to terminate with a non-zero exit code when particular messages have been issued, the -zero_err option can be used. See the description of this option for more information. If the goal is to cause the output to conform to the format expected by an IDE integration (which may recognize errors and warnings but have no concept of elective notes), see the -format_category option.
-
Arpad Toth commented
You can always do it in post.
-
Ralf Hain commented
Update for the 'Drill down':
https://wiki.jenkins-ci.org/display/JENKINS/PcLint+options
Leading zeros make it easier to trace back from number to rule. -
Ralf Hain commented
This could be accomplished by sed, eg:
sed -i -e 's|Note 960|Error 960|' output.lnt
Of cause, this depends on the -format option, so your suggestion would still make some sense.
Of cause, sed is not available under windows per default -> cygwin ...Here a more complex of sed-application:
# 'back to the sixties'
# ie 'Drill down' the collective message 960 MISRA X.Y to 30XY. (1960 MISRA X.Y.Z to 4XYZ)
sed -i -e 's|Note 96[01]\(.*Rule \)\([0-9]*\)\.\([0-9]\)|Warning 30\2\3\1\2\.\3|' output.lnt
sed -i -e 's|Note 196[03]\(.*Rule \)\([0-9]*\)-\([0-9]*\)-\([0-9]*\)|Warning 4\2\3\4\1\2-\3-\4|' output.lnt
#
# possible line no 1960 must not be substituded
# -> not format-agnostic, different for XML and other formats.
# Here for XML format:
# 's|<code>96[01]<\(.*Rule \)\([0-9]*\)\.\([0-9]\)|<code>30\2\3<\1\2\.\3|'
# 's|<code>196[03]<\(.*Rule \)\([0-9]*\)-\([0-9]*\)-\([0-9]*\)|<code>4\2\3\4<\1\2-\3-\4|'
#
# You also might want to replace "Note" by "Warning" in the sed-substitution;
# this rises the importance of the MISRA-issues a bit.