Skip to content

Commit

Permalink
style: upgrade ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
joaodaher committed Mar 13, 2024
1 parent a2070f2 commit 135ce14
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ lint:
style:
@echo "Applying code style ..."
poetry run ruff format .
poetry run ruff . --fix
poetry run ruff check . --fix

unit:
@echo "Running unit tests ..."
Expand Down
2 changes: 1 addition & 1 deletion gcp_pilot/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ def inner_function(*args, **kwargs):

if "errors" in errors:
main_error = errors["errors"][0]["reason"]
exception_klass = _reasons.get(main_error, None)
exception_klass = _reasons.get(main_error)
details = errors.get("message", "")

if not exception_klass and "message" in errors:
Expand Down
4 changes: 2 additions & 2 deletions gcp_pilot/big_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ def _get_type(cls, variable: Any) -> str:
}

python_type = type(variable).__name__
param_type = TYPES.get(python_type, None)
param_type = TYPES.get(python_type)
if param_type is None:
raise exceptions.ValidationError(f"Parameter with type {param_type} not supported")
return param_type
Expand All @@ -239,7 +239,7 @@ def _get_value(cls, variable: Any) -> Any:
"Decimal": float,
}
python_type = type(variable).__name__
param_type = TYPES.get(python_type, None)
param_type = TYPES.get(python_type)
if param_type is not None:
return param_type(variable)
return variable
Expand Down
6 changes: 4 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,13 @@ pytest-timeout = "*"


[tool.ruff]
select = ["RUF", "I", "PL", "F", "COM", "UP", "DJ", "T10", "T20", "DTZ", "SIM", "TID", "PTH", "ERA", "TRY"]
ignore = ["COM812","COM819", "PLR2004", "PLR0911", "PLR0912", "PLR0913", "PLR0915", "DJ001", "DJ001", "DJ008", "TRY003", "RUF012"]
line-length = 120
target-version = "py311"

[tool.ruff.lint]
select = ["RUF", "I", "PL", "F", "COM", "UP", "DJ", "T10", "T20", "DTZ", "SIM", "TID", "PTH", "ERA", "TRY"]
ignore = ["COM812","COM819", "PLR2004", "PLR0911", "PLR0912", "PLR0913", "PLR0915", "DJ001", "DJ001", "DJ008", "TRY003", "RUF012"]


[tool.pytest.ini_options]
addopts = "-n auto --reruns 2 --random-order --timeout 100 --cov"
Expand Down

0 comments on commit 135ce14

Please sign in to comment.