[gdal-dev] Automating code style enforcement ?

Even Rouault even.rouault at spatialys.com
Thu May 4 13:49:40 PDT 2017


Hi,

I've observed Kurt's continued efforts, over several months if not years, to set a consistant 
style to the code base and this is a much appreciated initiative. Now, as this touches the 
whole code base, I think this should be formalized, probably under the form of a RFC, so that 
this is shared among all developers. Currently as there's no automation, basically every 
committer will probably unconsciously "break" files that have been already reformatted, 
which is a waste of time that could be avoided (and on a minor note we could save extra 
reformatting commits that are noise in the history, and extra bits to parse for the human 
preparing a changelog)

I've seen in other projects, like QGIS, a script (in QGIS, they rely on astyle ultimately. not 
saying we should necessary use astyle) that takes care of reformatting automatically the files 
to be committed given the rules. That way the effort is spread on all contributors (and it is 
not a big deal to run this script). We could also have in Travis-CI a check so that pull requests 
are verified to respect the style (currently, we have already a very adhoc scripts/
detect_tabulations.sh to check that no tabulation characters are used)

Even

-- 
Spatialys - Geospatial professional services
http://www.spatialys.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20170504/69a49ce1/attachment.html>


More information about the gdal-dev mailing list