blob: 481ee112698d31167e05df569023e43f357ef8b2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
#!/usr/bin/env python3
#
# Arm SCP/MCP Software
# Copyright (c) 2021-2022, Arm Limited and Contributors. All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
"""
Check pycodestyle
This script runs pycodestyle to check all python scripts.
"""
import sys
import subprocess
INCLUDE_DIRECTORIES = "tools/ unit_test/utils"
def banner(text):
columns = 80
title = " {} ".format(text)
print("\n\n{}".format(title.center(columns, "*")))
def main():
banner("Build and run PyCodeStyle tests")
result = subprocess.Popen(
"python -m pycodestyle {}".format(INCLUDE_DIRECTORIES),
shell=True,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
(stdout, stderr) = result.communicate()
print(stdout.decode())
if result.returncode != 0:
print(stderr.decode())
print('FAILED')
return 1
print('SUCCESS')
return 0
if __name__ == '__main__':
sys.exit(main())
|