From 302ecef0a5b3d283aab213905ec7b1faba0ff8f6 Mon Sep 17 00:00:00 2001 From: ralfulrich <ralf.ulrich@kit.edu> Date: Sat, 1 May 2021 14:30:42 +0200 Subject: [PATCH] clang-format --- {CMakeModules => cmake}/FindCONEX.cmake | 0 .../framework/process/ContinuousProcessIndex.hpp | 6 +----- do-clang-format.py | 13 ++++++++++++- 3 files changed, 13 insertions(+), 6 deletions(-) rename {CMakeModules => cmake}/FindCONEX.cmake (100%) diff --git a/CMakeModules/FindCONEX.cmake b/cmake/FindCONEX.cmake similarity index 100% rename from CMakeModules/FindCONEX.cmake rename to cmake/FindCONEX.cmake diff --git a/corsika/framework/process/ContinuousProcessIndex.hpp b/corsika/framework/process/ContinuousProcessIndex.hpp index a31539a3f..7192b86bf 100644 --- a/corsika/framework/process/ContinuousProcessIndex.hpp +++ b/corsika/framework/process/ContinuousProcessIndex.hpp @@ -24,11 +24,7 @@ namespace corsika { : id_(id) {} void setIndex(int const id) { id_ = id; } int getIndex() const { return id_; } - bool operator==(ContinuousProcessIndex - - const v) const { - return id_ == v.id_; - } + bool operator==(ContinuousProcessIndex const v) const { return id_ == v.id_; } bool operator!=(ContinuousProcessIndex const v) const { return id_ != v.id_; } private: diff --git a/do-clang-format.py b/do-clang-format.py index d6ea59753..fcfe67411 100755 --- a/do-clang-format.py +++ b/do-clang-format.py @@ -10,6 +10,7 @@ import os import sys import re +debug = False do_progress = False try: from progress.bar import ChargingBar @@ -77,6 +78,9 @@ else: filelist_clean.append(f) filelist = filelist_clean +if debug: + print ("filelist: ", filelist) + cmd = "clang-format" if "CLANG_FORMAT" in os.environ: cmd = os.environ["CLANG_FORMAT"] @@ -99,11 +103,18 @@ if do_progress: bar = ChargingBar('Processing', max=len(filelist)) if args.apply: + changed = [] for filename in filelist: if bar: bar.next() + a = open(filename, "rb").read() subp.check_call(cmd.split() + ["-i", filename]) + b = open(filename, "rb").read() + if a != b: + changed.append(filename) if bar: bar.finish() - + if debug: + print ("changed: ", changed) + else: # only print files which need formatting files_need_formatting = 0 -- GitLab