From 5683f63c953afeec7e6a34bc547820860ac0ab51 Mon Sep 17 00:00:00 2001
From: Karel van Klink <karel.vanklink@geant.org>
Date: Mon, 13 Nov 2023 18:16:57 +0000
Subject: [PATCH] resolve linting errors in netboxcli

---
 utils/__init__.py  |  1 +
 utils/netboxcli.py | 12 +++++-------
 2 files changed, 6 insertions(+), 7 deletions(-)
 create mode 100644 utils/__init__.py

diff --git a/utils/__init__.py b/utils/__init__.py
new file mode 100644
index 00000000..80dce5bf
--- /dev/null
+++ b/utils/__init__.py
@@ -0,0 +1 @@
+"""Utilities that can be used alongside :term:`GSO`."""
diff --git a/utils/netboxcli.py b/utils/netboxcli.py
index 17e496bd..a4d42500 100644
--- a/utils/netboxcli.py
+++ b/utils/netboxcli.py
@@ -22,12 +22,12 @@ def convert_to_table(data: list[dict[str, Any]], fields: list[str]) -> pd.DataFr
 
 @click.group()
 def cli() -> None:
-    pass
+    """Instantiate a new :term:`CLI`."""
 
 
 @cli.group()
 def create() -> None:
-    pass
+    """Start defining creation commands below."""
 
 
 @create.command()
@@ -45,7 +45,7 @@ def device(fqdn: str, model: str) -> None:
 @click.option("--type", default="10gbase-t", help="Interface type, default is 10GBASE-T")
 @click.option("--speed", default="1000", help="Interface speed , default is 1000")
 @click.option("--fqdn", help="Device where to create interface")
-def interface(name: str, type: str, speed: str, fqdn: str) -> None:
+def interface(name: str, type: str, speed: str, fqdn: str) -> None:  # noqa: A002
     """Create a new interface in Netbox."""
     click.echo(f"Creating interface: name={name}, speed={speed}, fqdn={fqdn}")
     new_interface = NetboxClient().create_interface(name, type, speed, fqdn)
@@ -103,7 +103,7 @@ create.add_command(device_site)
 
 # Define list commands here
 @cli.group()
-def list() -> None:
+def list() -> None:  # noqa: A001
     """Definitions of all listing commands."""
 
 
@@ -126,9 +126,7 @@ def interfaces(fqdn: str, speed: str) -> None:
         "lag",
         "speed",
     ]
-    iface_list = []
-    for iface in interface_list:
-        iface_list.append(dict(iface))
+    iface_list = [dict(iface) for iface in interface_list]
 
     table = convert_to_table(iface_list, display_fields)
     click.echo(table)
-- 
GitLab