Commit 9781f58e authored by Francesco Witz's avatar Francesco Witz
Browse files

fix: tool rules editor integer cast error

fix: tool rules editor validation checking for commit type removing

fix: tool rules editor validation checking for commit type removing
parent 27f7adb3
...@@ -267,16 +267,16 @@ def rules(): ...@@ -267,16 +267,16 @@ def rules():
print("\nStandard commit type:") print("\nStandard commit type:")
index = 1 index = 1
for e in commit_type: for e in commit_type:
print(" " + index + ". " + e[0] + ": " + e[1]) print(" " + str(index) + ". " + e[0] + ": " + e[1])
index +=1 index +=1
number = "" number = ""
while number == "" and not number in [str(i) for i in range(1, len(config['commit-type'])+1)] and number != "q": while number == "" and not number in [str(i) for i in range(1, len(config['commit-type'])+1)] and number != "q":
number = input("\nWhich standard commit type do you want to remove ? (q to quit) ") number = input("\nWhich standard commit type do you want to remove ? (q to quit) ")
validation = "" validation = ""
while validation == "" and not validation in ["y", "n"]: while validation == "" and not validation in ["y", "n"]:
validatiion = input("Do you really want to remove this standard commit type ? (y/n) ") validation = input("Do you really want to remove this standard commit type ? (y/n) ")
if validation == "y": if validation == "y":
config["commit-type"].remove(config["commit-type"][int(number)]) config["commit-type"].remove(config["commit-type"][int(number)-1])
elif option == "2": elif option == "2":
# Ignored commit type edition # Ignored commit type edition
action = "" action = ""
...@@ -301,16 +301,16 @@ def rules(): ...@@ -301,16 +301,16 @@ def rules():
print("\nIgnored commit type:") print("\nIgnored commit type:")
index = 1 index = 1
for e in ignored_commit_type: for e in ignored_commit_type:
print(" " + index + ". " + e[0] + ": " + e[1]) print(" " + str(index) + ". " + e[0] + ": " + e[1])
index +=1 index +=1
number = "" number = ""
while number == "" and not number in [str(i) for i in range(1, len(config['ignored-commit-type'])+1)] and number != "q": while number == "" and not number in [str(i) for i in range(1, len(config['ignored-commit-type'])+1)] and number != "q":
number = input("\nWhich ignored commit type do you want to remove ? (q to quit) ") number = input("\nWhich ignored commit type do you want to remove ? (q to quit) ")
validation = "" validation = ""
while validation == "" and not validation in ["y", "n"]: while validation == "" and not validation in ["y", "n"]:
validatiion = input("Do you really want to remove this ignored commit type ? (y/n) ") validation = input("Do you really want to remove this ignored commit type ? (y/n) ")
if validation == "y": if validation == "y":
config["ignored-commit-type"].remove(config["ignored-commit-type"][int(number)]) config["ignored-commit-type"].remove(config["ignored-commit-type"][int(number)-1])
elif option == "3": elif option == "3":
# Commit type case edition # Commit type case edition
print("\nPossible case:") print("\nPossible case:")
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment