style: ruff format and the lint rules of the driver standard

Mechanical: ruff format, and ruff check --fix with the rule set every NAPALM
driver uses (E, F, I, UP, B at line length 100, Python 3.10). What ruff
cannot fix comes in the next commit.
This commit is contained in:
Christian Manivong committed 2026-10-23 08:32:47 +02:00
1 parent 7f2ae6ac58
commit a212bc8715
14 files changed
+322 -239

No files matched your search

+11 -11
View File
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
@@ -33,9 +32,8 @@ class OpenWrtInterfaceMixin:
m = re.match(r"^\d+:\s+(\S+?)[@:]", line)
if m:
name = m.group(1)
if (
name not in self._EXCLUDED_INTERFACES
and not name.startswith(self._EXCLUDED_INTERFACE_PREFIXES)
if name not in self._EXCLUDED_INTERFACES and not name.startswith(
self._EXCLUDED_INTERFACE_PREFIXES
):
interfaces.append(name)
return sorted(set(interfaces))
@@ -368,12 +366,14 @@ class OpenWrtInterfaceMixin:
except Exception:
mac_addr = mac_raw
table.append({
"interface": interface,
"mac": mac_addr,
"ip": ip_addr,
"age": -1.0,
"state": state,
})
table.append(
{
"interface": interface,
"mac": mac_addr,
"ip": ip_addr,
"age": -1.0,
"state": state,
}
)
return table