From 4f26b9bfee6b17c9a3335a417a96124cc5cd49bf Mon Sep 17 00:00:00 2001 From: collin Date: Tue, 9 Feb 2021 14:53:49 -0500 Subject: remove format_src.py, instead use check_style.sh --- tools/infrastructure/format_src.py | 37 ------------------------------------- 1 file changed, 37 deletions(-) delete mode 100644 tools/infrastructure/format_src.py diff --git a/tools/infrastructure/format_src.py b/tools/infrastructure/format_src.py deleted file mode 100644 index b7927b2708..0000000000 --- a/tools/infrastructure/format_src.py +++ /dev/null @@ -1,37 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -""" -Format all sources with clang-format. All *.cc and *h in the src dir -are affected. Excluded from formatting sources in the "3rd_party" and -in the "3rd_party-static" dirs. For the formatting used ".clang-format" -in the project root. -""" - -import os -from utils import setup_working_dir, walk_dir, run_cmd -import re - - -INCLUDE_PATTERNS = ['^.*\.cc$', '^.*\.h$', '^.*\.cpp$', '^.*\.hpp$'] -EXCLUDE_PATTERNS = ['^.*3rd_party.*$'] -FORMAT_CMD = 'clang-format -i -style=file {}' - - -def main(): - ''' Main logic ''' - setup_working_dir() - print 'Current working dir is {}'.format(os.getcwd()) - - def action(file_path): - if re.match('|'.join(INCLUDE_PATTERNS), file_path, re.M | re.I): - if not re.match('|'.join(EXCLUDE_PATTERNS), - file_path, - re.M | re.I): - print 'Formatting file {}'.format(file_path) - run_cmd(FORMAT_CMD.format(file_path)) - walk_dir('src', action) - - -if __name__ == '__main__': - main() -- cgit v1.2.1