diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4e301dd..8693742 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -14,20 +14,20 @@ repos: - id: check-added-large-files - repo: local hooks: - - id: isort - name: isort - entry: poetry run isort --settings-path pyproject.toml + - id: ruff-isort + name: ruff isort + entry: poetry run ruff check --fix --select I --config pyproject.toml --show-fixes types: [python] language: system stages: [commit, push] - - id: black - name: black - entry: poetry run black --config pyproject.toml + - id: ruff-format + name: ruff format + entry: poetry run ruff format --config pyproject.toml types: [python] language: system stages: [commit, push] - - id: ruff - name: ruff + - id: ruff-check + name: ruff check entry: poetry run ruff check --config pyproject.toml types: [python] language: system diff --git a/deployer/utils/utils.py b/deployer/utils/utils.py index 053b3ed..1567345 100644 --- a/deployer/utils/utils.py +++ b/deployer/utils/utils.py @@ -35,7 +35,8 @@ class GraphComponentType(Protocol): def __call__( # noqa: D102 self, component_spec: Any, pipeline_func: Callable, display_name: Optional[str] = None - ): ... + ): + ... def filter_lines_from(tb: TracebackType, target_file: Union[Path, str]) -> str: diff --git a/pyproject.toml b/pyproject.toml index d1c58ef..0741e5a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,12 +24,10 @@ toml = "^0.10" tomlkit = "^0.12" [tool.poetry.group.dev.dependencies] -black = "^24.1" -isort = "^5.12" pytest = "^8.0" pre-commit = "^3.3" ipykernel = "^6.9" -nbstripout = "^0.6" +nbstripout = "^0.7" ruff = "^0.1" pytest-cov = "^4.1" codespell = "^2.2" @@ -46,21 +44,14 @@ profiling = ["pyinstrument"] requires = ["poetry-core"] build-backend = "poetry.core.masonry.api" -[tool.black] -target_version = ["py38", "py39", "py310"] -line-length = 99 - -[tool.isort] -profile = "black" -known_first_party = ["vertex", "tests"] - [tool.ruff] +target-version = "py38" +line-length = 99 ignore = [ "D100", "D205", "D415", ] -line-length = 99 select = [ "B", # bugbear "C4", # comprehensions @@ -71,12 +62,16 @@ select = [ "W", # flake8 "S", # bandit "N", # pep8-naming - "RUF" # ruff + "RUF", # ruff + "I", # isort ] [tool.ruff.pydocstyle] convention = "google" +[tool.ruff.lint.isort] +known-first-party = ["vertex", "tests", "deployer"] + [tool.ruff.per-file-ignores] "*cli.py" = ["D", "B008"] "*__init__.py" = [