Suppress remaining errors from copyright script
authorTeemu Murtola <teemu.murtola@gmail.com>
Sat, 7 Dec 2013 18:37:25 +0000 (20:37 +0200)
committerGerrit Code Review <gerrit@gerrit.gromacs.org>
Wed, 1 Jan 2014 11:23:49 +0000 (12:23 +0100)
- Add a mechanism to the script that allows it to be used only for
  uncrustification, but not for copyright checking for certain files.
- Use the mechanism to suppress copyright checking for thread_mpi files.
  It's somewhat unclear whether we should just prepend the Gromacs
  copyright to these files and get rid of this exception, or whether we
  still are planning to maintain the library separately.  But until that
  is clear, this keeps the script quiet, and the copyright headers need
  to be manually maintained if desired.
- Suppress a few files that don't have any copyright header.
- Add copyright header to two source files that were still missing it.

With these changes, running admin/copyright.py on all files indicated by
.gitattributes only produces messages about outdated copyright years
(which it should, for files that have not been modified this year).

Part of #818.

Change-Id: I2cb09b2b30e782244c16faf02625d405dac642b6

.gitattributes
admin/uncrustify.sh
src/gromacs/gmxlib/gmx_random_gausstable.h
src/gromacs/gmxlib/physics_test.c

index 1b6e057703a0819735f1cd335a5b6105d3ab9d11..460b13cbd0fb8cb1e86b6f8c8b3a2bf1214feb54 100644 (file)
@@ -24,9 +24,14 @@ cmake/*.c.cmakein                       !filter
 doxygen/*.cmakein                       !filter
 doxygen/*.cpp                           !filter
 manual/UseLATEX.cmake                   !filter
+scripts/GMXRC.*                         !filter
+scripts/make_gromos_rtp.py              !filter
 src/contrib/*                           !filter
 src/gromacs/gmxlib/gpu_utils/memtestG80_core.h             !filter
 src/gromacs/gmxlib/nonbonded/preprocessor/gmxpreprocess.py !filter
+**/thread_mpi/**                        filter=uncrustify_only
+src/gromacs/legacyheaders/thread_mpi.h  filter=uncrustify_only
+src/gromacs/legacyheaders/tmpi.h        filter=uncrustify_only
 src/gromacs/linearalgebra/gmx_blas/*    !filter
 src/gromacs/linearalgebra/gmx_lapack/*  !filter
 src/gromacs/selection/parser.cpp        !filter
index cbabff6cfeb451500b977631de0533d7225922f4..bd7c83f71a734588e5219043cf1996fdac9cfcbe 100755 (executable)
@@ -83,7 +83,8 @@
 # set as "uncrustify" (or something ending in "uncrustify") are processed: if
 # other files have been changed, they are ignored by the script.  Files passed
 # to uncrustify, as well as files with filter "copyright", get their copyright
-# header checked.
+# header checked.  To only run uncrustify for a file, set the filter to
+# "uncrustify_only".
 #
 # If you want to run uncrustify automatically for changes you make, there are
 # two options:
@@ -197,9 +198,12 @@ cut -f2 <$tmpdir/difflist | \
     git check-attr --stdin filter | \
     sed -e 's/.*: filter: //' | \
     paste $tmpdir/difflist - | \
-    grep -E '(uncrustify|copyright)$' >$tmpdir/filtered
+    grep -E '(uncrustify|uncrustify_only|copyright)$' >$tmpdir/filtered
 cut -f2 <$tmpdir/filtered >$tmpdir/filelist_all
-grep 'uncrustify$' <$tmpdir/filtered | cut -f2 >$tmpdir/filelist_uncrustify
+grep -E '(uncrustify|uncrustify_only)$' <$tmpdir/filtered | \
+    cut -f2 >$tmpdir/filelist_uncrustify
+grep 'copyright$' <$tmpdir/filtered | \
+    cut -f2 >$tmpdir/filelist_copyright
 git diff-files --name-only | grep -Ff $tmpdir/filelist_all >$tmpdir/localmods
 
 # Extract changed files to a temporary directory
@@ -267,7 +271,7 @@ if [[ $copyright_mode != "off" ]] ; then
     fi
     # TODO: Probably better to invoke python explicitly through a customizable
     # variable.
-    if ! $admin_dir/copyright.py -F $tmpdir/filelist_all $cpscript_args >>$tmpdir/messages
+    if ! $admin_dir/copyright.py -F $tmpdir/filelist_copyright $cpscript_args >>$tmpdir/messages
     then
         echo "Copyright checking failed!"
         rm -rf $tmpdir
index 7dcf9ee774754fe4d854ae1e30bf8750fffbbc68..18a3cac6b1b31e6a52eeb7392088869c15c135b1 100644 (file)
@@ -1,4 +1,37 @@
-
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 2004, by the GROMACS development team, led by
+ * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
+ * and including many others, as listed in the AUTHORS file in the
+ * top-level source directory and at http://www.gromacs.org.
+ *
+ * GROMACS is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
+ * of the License, or (at your option) any later version.
+ *
+ * GROMACS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with GROMACS; if not, see
+ * http://www.gnu.org/licenses, or write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
+ *
+ * If you want to redistribute modifications to GROMACS, please
+ * consider that scientific software is very special. Version
+ * control is crucial - bugs must be traceable. We will be happy to
+ * consider code for inclusion in the official distribution, but
+ * derived work must not be called official GROMACS. Details are found
+ * in the README & COPYING files - if they are missing, get the
+ * official version at http://www.gromacs.org.
+ *
+ * To help us fund GROMACS development, we humbly ask that you cite
+ * the research papers on the package. Check out http://www.gromacs.org.
+ */
 /* 14-bit table for fast gaussian lookup.
  * To be included in gmx_random.c
  */
index 0cb4f65f7218616bf8427ccc850de022f3fd1bf3..7382cd2e71241f4d6221156f45d45ab9265a8497 100644 (file)
@@ -1,3 +1,37 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 2010, by the GROMACS development team, led by
+ * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
+ * and including many others, as listed in the AUTHORS file in the
+ * top-level source directory and at http://www.gromacs.org.
+ *
+ * GROMACS is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
+ * of the License, or (at your option) any later version.
+ *
+ * GROMACS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with GROMACS; if not, see
+ * http://www.gnu.org/licenses, or write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
+ *
+ * If you want to redistribute modifications to GROMACS, please
+ * consider that scientific software is very special. Version
+ * control is crucial - bugs must be traceable. We will be happy to
+ * consider code for inclusion in the official distribution, but
+ * derived work must not be called official GROMACS. Details are found
+ * in the README & COPYING files - if they are missing, get the
+ * official version at http://www.gromacs.org.
+ *
+ * To help us fund GROMACS development, we humbly ask that you cite
+ * the research papers on the package. Check out http://www.gromacs.org.
+ */
 #include <stdio.h>
 #include "physics.h"