-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathcheck.py
42 lines (36 loc) · 1.79 KB
/
check.py
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
import os
from UPDATE_DOC import Files
def main():
# welcome message
print("Preparing the repository for commit.".center(50, "*"))
print("\nFolder/File naming format checking . . . . . . . .")
ff = Files()
data = (ff.get_all_valid_folder_files_dict(os.getcwd()))
if "ERROR" in data:
# show relevent error message
# if error with the folder name
if data["target"] == "folder":
# show error message and relavent error(RESTRICTED_CHAR)
print(f"Wrong folder naming. \nYou have used \"", data["ERROR"], "\" in your folder name", sep="")
# show the folder name with error
print("->", data["name"])
# if error with file name
else:
# show error message and relavent error(RESTRICTED_CHAR)
print(f"Wrong file naming. \nYou have used \"", data["ERROR"], "\" in your folder name", sep="")
# show the file name with error
print("->", data["name"])
print("\nChecking process ended with error!")
else:
print("Checking process ended. All Folder/File names are seems good!\nYou are ready to commit and push/pull request")
# ending message
print("\nSome key points to remember:")
print("* make sure you are running this program just before the commit.\n\
* DOCUMENTATION.md will be auto updated after your pull request accepted.\n\
* do not modify this program. this is build to reduce your effort.\n\
* if you find any bug/suggestion feel free to submit an issue at\n\
https://github.com/mursalatul/code-park/issues/new \n\
* see the CONTRUBUTION.md(https://github.com/mursalatul/code-park/blob/master/CONTENT/CONTRIBUTE.md)\n\
if you are confused about contributing in this project.\n")
if __name__ == '__main__':
main()