Skip to content

Commit

Permalink
Switch to ruff format (#257)
Browse files Browse the repository at this point in the history
  • Loading branch information
mathialo authored Nov 2, 2023
1 parent 613b690 commit 5114a4a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 15 deletions.
9 changes: 3 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
repos:
- repo: https://github.com/psf/black
rev: 23.3.0
hooks:
- id: black
- repo: https://github.com/charliermarsh/ruff-pre-commit
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
rev: v0.0.274
- id: ruff-format
rev: v0.1.3
- repo: local
hooks:
- id: mypy
Expand All @@ -17,7 +14,7 @@ repos:
entry: poetry run mypy --non-interactive --install-types cognite
pass_filenames: false
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.5.0
hooks:
- id: check-ast
- id: debug-statements
Expand Down
3 changes: 2 additions & 1 deletion cognite/extractorutils/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,8 @@ def heartbeat_loop() -> None:
try:
self.cognite_client.extraction_pipelines.runs.create(
ExtractionPipelineRun(
extpipe_external_id=self.extraction_pipeline.external_id, status="seen" # type: ignore
extpipe_external_id=self.extraction_pipeline.external_id, # type: ignore
status="seen",
)
)
except Exception:
Expand Down
3 changes: 2 additions & 1 deletion cognite/extractorutils/configtools/elements.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,8 @@ def get_data_set(self, cdf_client: CogniteClient) -> Optional[DataSet]:
return None

return cdf_client.data_sets.retrieve(
id=self.data_set.either_id.internal_id, external_id=self.data_set.either_id.external_id # type: ignore
id=self.data_set.either_id.internal_id,
external_id=self.data_set.either_id.external_id, # type: ignore
)

def get_extraction_pipeline(self, cdf_client: CogniteClient) -> Optional[ExtractionPipeline]:
Expand Down
8 changes: 1 addition & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,9 @@ packages = [
{ include="cognite", from="." },
]

[tool.black]
line-length = 120
target_version = ['py38']
include = '\.py$'

[tool.ruff]
select = ["E", "F", "I", "T20", "S"]
ignore = ["S104", "S303", "S311", "E501"]
ignore = ["S104", "S303", "S311"]
fixable = ["A", "B", "C", "D", "E", "F", "I"]
unfixable = []

Expand Down Expand Up @@ -72,7 +67,6 @@ jq = [{version = "^1.3.0", platform = "darwin"}, {version = "^1.3.0", platform =
experimental = ["cognite-sdk-experimental"]

[tool.poetry.group.dev.dependencies]
black = "23.10.1"
mypy = "1.6.1"
ruff = "^0.1.0"
pytest = "^7.0.0"
Expand Down

0 comments on commit 5114a4a

Please sign in to comment.