Skip to content

Commit 9e7b4f2

Browse files
author
rootware
committed
named func args properly
1 parent a95bab4 commit 9e7b4f2

File tree

4 files changed

+10
-11
lines changed

4 files changed

+10
-11
lines changed

pyredactkit/core_redactor.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def __init__(self) -> None:
3535
"""
3636
return None
3737

38-
def redact_all(self, line=str) -> tuple:
38+
def redact_all(self, line: str) -> tuple:
3939
"""Function to redact specific option
4040
Args:
4141
line (str) : line to be supplied to redact
@@ -55,7 +55,7 @@ def redact_all(self, line=str) -> tuple:
5555
line = re.sub(redact_pattern, masked_data, line)
5656
return line, hash_map
5757

58-
def process_text(self, text=str, savedir="./"):
58+
def process_text(self, text: str, savedir="./"):
5959
"""Function to process supplied text from cli.
6060
Args:
6161
text (str): string to redact
@@ -83,7 +83,7 @@ def process_text(self, text=str, savedir="./"):
8383
print(
8484
f"[+] Redacted and results saved to {os.path.basename(generated_file)}")
8585

86-
def process_core_file(self, filename, savedir="./"):
86+
def process_core_file(self, filename: str, savedir="./"):
8787
"""Function to process supplied file from cli.
8888
Args:
8989
filename (str): File to redact

pyredactkit/custom_redactor.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def __init__(self) -> None:
2929
"""
3030
return None
3131

32-
def read_custom_patterns(self, custom_file) -> list:
32+
def read_custom_patterns(self, custom_file: str) -> list:
3333
'''Load Rules
3434
Loads either a default ruleset or a self defined ruleset.
3535
Rules are loaded to patterns variable
@@ -46,12 +46,11 @@ def read_custom_patterns(self, custom_file) -> list:
4646
except json.JSONDecodeError:
4747
sys.exit("[-] Issue decoding json file. This might be an error with your regex pattern.")
4848

49-
def redact_custom(self, line=str, customfile=str) -> tuple:
49+
def redact_custom(self, line: str, customfile: str) -> tuple:
5050
"""Function to redact custom option
5151
Args:
5252
line (str) : line to be supplied to redact
53-
option (str): (optional) choice for redaction
54-
filename (str): name of supplied file
53+
customfile (str): (optional) choice for redaction
5554
5655
Returns:
5756
line (str): redacted line
@@ -69,7 +68,7 @@ def redact_custom(self, line=str, customfile=str) -> tuple:
6968
line = re.sub(redact_pattern, masked_data, line)
7069
return line, kv_pairs
7170

72-
def process_custom_file(self, file_name, customfile=str, make_dir="./"):
71+
def process_custom_file(self, file_name: str, customfile: str, make_dir="./"):
7372
"""Function to process supplied file with custom regex file from cli.
7473
Args:
7574
file_name (str): File to redact

pyredactkit/identifiers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class Identifier:
4545
def __init__(self) -> None:
4646
return None
4747

48-
def names(self, data) -> list:
48+
def names(self, data: str) -> list:
4949
""" Identify names and return them from the supplied data
5050
Args:
5151
data (str): data in alpha-numeric format

pyredactkit/unredact.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def __init__(self) -> None:
2020
None
2121
"""
2222

23-
def replace_all(self, text, dictionary) -> str:
23+
def replace_all(self, text: str, dictionary: dict) -> str:
2424
"""Function to replace all the text from string
2525
Args:
2626
text (str): A line of text in string format
@@ -33,7 +33,7 @@ def replace_all(self, text, dictionary) -> str:
3333
text = text.replace(k, v)
3434
return text
3535

36-
def unredact(self, redacted_file=str, lookup_file=str) -> None:
36+
def unredact(self, redacted_file: str, lookup_file: str) -> None:
3737
"""Function to unredact masked data and produces original unredacted data.
3838
Args:
3939
redacted_file (str): Name of the redacted file

0 commit comments

Comments
 (0)