mirror of
https://github.com/gabime/spdlog.git
synced 2025-09-28 09:09:35 +08:00
moved scripts into subdirectory
This commit is contained in:
6
scripts/clang_tidy.sh
Executable file
6
scripts/clang_tidy.sh
Executable file
@@ -0,0 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
cd "$(dirname "$0")"
|
||||
cd ..
|
||||
|
||||
clang-tidy example/example.cpp -- -I ./include
|
17
scripts/extract_version.py
Executable file
17
scripts/extract_version.py
Executable file
@@ -0,0 +1,17 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import os
|
||||
import re
|
||||
|
||||
base_path = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
|
||||
config_h = os.path.join(base_path, 'include', 'spdlog', 'version.h')
|
||||
data = {'MAJOR': 0, 'MINOR': 0, 'PATCH': 0}
|
||||
reg = re.compile(r'^\s*#define\s+SPDLOG_VER_([A-Z]+)\s+([0-9]+).*$')
|
||||
|
||||
with open(config_h, 'r') as fp:
|
||||
for l in fp:
|
||||
m = reg.match(l)
|
||||
if m:
|
||||
data[m.group(1)] = int(m.group(2))
|
||||
|
||||
print('{}.{}.{}'.format(data['MAJOR'], data['MINOR'], data['PATCH']))
|
13
scripts/format.sh
Executable file
13
scripts/format.sh
Executable file
@@ -0,0 +1,13 @@
|
||||
#!/bin/bash
|
||||
|
||||
cd "$(dirname "$0")"
|
||||
cd ..
|
||||
|
||||
echo -n "Running dos2unix "
|
||||
find . -name "*\.h" -o -name "*\.cpp"|grep -v bundled|xargs -I {} sh -c "dos2unix '{}' 2>/dev/null; echo -n '.'"
|
||||
echo
|
||||
echo -n "Running clang-format "
|
||||
find . -name "*\.h" -o -name "*\.cpp"|grep -v bundled|xargs -I {} sh -c "clang-format -i {}; echo -n '.'"
|
||||
echo
|
||||
|
||||
|
Reference in New Issue
Block a user