Skip to content

Commit

Permalink
Use ruff formatter instead of black (#1499)
Browse files Browse the repository at this point in the history
  • Loading branch information
erlendvollset authored Nov 12, 2023
1 parent 6d03310 commit 6f97b44
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 19 deletions.
17 changes: 4 additions & 13 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
repos:
- repo: https://github.com/charliermarsh/ruff-pre-commit
- repo: https://github.com/astral-sh/ruff-pre-commit
hooks:
- id: ruff
args:
Expand All @@ -13,20 +13,11 @@ repos:
- --fixable=E,W,F,I,T,RUF,TID,UP
- --target-version=py38
- --exclude=cognite/client/_proto,cognite/client/_proto_legacy
rev: v0.1.5

- repo: https://github.com/psf/black
rev: 23.10.1
hooks:
- id: black
exclude: ^cognite/client/_proto.*$
- id: ruff-format
args:
- --line-length=120
- --target-version=py38
- --target-version=py39
- --target-version=py310
- --target-version=py311
- --include=\.py$
- --exclude=cognite/client/_proto*
rev: v0.1.5

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
Expand Down
1 change: 1 addition & 0 deletions cognite/client/data_classes/geospatial.py
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,7 @@ def _load(

class GeospatialComputedItemList(CogniteResourceList[GeospatialComputedItem]):
"A list of items computed from geospatial."

_RESOURCE = GeospatialComputedItem


Expand Down
10 changes: 4 additions & 6 deletions tests/tests_integration/test_api/test_datapoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -419,14 +419,12 @@ def test_retrieve_outside_points__query_limit_plusminus1_tests(

@pytest.mark.parametrize(
"start, end, exp_first_ts, exp_last_ts",
# fmt: off
[
(631670400000 + 1, 693964800000, 631670400000, 693964800000),
(631670400000, 693964800000, 631670400000 - WEEK_MS, 693964800000),
(631670400000, 693964800000 + 1, 631670400000 - WEEK_MS, 693964800000 + WEEK_MS),
(631670400000 + 1, 693964800000 + 1, 631670400000, 693964800000 + WEEK_MS),
(631670400000 + 1, 693964800000, 631670400000, 693964800000),
(631670400000, 693964800000, 631670400000 - WEEK_MS, 693964800000),
(631670400000, 693964800000 + 1, 631670400000 - WEEK_MS, 693964800000 + WEEK_MS),
(631670400000 + 1, 693964800000 + 1, 631670400000, 693964800000 + WEEK_MS),
],
# fmt: on
)
def test_retrieve_outside_points__query_chunking_mode(
self, start, end, exp_first_ts, exp_last_ts, cognite_client, retrieve_endpoints, weekly_dps_ts
Expand Down

0 comments on commit 6f97b44

Please sign in to comment.