Skip to content

Commit 4e8d22b

Browse files
committed
Enable the printf-string-formatting ruff rule and fix warnings
1 parent 604526c commit 4e8d22b

File tree

3 files changed

+2
-3
lines changed

3 files changed

+2
-3
lines changed

archinstall/lib/networking.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def get_hw_addr(ifname: str) -> str:
7171
import fcntl
7272
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
7373
ret = fcntl.ioctl(s.fileno(), 0x8927, struct.pack('256s', bytes(ifname, 'utf-8')[:15]))
74-
return ':'.join('%02x' % b for b in ret[18:24])
74+
return ':'.join(f'{b:02x}' for b in ret[18:24])
7575

7676

7777
def list_interfaces(skip_loopback: bool = True) -> dict[str, str]:

archinstall/lib/output.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ def _stylize_output(
237237
code_list = []
238238

239239
if text == '' and reset:
240-
return '\x1b[%sm' % '0'
240+
return '\x1b[0m'
241241

242242
code_list.append(foreground[str(fg)])
243243

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,6 @@ ignore = [
220220
"RUF015", # unnecessary-iterable-allocation-for-first-element
221221
"RUF039", # unraw-re-pattern
222222
"UP028", # yield-in-for-loop
223-
"UP031", # printf-string-formatting
224223
"UP037", # quoted-annotation
225224
"W191", # tab-indentation
226225
]

0 commit comments

Comments
 (0)