summaryrefslogtreecommitdiff
path: root/gr-utils/modtool/core/newmod.py
diff options
context:
space:
mode:
authorThomas Habets <thomas@habets.se>2020-05-03 20:32:21 +0100
committermormj <34754695+mormj@users.noreply.github.com>2020-07-14 10:08:42 -0400
commit7136f861dd700111999337f08bee9df3a3fadb11 (patch)
tree86f2312451f23181b650f77bd17648f3a31a81bd /gr-utils/modtool/core/newmod.py
parent5a7a46e27e5fa1effb0ead8914955b2ac8a2c180 (diff)
modtool: Run all generated C++ code through clang-format
Diffstat (limited to 'gr-utils/modtool/core/newmod.py')
-rw-r--r--gr-utils/modtool/core/newmod.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/gr-utils/modtool/core/newmod.py b/gr-utils/modtool/core/newmod.py
index a995b6e278..deeaf7e988 100644
--- a/gr-utils/modtool/core/newmod.py
+++ b/gr-utils/modtool/core/newmod.py
@@ -67,6 +67,11 @@ class ModToolNewModule(ModTool):
logger.info(f"Creating out-of-tree module in {self.dir}...")
try:
shutil.copytree(self.srcdir, self.dir)
+ try:
+ shutil.copyfile(os.path.join(gr.prefix(), 'share', 'gnuradio', 'clang-format.conf'),
+ os.path.join(self.dir, '.clang-format'))
+ except FileNotFoundError as e:
+ logger.info(f'Failed to copy .clang-format: {e}')
os.chdir(self.dir)
except OSError:
raise ModToolException(f'Could not create directory {self.dir}.')