Skip to content

Commit f0a8aee

Browse files
committed
style: ruff updated to 0.0.243, pylint to 2.16.1
1 parent 1562946 commit f0a8aee

File tree

6 files changed

+19
-10
lines changed

6 files changed

+19
-10
lines changed

.vimrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
"let g:ale_linters = { 'python': ['ruff', 'pylsp'], }
2-
let g:ale_linters = { 'python': ['ruff', 'pylsp', 'flake8', ], }
2+
let g:ale_linters = { 'python': ['ruff', 'pylsp', 'flake8', 'pylint', 'mypy'], }
33
let g:ale_python_vulture_options = ' ./maintenance_scripts/vulture_whitelist.py '
44
autocmd VimEnter * :echo "local vimrc loaded! 😺"

maintenance_scripts/pikaman.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def __init__(self, name: str = "test", section: int = 1) -> None:
5555
self.rules = {
5656
k: v
5757
for k, v in inspect.getmembers(self, predicate=inspect.ismethod)
58-
if not (k.startswith("render") or k.startswith("_"))
58+
if not (k.startswith(("render", "_")))
5959
}
6060

6161
def render(
@@ -247,7 +247,7 @@ def escape(text: str) -> str:
247247

248248
@staticmethod
249249
def is_url(text: str) -> bool:
250-
return text.startswith("http://") or text.startswith("https://")
250+
return text.startswith(("http://", "https://"))
251251

252252
def document_open(self) -> str:
253253
date = datetime.datetime.now(tz=datetime.timezone.utc).strftime("%B %Y")

pikaur/makepkg_config.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,9 @@ class MakePkgCommand:
142142
def _apply_dynamic_users_workaround(cls) -> None:
143143
pkgdest = str(get_pkgdest())
144144
if running_as_root() and pkgdest and (
145-
pkgdest.startswith(str(_USER_TEMP_ROOT)) or
146-
pkgdest.startswith("/tmp") or # nosec B108 # noqa: S108
147-
pkgdest.startswith("/var/tmp") # nosec B108 # noqa: S108
145+
pkgdest.startswith(
146+
(str(_USER_TEMP_ROOT), "/tmp", "/var/tmp"), # nosec B108 # noqa: S108
147+
)
148148
):
149149
if not cls._cmd:
150150
raise RuntimeError()

pikaur/pikspect.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -360,8 +360,7 @@ def cmd_output_reader_thread(self) -> None:
360360
selected = select.select([self.pty_out], [], [], SMALL_TIMEOUT)
361361
except ValueError: # pragma: no cover
362362
return
363-
else:
364-
readers = selected[0]
363+
readers = selected[0]
365364
if not readers:
366365
if self.returncode is not None:
367366
break

pikaur/updates.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,7 @@ def get_remote_package(
6363
if aur_packages:
6464
return aur_packages[0]
6565
return None
66-
else:
67-
return repo_pkg
66+
return repo_pkg
6867

6968

7069
def get_remote_package_version(new_pkg_name: str) -> str | None:

pyproject.toml

+11
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,20 @@ ignore = [
4545
# enable back later:
4646
"C901", # "too complex"
4747
"ERA001", # commented out code
48+
# already managed by pulint, mb replace completely to ruff later:
49+
"PLR0912", # too many branches
50+
"PLR0913", # too many arguments
51+
"PLR0915", # too many statements
52+
4853

4954
"ANN101", # annotate self
5055
"ANN102", # annotate cls
5156
"ANN401", # disable Any
5257

5358
"BLE001", # disallow catching Exception
5459

60+
"UP036", # remove code with py version checks
61+
5562
# docstrings
5663
"D100",
5764
"D101",
@@ -71,6 +78,10 @@ ignore = [
7178
]
7279

7380
[tool.ruff.per-file-ignores]
81+
"pikaur/argparse.py" = [
82+
"PLR0912",
83+
"PLR0915",
84+
]
7485
"pikaur_test/test_*.py" = [
7586
"ANN201",
7687
"ANN206",

0 commit comments

Comments
 (0)