[gdal-dev] cppcheck

Kurt Schwehr schwehr at gmail.com
Wed Nov 23 07:09:43 PST 2016


I definitely want to add some checks to that script!

A lot of what I'm doing is just reading through the code.  I have been
taking notes in hopes that I can convert some of the grep's that I do into
the script.  Right now, most of them are super high on the false positive
side of things.  e.g.

find . -name \*.cpp | xargs egrep 'TRUE|FALSE'

I also have been running a really old version of cppcheck.  It's pretty
clear that cppcheck 1.60.1 is much weaker than the current head.

I did just commit my play version of a clang-format config file that
loosely matches GDAL style.  It definitely needs help/discussion...  I had
put it in a gist, but better to get it into the code base where it might be
seen by more interested folks.  If we can make a config file that works for
the project, authors will be free to write in whatever style they want and
then just transform to GDALs style for commit.  On other projects, I
personally write some pretty sloppily formatted code and use clang-format
to get it more readable before submitting.  I know people who use
clang-format to convert files to their prefered style for editing and then
convert it back to a project's style for all edits.

https://trac.osgeo.org/gdal/changeset/36467

-k

On Wed, Nov 23, 2016 at 6:28 AM, Even Rouault <even.rouault at spatialys.com>
wrote:

> On mercredi 23 novembre 2016 05:43:44 CET Kurt Schwehr wrote:
>
> > Even,
>
> >
>
> > Thank you for your work with getting cppcheck setup and fixing a huge
>
> > number of warnings (and suppressing a large number of false positives)!!!
>
>
>
> I encourage you as well to extend the tooling so as to check that all the
> cleanups you do do not regress. I guess you must have some ad-hoc scripts.
> If there were available, that would at least enable new developments to
> meet those standards. And if they don't pass on the whole code base, I
> guess it would be possible to run them on white-listed directories (or
> exclude black-listed directories)
>
>
>
> QGIS has a scripts/prepare-commit.sh that handles mostly code formatting
> (reformatting it automatically), but something similar that would handle
> formatting and/or other checks could be useful.
>
>
>
> Even
>
>
>
> --
>
> Spatialys - Geospatial professional services
>
> http://www.spatialys.com
>



-- 
--
http://schwehr.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20161123/6d5cb7fd/attachment-0001.html>


More information about the gdal-dev mailing list