Skip to content

Commit 459b956

Browse files
committed
[FIX] Fixed bug where nm would add '@' on functions calls on linux. Also fixed that you couldn't select --no-tests when not using fillit
Signed-off-by: Jules Lasne (seluj78) <jlasne@student.42.fr>
1 parent 4faf74d commit 459b956

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

42PyChecker.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,6 @@ def check_args_rules(parser, args):
5151
# disabled, no matter the project.
5252
if args.project == "other" and args.no_tests:
5353
parser.error("`--no-tests' Can only be applied on projects, not when 'other' is selected.")
54-
if args.no_tests:
55-
args.no_libftest = True
56-
args.no_maintest = True
57-
args.no_moulitest = True
58-
args.no_libft_unit_test = True
59-
args.no_fillit_checker = True
6054

6155
if args.no_author and args.project == "42commandements":
6256
parser.error("`--no-author' Can only be applied on project, but not on 42commandements.")
@@ -105,6 +99,12 @@ def check_args_rules(parser, args):
10599
if args.no_fillit_checker and args.project != "fillit":
106100
parser.error("`--no-fillit-checker' can only be applied if fillit is selected"
107101
" with `--project'")
102+
if args.no_tests:
103+
args.no_libftest = True
104+
args.no_maintest = True
105+
args.no_moulitest = True
106+
args.no_libft_unit_test = True
107+
args.no_fillit_checker = True
108108

109109

110110
def print_header():

PyChecker/utils/forbidden_functions.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,12 @@ def check(project_path: str, authorized_func, root_path: str):
4848
sys_calls = ['Error']
4949

5050
sys_calls = [item for item in sys_calls if not item.startswith("ft_")]
51+
if platform.system() == "Linux":
52+
for i, calls in enumerate(sys_calls):
53+
sys_calls[i] = calls.split('@', 1)[0]
5154
extra_function_call = [item for item in sys_calls if item not in authorized_func]
55+
print(sys_calls)
56+
print(authorized_func)
5257
with open(root_path + "/.myforbiddenfunctions", 'w+') as file:
5358
for item in extra_function_call:
5459
# This is to ignore functions like `__stack_chk_fail'

0 commit comments

Comments
 (0)