Skip to content

Commit

Permalink
Tweak ruff config and update pre-commit hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
sbidoul committed Feb 22, 2023
1 parent 479607e commit 3c54a39
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 19 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ default_language_version:
python: python3
repos:
- repo: https://github.com/psf/black
rev: 22.10.0
rev: 23.1.0
hooks:
- id: black
- repo: https://github.com/pre-commit/pre-commit-hooks
Expand All @@ -13,6 +13,6 @@ repos:
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.0.149
rev: v0.0.252
hooks:
- id: ruff
21 changes: 11 additions & 10 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,18 @@ mypy = [
Home = "https://github.com/sbidoul/runboat"

[tool.ruff]
fix = false
fix = true
target-version = "py310"
select = [
"E", "F", "U", "N", "S", "C", "B", "A", "I", "T", "Q", "YTT", "BLE", "C", "RUF", "M"
]
ignore = [
"B008",
"BLE001",
"N805",
"N818",
"S101",
"U007",
"F", # pyflakes
"E", # pycodestyle
"W", # pycodestyle
"C90", # mccabe
"I", # isort
"UP", # pyupgrade
"T10", # flake8-debugger
"PLE", # pylint errors
"RUF",
]

[tool.ruff.mccabe]
Expand Down
4 changes: 2 additions & 2 deletions src/runboat/controller.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import asyncio
import logging
from collections.abc import Awaitable
from typing import Any, Callable
from collections.abc import Awaitable, Callable
from typing import Any

from . import k8s
from .db import BuildsDb
Expand Down
6 changes: 3 additions & 3 deletions src/runboat/k8s.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
import shutil
import subprocess
import tempfile
from collections.abc import Generator
from collections.abc import Callable, Generator
from contextlib import contextmanager
from enum import Enum
from importlib import resources
from pathlib import Path
from typing import Any, Callable, TypedDict, cast
from typing import Any, TypedDict, cast

import urllib3
from jinja2 import Template
Expand Down Expand Up @@ -212,7 +212,7 @@ async def _kubectl(args: list[str]) -> None:
)
return_code = await proc.wait()
if return_code != 0:
raise subprocess.CalledProcessError(return_code, ["kubectl"] + args)
raise subprocess.CalledProcessError(return_code, ["kubectl", *args])


async def deploy(kubefiles_path: Path | None, deployment_vars: DeploymentVars) -> None:
Expand Down
4 changes: 2 additions & 2 deletions src/runboat/utils.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import asyncio
import functools
import re
from collections.abc import AsyncGenerator, Awaitable, Generator, Iterator
from collections.abc import AsyncGenerator, Awaitable, Callable, Generator, Iterator
from concurrent.futures.thread import ThreadPoolExecutor
from functools import wraps
from typing import Any, Callable, ParamSpec, TypeVar
from typing import Any, ParamSpec, TypeVar

_pool = ThreadPoolExecutor(max_workers=20, thread_name_prefix="sync_to_async")

Expand Down

0 comments on commit 3c54a39

Please sign in to comment.