Skip to content

Commit

Permalink
chore: updated pre-commit hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
ntamas committed Apr 10, 2024
1 parent cc9cdd0 commit 475c501
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 20 deletions.
14 changes: 4 additions & 10 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,21 +1,15 @@
fail_fast: true
exclude: '^vendor/'
exclude: ^vendor/
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
rev: v4.6.0
hooks:
- id: check-ast
- id: end-of-file-fixer
- id: trailing-whitespace

- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.0.275
rev: v0.3.5
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]

- repo: https://github.com/psf/black
rev: 24.3.0
hooks:
- id: black
language_version: python3
- id: ruff-format
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ standalone = ["skybrush-studio", "svgpathtools"]
pyclean = "^2.0.0"

[tool.ruff]
ignore = ["B027", "B905", "C901", "E402", "E501", "E731"]
line-length = 80
select = ["B", "C", "E", "F", "W"]
lint.ignore = ["B027", "B905", "C901", "E402", "E501", "E731"]
lint.select = ["B", "C", "E", "F", "W"]
extend-exclude = ["src/modules/sbstudio/vendor"]

[build-system]
requires = ["poetry-core>=1.0.0"]
Expand Down
2 changes: 1 addition & 1 deletion src/modules/sbstudio/math/rng.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def __init__(
*,
seed: Optional[int] = None,
max: int = 0xFFFFFFFF,
rng_factory: Callable[[Optional[int]], Random] = Random
rng_factory: Callable[[Optional[int]], Random] = Random,
):
"""Constructor.
Expand Down
5 changes: 3 additions & 2 deletions src/modules/sbstudio/plugin/model/light_effects.py
Original file line number Diff line number Diff line change
Expand Up @@ -451,8 +451,9 @@ def get_output_based_on_output_type(
# to the differences between the numeric values of the sort
# keys
evaluated_sort_keys = [sort_key(i) for i in order]
min_value, max_value = min(evaluated_sort_keys), max(
evaluated_sort_keys
min_value, max_value = (
min(evaluated_sort_keys),
max(evaluated_sort_keys),
)
diff = max_value - min_value
if diff > 0:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,9 @@ def parse_static_csv_zip(filename: str) -> Dict[str, Item]:
raise RuntimeError(f"Duplicate object name in input CSV file: {name}")

# store position and color entry
result[name] = array((x, y, z), dtype=float), array(
(r, g, b, 255), dtype=int
result[name] = (
array((x, y, z), dtype=float),
array((r, g, b, 255), dtype=int),
)

return result
2 changes: 1 addition & 1 deletion src/modules/sbstudio/plugin/utils/evaluator.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def _evaluate_positions_of_objects(
objects: Sequence[Object],
*,
seek_to: Optional[Callable[[int], None]] = None,
frame: Optional[int] = None
frame: Optional[int] = None,
) -> Sequence[Coordinate3D]:
if frame is not None:
seek_to(frame)
Expand Down
2 changes: 1 addition & 1 deletion typings/gpu_extras/batch.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ def batch_for_shader(
],
content: Dict[str, Any],
*,
indices=None
indices=None,
) -> GPUBatch: ...

0 comments on commit 475c501

Please sign in to comment.