Skip to content

Commit e2d8c7b

Browse files
committed
[CHORE] Changed todos for the bot
1 parent 5953e21 commit e2d8c7b

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

42PyChecker.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def check_author_file(project_path: str):
1313
2 if there's too many lines in the file,
1414
3 if the newline char is missing in the end of line
1515
"""
16-
# @todo: Add a skip if author file set as optional
16+
# @todo: Add a skip, Add message if author file is set as optional and handle multiple authors
1717
author_fr = project_path + "/auteur"
1818
author_us = project_path + "/author"
1919
if os.path.exists(author_fr):
@@ -24,22 +24,22 @@ def check_author_file(project_path: str):
2424
author = "us"
2525
else:
2626
print("Author file not found")
27-
return 1 # @todo Add message if author file is set as optional
27+
return 1
2828
if count != 1:
2929
print("Too many lines in author file (Or the file is empty)")
30-
return 2 # @todo Add message if author file is set as optional or if project isn't solo
30+
return 2
3131
if author == "fr":
3232
with open(author_fr, 'r') as file:
3333
content = file.read()
3434
if "\n" not in content:
3535
print("Missing <newline> character at the end of line")
36-
return 3 # @todo: Add message if author file is set as optional and handle multiple authors
36+
return 3
3737
elif author == "us":
3838
with open(author_us, 'r') as file:
3939
content = file.read()
4040
if "\n" not in content:
4141
print("Missing <newline> character at the end of line")
42-
return 3 # @todo: Add message if author file is set as optional and handle multiple authors
42+
return 3
4343
return 0
4444

4545

@@ -95,7 +95,7 @@ def check_makefile(project_path: str, binary_name: str):
9595
file.write(result + '\n')
9696
if os.path.exists(project_path + '/' + binary_name):
9797
file.write("-> Error when processing rule `fclean': It should have removed {}\n".format(binary_name))
98-
#return 2 @todo: Here it doesnt return, it will just add more errors to the error counter
98+
#return 2 @todo: Add an error counter
9999
if glob.glob(project_path + '*.o'):
100100
file.write("-> Error when processing rule `fclean': It should have removed *.o\n")
101101
#return 3
@@ -111,7 +111,7 @@ def check_makefile(project_path: str, binary_name: str):
111111
file.write("-> Error when processing rule `fclean': It should have created {}\n".format(binary_name))
112112
if not glob.glob(project_path + '/*.o'):
113113
file.write("-> Error when processing rule `fclean': It should NOT have removed *.o\n")
114-
# todo: [ -z "$(echo ${MAKEALLTWICE} | grep -i "Nothing to be done")" -a -z "$(echo ${MAKEALLTWICE} | grep -i "is up to date")" ] && printf "%s\n" "-> Failing rule: Processing the rule 'all' twice in a row should result in nothing to be done" && RET=1
114+
# @todo: [ -z "$(echo ${MAKEALLTWICE} | grep -i "Nothing to be done")" -a -z "$(echo ${MAKEALLTWICE} | grep -i "is up to date")" ] && printf "%s\n" "-> Failing rule: Processing the rule 'all' twice in a row should result in nothing to be done" && RET=1
115115

116116
file.write("*------------------------------------------------------*\n")
117117
file.write("Checking rule: `clean'\n")
@@ -169,7 +169,7 @@ def check_makefile(project_path: str, binary_name: str):
169169
file.write("--> Error when processing rule `re': It should have compiled a binary named {}\n".format(binary_name))
170170
if not glob.glob(project_path + '/*.o'):
171171
file.write("-> Error when processing rule `fclean': It should NOT have removed *.o\n")
172-
# @todo : [ -z "$(echo ${MAKEALLTWICE} | grep -i "Nothing to be done")" -a -z "$(echo ${MAKEALLTWICE} | grep -i "is up to date")" ] && printf "%s\n" "-> Failing rule: Processing the rule 'all' twice in a row should result in nothing to be done" && RET=1
172+
# @todo: [ -z "$(echo ${MAKEALLTWICE} | grep -i "Nothing to be done")" -a -z "$(echo ${MAKEALLTWICE} | grep -i "is up to date")" ] && printf "%s\n" "-> Failing rule: Processing the rule 'all' twice in a row should result in nothing to be done" && RET=1
173173

174174
file.write("*------------------------------------------------------*\n")
175175
file.write("Checking rule: `.PHONY'\n")
@@ -263,7 +263,7 @@ def check_libft(project_path: str):
263263
with open(os.path.dirname(os.path.realpath(__file__)) + "/.mystatic", 'w+') as file:
264264
result = subprocess.run(['sh', 'check_static.sh', project_path], stdout=subprocess.PIPE).stdout.decode('utf-8')
265265
file.write(result)
266-
check_makefile(project_path, "libft.a") # @todo: Have number of errors printed for makefile check
266+
check_makefile(project_path, "libft.a")
267267
check_forbidden_functions(project_path, "libft.a")
268268
#moulitest
269269
#libft-unit-test

0 commit comments

Comments
 (0)