Commit 7e307eaf authored by Francesco Witz's avatar Francesco Witz
Browse files

fix: tool rules editor validation checking for commit type removing

fix: tool rules editor subject length casting issue

fix: tool rules editor subject length casting issue

fix: tool rules editor subject length casting issue
parent 9781f58e
......@@ -272,11 +272,12 @@ def rules():
number = ""
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) ")
validation = ""
while validation == "" and not validation in ["y", "n"]:
validation = input("Do you really want to remove this standard commit type ? (y/n) ")
if validation == "y":
config["commit-type"].remove(config["commit-type"][int(number)-1])
if number != "q":
validation = ""
while validation == "" and not validation in ["y", "n"]:
validation = input("Do you really want to remove this standard commit type ? (y/n) ")
if validation == "y":
config["commit-type"].remove(config["commit-type"][int(number)-1])
elif option == "2":
# Ignored commit type edition
action = ""
......@@ -306,11 +307,12 @@ def rules():
number = ""
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) ")
validation = ""
while validation == "" and not validation in ["y", "n"]:
validation = input("Do you really want to remove this ignored commit type ? (y/n) ")
if validation == "y":
config["ignored-commit-type"].remove(config["ignored-commit-type"][int(number)-1])
if number != "q":
validation = ""
while validation == "" and not validation in ["y", "n"]:
validation = input("Do you really want to remove this ignored commit type ? (y/n) ")
if validation == "y":
config["ignored-commit-type"].remove(config["ignored-commit-type"][int(number)-1])
elif option == "3":
# Commit type case edition
print("\nPossible case:")
......@@ -356,7 +358,7 @@ def rules():
while new_length == "" and not new_length.isnumeric() and new_length != "q":
new_length = input("New subject length (q to quit): ")
if new_length != "q":
config['commit-subject-length'] = int(subject_length)
config['commit-subject-length'] = new_length
# Asking user if he wants to edit anything else
edition = ""
while edition == "" and not edition in ["y", "n"]:
......
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