Commit 389712b0 authored by Matthieu Baerts (NGI0)'s avatar Matthieu Baerts (NGI0) Committed by Jakub Kicinski
Browse files

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: default avatarMatthieu Baerts (NGI0) <matttbe@kernel.org>
Reviewed-by: default avatarDonald Hunter <donald.hunter@gmail.com>
Reviewed-by: default avatarAsbjørn Sloth Tønnesen <ast@fiberby.net>
Link: https://patch.msgid.link/20250909-net-next-ynl-ruff-v1-5-238c2bccdd99@kernel.org


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent d8e0e254
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -2,7 +2,6 @@
# SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause

import argparse
import json
import pathlib
import pprint
import sys
+1 −1
Original line number Diff line number Diff line
@@ -8,4 +8,4 @@ from .doc_generator import YnlDocGenerator

__all__ = ["SpecAttr", "SpecAttrSet", "SpecEnumEntry", "SpecEnumSet",
           "SpecFamily", "SpecOperation", "SpecSubMessage", "SpecSubMessageFormat",
           "YnlFamily", "Netlink", "NlError"]
           "YnlFamily", "Netlink", "NlError", "YnlDocGenerator"]
+0 −1
Original line number Diff line number Diff line
@@ -9,7 +9,6 @@ import socket
import struct
from struct import Struct
import sys
import yaml
import ipaddress
import uuid
import queue
+1 −2
Original line number Diff line number Diff line
@@ -2,7 +2,6 @@
# SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)

import argparse
import collections
import filecmp
import pathlib
import os
@@ -14,7 +13,7 @@ import yaml

sys.path.append(pathlib.Path(__file__).resolve().parent.as_posix())
from lib import SpecFamily, SpecAttrSet, SpecAttr, SpecOperation, SpecEnumSet, SpecEnumEntry
from lib import SpecSubMessage, SpecSubMessageFormat
from lib import SpecSubMessage


def c_upper(name):