wiki:MessageStandardization

Version 6 (modified by martinl, 15 years ago) ( diff )

7.0svn

In progress, see http://grass.osgeo.org/wiki/Development_Specs

Message Standardization

How should Errors/Warnings/Messages be formatted

  • Only user derived variables should be bracketed, not GRASS derived variables. for example:
     Yes: Creating raster map <%s>.  Pass 1 of 7 ...
     No:  Creating <raster> map <%s>.  Pass [1] of [7] ...
    
  • strings &lt; &gt; e.g. Raster map <%s> not found
  • numbers [ ] e.g. Line [%d] deleted

Discussion

  • The [bracketed] parenthetical disrupts the flow of the phrase and doesn't help enhance clarity of meaning. IMHO, this reads better without [] brackets: "Line %d deleted." [] Brackets should be used when value is outside of the phrase: "Unknown line [%d]". --HB

Statistics

symbol number of code lines (2007-04-11) 2008-02-14 (6.3svn) 2009-08-02 (7.0svn)
<%s> 637 1406 1935
[%s] 690 427 222
'%s' 354 370 537
<%d> 12 7 11
[%d] 207 13 137
'%d' 3 1 1
TYPES="<%s> \[%s\] '%s' <%d> \[%d\] '%d'"

for TYPE in $TYPES ; do
  NUM_HITS=`grep -rI "$TYPE" * | grep -v '/.svn/\|^dist.i686-\|locale/po/' | wc -l`
  echo "$TYPE  $NUM_HITS"
done
Note: See TracWiki for help on using the wiki.