Changes between Initial Version and Version 1 of Submitting/General


Ignore:
Timestamp:
Jun 21, 2014, 4:49:18 AM (10 years ago)
Author:
martinl
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Submitting/General

    v1 v1  
     1''Please improve this list...''
     2
     3Dear (new) GRASS developer,
     4
     54.  We don't want the `$ID$` in source code any more as it causes problems
     6for the SVN branches.
     7
     8
     914. PLEASE take the time to add comments throughout your code explaining what the code is doing. It will save a HUGE amount of time and frustration for other programmers that may have to change your code in the future.
     10
     11
     1218. Make sure a new line is at the end of each file and UNIX style newlines are used (`\n`).
     13
     14
     1519. When writing Makefiles, use the current standard.
     16
     17    If you have to use commands, please check for:
     18{{{   
     19            avoid     | use instead
     20    ------------------+---------------
     21    make target       | $(MAKE) target
     22    mkdir target      | $(MKDIR) target
     23    cp  (executable)  | $(INSTALL) -m 755 file target
     24    cp  (normal file) | $(INSTALL) -m 644 file target
     25    ar                | $(AR)
     26}}}
     27    `rm`: be VERY careful with recursive remove. Also beware of
     28    removing $(FOO)* if $(FOO) has any chance of being empty.
     29
     30    Examples: see below examples or others[[BR]]
     31              source:grass/trunk/raster/r.info/Makefile [[BR]]
     32              source:grass/trunk/vector/v.edit/Makefile
     33
     34    If you are unsure, please ask on the GRASS Developers list.
     35
     36   
     3720. Have a look at source:grass/trunk/INSTALL
     38
     39
     4024. For consistency, use `README` rather than `README.txt` for any `README` files.
     41
     42
     4325. GRASS/Environment variables:
     44   If you add a new variable, please follow the naming convention. All variables are described in source:grass/trunk/lib/init/variables.html
     45
     4626. Be sure to develop on top of the LATEST GRASS code (which is in our SVN repository). You can re-check before submission with `svn diff`:
     47
     48    Be sure to create unified (`diff -u`) format. "Plain" diffs (the default format) are risky, because they will apply without warning to code which has been substantially changed; they are also harder to read than unified.
     49
     50    Such diffs should be made from the top-level directory, e.g. `svn diff display/d.vect/main.c`; that way, the diff will include the pathname rather than just an ambiguous `main.c`.
     51
     52
     5327. Try to use module names which describe shortly the intended purpose of the module.
     54
     55    The first letters for module name should be:
     56{{{
     57        d.      - display commands
     58        db.     - database commands
     59        g.      - general GIS management commands
     60        i.      - imagery commands
     61        m.      - miscellaneous tool commands
     62        ps.     - postscript commands
     63        r.      - raster commands
     64        r3.     - raster3D commands
     65        v.      - vector commands
     66}}}
     67    Some additional naming conventions
     68    * export modules:     (type).out.(format) eg: `r.out.arc`, `v.out.ascii`
     69    * import module:      (type).in.(format)  eg: `r.in.arc`, `v.in.ascii`
     70    * conversion modules: (type).to.(type)    eg: `r.to.vect`, `v.to.rast`, `r3.to.rast`
     71
     72    Avoid module names with more than two dots in the name.
     73    Example: instead of `r.to.rast3.elev` use `r.to.rast3elev`   
     74
     75
     7628. Use the grass test suite to test your modules.
     77
     78    http://www-pool.math.tu-berlin.de/~soeren/grass/GRASS_TestSuite
     79
     80    You can easily write specific tests for your modules.
     81
     82    If your module is part of GRASS and you created some standard test cases, please contact the developers to add your tests to the default test suite.  This will automatize complex test scenarios and assure to find bugs much faster, if changes were made to your modules or to the grass library.
     83
     84    Consider to subscribe to the GRASS Quality Assessment System to get immediate notification about the code quality:
     85
     86    http://lists.osgeo.org/mailman/listinfo/grass-qa
     87
     88
     8929. When submitting new files to the repository set SVN properties,
     90    usually for directory
     91{{{
     92      svn:ignore : *.tmp.html
     93                   *OBJ*
     94}}}
     95    or e.g. for C-file
     96{{{   
     97      svn:mime-type : text/x-csrc
     98      svn:keywords : Author Date Id
     99      svn:eol-style : native
     100}}}
     101    See
     102    http://svnbook.red-bean.com/en/1.4/svn.advanced.props.html
     103
     104    To set a property:
     105{{{
     106      svn propset svn:keywords 'Author Date Id' <file>
     107      svn propset svn:mime-type text/x-sh grass_shellscript.sh
     108}}}
     109    To edit the `svn:ignore` property using your default text editor:
     110{{{
     111      svn propedit svn:ignore <directory>
     112}}}
     113    To set the `svn:ignore` property non-interactively, first create a file containing the value:
     114{{{
     115      echo "*.tmp.html" > ignore.txt
     116      echo "*OBJ*" >> ignore.txt
     117}}}
     118    then use:
     119{{{
     120      svn propset -F ignore.txt svn:ignore <directory>
     121}}}
     122    List of mime-type:
     123{{{
     124      C++ files (.cpp): text/x-c++src
     125      C files (.c): text/x-csrc
     126      DTD files (.dtd): text/xml-dtd
     127      GIF files (.gif): image/gif
     128      Header files (.h): text/x-chdr
     129      HTML files (.html): text/html
     130      JPEG files (.jpg): image/jpeg
     131      Makefiles: text/x-makefile
     132      PNG files (.png): image/png
     133      Python files (.py): text/x-python
     134      Shell scripts (.sh): text/x-sh
     135      Text files (.txt): text/plain
     136      XML files (.xml): text/xml
     137}}}
     138      (please update the list...)
     139
     140    For your convenience use the source:grass-addons/tools/module_svn_propset.sh script.
     141
     142
     14331. If you need to add support for a different library in the 'configure' script, you should first seek consent in the grass-dev mailing list (see below), then you need to expand 'configure.in' and run subsequently `autoconf-2.13` (later versions will not work) to re-generate 'configure'.
     144
     145
     14632. Tell the other developers about the new code using the following e-mail:
     147    grass-dev@lists.osgeo.org
     148 
     149    To subscribe to this mailing list, see
     150    http://lists.osgeo.org/mailman/listinfo/grass-dev
     151
     152
     15333. In case of questions feel free to contact the developers at the above mailing list.[[BR]]
     154    http://grass.osgeo.org/development/
     155
     156...
     157
     158''[please add further hints if required]'''
     159
     160''Your attention to detail is appreciated.''