IAP GITLAB

Skip to content
Snippets Groups Projects
Commit 302ecef0 authored by ralfulrich's avatar ralfulrich
Browse files

clang-format

parent 7fac117c
No related branches found
No related tags found
No related merge requests found
File moved
......@@ -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:
......
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment