Fix 2 broken NOLINT's from clang-format change
authorejjordan <e.jjordan12@gmail.com>
Fri, 8 Nov 2019 19:49:25 +0000 (20:49 +0100)
committerejjordan <e.jjordan12@gmail.com>
Fri, 8 Nov 2019 19:53:28 +0000 (20:53 +0100)
Also made the clang format help text more useful and corrected an
incorrect documentation suggestion.

Change-Id: Ibd7706b3ea1a6adc2ab459fac818e093b64dac10

admin/clang-format.sh
src/gromacs/analysisdata/modules/plot.cpp
src/gromacs/commandline/pargs.cpp

index af3aec1f39b6b40197b2739674c1b04d479bbad9..ae8f61dfbde939d1e6441f8c0f9bdfd3d190ed4e 100755 (executable)
@@ -97,9 +97,11 @@ then
     fi
     if [ -z "$CLANG_FORMAT" ]
     then
-        echo "Please set the path to clang-format using CLANG_FORMAT or"
-        echo "git config hooks.clang_formatpath."
-        echo "See docs/dev-manual/clang-format.rst for how to get one."
+        echo "Please set the path to clang-format using the git hook"
+        echo "git config hooks.clang_formatpath /path/to/clang-format"
+        echo "or by setting an environment variable, e.g."
+        echo "CLANG_FORMAT=/path/to/clang-format"
+        echo "See docs/dev-manual/code-formatting.rst for how to get clang-format."
         exit 2
     fi
     if ! which "$CLANG_FORMAT" 1>/dev/null
index 8227e4aee8266be828e4b0827abe76f2732d4770..573dbd47043e9556739c781fdf9dd8106f3401dc 100644 (file)
@@ -308,8 +308,8 @@ void AbstractPlotModule::dataStarted(AbstractAnalysisData* /* data */)
         }
         else
         {
-            time_unit_t time_unit = static_cast<time_unit_t>(
-                    impl_->settings_.timeUnit() + 1); // NOLINT(bugprone-misplaced-widening-cast)
+            // NOLINTNEXTLINE(bugprone-misplaced-widening-cast)
+            time_unit_t       time_unit = static_cast<time_unit_t>(impl_->settings_.timeUnit() + 1);
             xvg_format_t      xvg_format = (impl_->settings_.plotFormat() > 0
                                                ? static_cast<xvg_format_t>(impl_->settings_.plotFormat())
                                                : exvgNONE);
index ac63ac6442c2edeb97538e0313300d61f1a405c8..31c10f4eda56939d6f82bddac674ff47f2d0c6c7 100644 (file)
@@ -553,9 +553,9 @@ gmx_bool parse_common_args(int*               argc,
         options.finish();
 
         /* set program name, command line, and default values for output options */
+        // NOLINTNEXTLINE(bugprone-misplaced-widening-cast)
         output_env_init(oenv, gmx::getProgramContext(), static_cast<time_unit_t>(timeUnit + 1),
-                        bView, // NOLINT(bugprone-misplaced-widening-cast)
-                        static_cast<xvg_format_t>(xvgFormat + 1), 0);
+                        bView, static_cast<xvg_format_t>(xvgFormat + 1), 0);
 
         /* Extract Time info from arguments */
         if (bBeginTimeSet)