diff options
author | Brett Warren <brett.warren@arm.com> | 2022-02-22 23:10:55 +0000 |
---|---|---|
committer | tarek-arm <56722698+tarek-arm@users.noreply.github.com> | 2022-06-28 14:08:00 +0100 |
commit | db606087c41bf98b54190392d01634275c08ab44 (patch) | |
tree | 804b5c12ecec1ed2b042ce8674b35cfad869cd6a /tools | |
parent | 29dd031e5c44c5dca3beb31086b4beba4130919b (diff) |
tools: exclude test mock directories
Upcoming unit testing patches autogenerate mock
files which shouldn't be subject to the usual code style
checks. Module-specific mocks will be held in "module/*/test/mocks",
so an expanded glob is used to exclude all of these
directories.
Signed-off-by: Brett Warren <brett.warren@arm.com>
Change-Id: I840ebce8d14344d625476cde9fd1fd71501af475
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/check_copyright.py | 7 | ||||
-rwxr-xr-x | tools/check_spacing.py | 7 | ||||
-rwxr-xr-x | tools/check_tabs.py | 9 |
3 files changed, 19 insertions, 4 deletions
diff --git a/tools/check_copyright.py b/tools/check_copyright.py index 724262fa6dcb..ff987f2dc8ef 100755 --- a/tools/check_copyright.py +++ b/tools/check_copyright.py @@ -19,18 +19,23 @@ import re import sys import datetime import subprocess +import glob from itertools import islice # # Directories to exclude # + +# Exclude all mod_test "mocks" directories +UNIT_TEST_MOCKS = glob.glob("module/*/test/mocks") + EXCLUDE_DIRECTORIES = [ '.git', 'build', 'contrib/cmsis/git', "contrib/run-clang-format/git", 'product/rcar/src/CMSIS-FreeRTOS', -] +] + UNIT_TEST_MOCKS # # Supported file types diff --git a/tools/check_spacing.py b/tools/check_spacing.py index fdb6978751aa..67e19b6846d0 100755 --- a/tools/check_spacing.py +++ b/tools/check_spacing.py @@ -16,11 +16,16 @@ import subprocess import sys import tempfile import fnmatch +import glob # # Directories to exclude # + +# Exclude all mod_test "mocks" directories +UNIT_TEST_MOCKS = glob.glob("module/*/test/mocks") + EXCLUDE_DIRECTORIES = [ '.git', 'build', @@ -28,7 +33,7 @@ EXCLUDE_DIRECTORIES = [ 'contrib/cmsis/git', "contrib/run-clang-format/git", 'product/rcar/src/CMSIS-FreeRTOS', -] +] + UNIT_TEST_MOCKS # # Exclude patterns (applied to files only) diff --git a/tools/check_tabs.py b/tools/check_tabs.py index 9d862c860911..28e3125fb45e 100755 --- a/tools/check_tabs.py +++ b/tools/check_tabs.py @@ -1,7 +1,7 @@ #!/usr/bin/env python3 # # Arm SCP/MCP Software -# Copyright (c) 2015-2021, Arm Limited and Contributors. All rights reserved. +# Copyright (c) 2015-2022, Arm Limited and Contributors. All rights reserved. # # SPDX-License-Identifier: BSD-3-Clause # @@ -16,17 +16,22 @@ import subprocess import sys import tempfile import fnmatch +import glob # # Directories to exclude # + +# Exclude all mod_test "mocks" directories +UNIT_TEST_MOCKS = glob.glob("module/*/test/mocks") + EXCLUDE_DIRECTORIES = [ '.git', 'build', 'contrib/cmsis/git', "contrib/run-clang-format/git", 'product/rcar/src/CMSIS-FreeRTOS', -] +] + UNIT_TEST_MOCKS # # Exclude patterns (applied to files only) |