Skip to content

Commit 1724f4f

Browse files
committed
chore: fix lint issues
Someday I'll setup a pre-commit hook...perhaps the same day I ditch Windoze for good.
1 parent 0662596 commit 1724f4f

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

getmac/utils.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ def check_command(command: str) -> bool:
2727
If the command exists
2828
"""
2929
if command not in gvars.CHECK_COMMAND_CACHE:
30-
gvars.CHECK_COMMAND_CACHE[command] = bool(shutil.which(command, path=gvars.PATH_STR))
30+
gvars.CHECK_COMMAND_CACHE[command] = bool(
31+
shutil.which(command, path=gvars.PATH_STR)
32+
)
3133
return gvars.CHECK_COMMAND_CACHE[command]
3234

3335

@@ -216,7 +218,9 @@ def call_proc(executable: str, args: str) -> str:
216218
else:
217219
cmd = [executable, *shlex.split(args)] # type: ignore
218220

219-
output: Union[str, bytes] = subprocess.check_output(cmd, stderr=subprocess.DEVNULL, env=gvars.ENV)
221+
output: Union[str, bytes] = subprocess.check_output(
222+
cmd, stderr=subprocess.DEVNULL, env=gvars.ENV
223+
)
220224

221225
if settings.DEBUG >= 4:
222226
gvars.log.debug(f"Output from '{executable}' command: {output!s}")

pyproject.toml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ addopts = "--tb=short"
202202
# --- Codespell configuration ---
203203
[tool.codespell]
204204
check-filenames = true
205-
skip = '*.log,*.out,build,dist,*.pyc,*.class,*.git,*.vagrant,*.tox,*.egg-info,*.idea,*.vscode,_build,.doctrees,htmlcov,.venv,.mypy_cache,deb_dist'
205+
skip = '*.log,*.out,build,dist,*.pyc,*.class,*.git,*.vagrant,*.tox,*.egg-info,*.idea,.vscode,_build,.doctrees,htmlcov,.venv,.mypy_cache,deb_dist,built_docs,.pytest_cache,.pdm-build'
206206
ignore-words-list = 'ether,Expresso,expresso,Espresso,espresso'
207207

208208

@@ -262,8 +262,6 @@ select = [
262262

263263
# Linting error codes to ignore
264264
ignore = [
265-
"ANN101", # missing-type-self
266-
"ANN102", # missing-type-cls
267265
"RET505", # unnecessary 'else' after 'return' statement
268266
"PLW0603", # Using the global statement to update is discouraged
269267
"PLW2901", # for loop variable overwritten by assignment target
@@ -273,6 +271,7 @@ ignore = [
273271
# "PLC1901", # compare-to-empty-string
274272
"RUF012", # Mutable class attributes should be annotated with typing.ClassVar
275273
"S603", # subprocess-without-shell-equals-true
274+
"PLC0415", # import should be at the top-level of a file (getmac uses imports in functions)
276275
]
277276

278277
[tool.ruff.lint.per-file-ignores]

0 commit comments

Comments
 (0)