Skip to content

Commit 3daa905

Browse files
authored
refactor: added type hints to csv2cve (#1636)
1 parent 4f3538e commit 3daa905

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

cve_bin_tool/csv2cve.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
# Copyright (C) 2021 Intel Corporation
22
# SPDX-License-Identifier: GPL-3.0-or-later
33

4+
import logging
45
import os
56
import sys
7+
from typing import List, Optional
68

79
from cve_bin_tool import cli
810
from cve_bin_tool.error_handler import ErrorHandler, InsufficientArgs, excepthook
@@ -11,14 +13,14 @@
1113
sys.excepthook = excepthook
1214

1315

14-
def main(argv=None):
15-
logger = LOGGER.getChild("CSV2CVE")
16-
argv = argv or sys.argv
16+
def main(argv: Optional[List[str]] = None):
17+
logger: logging.Logger = LOGGER.getChild("CSV2CVE")
18+
argv: List[str] = argv or sys.argv
1719
if len(argv) < 2:
1820
with ErrorHandler(logger=logger):
1921
raise InsufficientArgs("csv file required")
2022

21-
flag = False
23+
flag: bool = False
2224
for idx, arg in enumerate(argv):
2325
if arg.endswith(".csv"):
2426
argv[idx] = f"-i={arg}"

0 commit comments

Comments
 (0)