Skip to content

Commit

Permalink
ci: use ruff for formatting (#144)
Browse files Browse the repository at this point in the history
  • Loading branch information
julesbertrand authored Feb 14, 2024
1 parent 668aaad commit ba554c3
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 22 deletions.
16 changes: 8 additions & 8 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion deployer/utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
21 changes: 8 additions & 13 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
Expand All @@ -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" = [
Expand Down

0 comments on commit ba554c3

Please sign in to comment.