Skip to content

Commit 389712b

Browse files
matttbekuba-moo
authored andcommitted
tools: ynl: remove unused imports
These imports are not used according to Ruff, and can be safely removed. This is linked to Ruff error F401 [1]: Unused imports add a performance overhead at runtime, and risk creating import cycles. They also increase the cognitive load of reading the code. There is one exception with 'YnlDocGenerator' which is added in __all__: it is used by ynl_gen_rst.py. Link: https://docs.astral.sh/ruff/rules/unused-import/ [1] Signed-off-by: Matthieu Baerts (NGI0) <[email protected]> Reviewed-by: Donald Hunter <[email protected]> Reviewed-by: Asbjørn Sloth Tønnesen <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent d8e0e25 commit 389712b

File tree

4 files changed

+2
-5
lines changed

4 files changed

+2
-5
lines changed

tools/net/ynl/pyynl/ethtool.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
# SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
33

44
import argparse
5-
import json
65
import pathlib
76
import pprint
87
import sys

tools/net/ynl/pyynl/lib/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@
88

99
__all__ = ["SpecAttr", "SpecAttrSet", "SpecEnumEntry", "SpecEnumSet",
1010
"SpecFamily", "SpecOperation", "SpecSubMessage", "SpecSubMessageFormat",
11-
"YnlFamily", "Netlink", "NlError"]
11+
"YnlFamily", "Netlink", "NlError", "YnlDocGenerator"]

tools/net/ynl/pyynl/lib/ynl.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
import struct
1010
from struct import Struct
1111
import sys
12-
import yaml
1312
import ipaddress
1413
import uuid
1514
import queue

tools/net/ynl/pyynl/ynl_gen_c.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
# SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)
33

44
import argparse
5-
import collections
65
import filecmp
76
import pathlib
87
import os
@@ -14,7 +13,7 @@
1413

1514
sys.path.append(pathlib.Path(__file__).resolve().parent.as_posix())
1615
from lib import SpecFamily, SpecAttrSet, SpecAttr, SpecOperation, SpecEnumSet, SpecEnumEntry
17-
from lib import SpecSubMessage, SpecSubMessageFormat
16+
from lib import SpecSubMessage
1817

1918

2019
def c_upper(name):

0 commit comments

Comments
 (0)