Skip to content

Commit 24b3818

Browse files
committed
STAGE
1 parent 459b956 commit 24b3818

File tree

3 files changed

+22
-9
lines changed

3 files changed

+22
-9
lines changed

42PyChecker.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,4 +202,5 @@ def main():
202202
except KeyboardInterrupt:
203203
sys.exit(1)
204204
else:
205-
raise OSError("Sorry, this script can't be run on windows !")
205+
#raise OSError("Sorry, this script can't be run on windows !")
206+
main()

PyChecker/testing_suite/fillit_checker.py

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,20 @@
55

66
import subprocess
77
from PyChecker.utils import git
8+
import re
9+
import os
10+
11+
12+
def clean_log(root_path: str):
13+
with open(root_path + '/.myfillitchecker-clean', 'w+') as file2:
14+
with open(root_path + '/.myfillitchecker', 'r') as file:
15+
for line in file:
16+
line = re.sub(r"\033\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]/", "", line)
17+
file2.write(line)
18+
print(line)
19+
#os.rename(root_path + '/.myfillitchecker-clean', root_path + '/.myfillitchecker')
20+
#return
21+
822

923
def run(root_path: str, project_path: str):
1024
"""
@@ -25,9 +39,9 @@ def run(root_path: str, project_path: str):
2539
result = subprocess.run(['bash', root_path + "/testing_suites/fillit_checker/test.sh", project_path], stdout=subprocess.PIPE, stderr=subprocess.STDOUT).stdout.decode('utf-8')
2640
with open(root_path + '/.myfillitchecker', 'w+') as file:
2741
file.write(result)
28-
result = subprocess.run(['bash', root_path + '/scripts/clean_logfiles.sh', root_path + '/.myfillitchecker'], stdout=subprocess.PIPE, stderr=subprocess.STDOUT).stdout.decode('utf-8')
29-
with open(root_path + '/.myfillitchecker', 'r') as file:
30-
print(file.read())
31-
for line in file:
32-
if "NOTE" in line:
33-
return line
42+
clean_log(root_path)
43+
#with open(root_path + '/.myfillitchecker', 'r') as file:
44+
# print(file.read())
45+
# for line in file:
46+
# if "NOTE" in line:
47+
# return line

PyChecker/utils/forbidden_functions.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,6 @@ def check(project_path: str, authorized_func, root_path: str):
5252
for i, calls in enumerate(sys_calls):
5353
sys_calls[i] = calls.split('@', 1)[0]
5454
extra_function_call = [item for item in sys_calls if item not in authorized_func]
55-
print(sys_calls)
56-
print(authorized_func)
5755
with open(root_path + "/.myforbiddenfunctions", 'w+') as file:
5856
for item in extra_function_call:
5957
# This is to ignore functions like `__stack_chk_fail'

0 commit comments

Comments
 (0)