Skip to content

Commit

Permalink
Add ruff format check to lints (#2517)
Browse files Browse the repository at this point in the history
* Add ruff format --check to lints

* Unrelated format
  • Loading branch information
jotare authored Oct 7, 2024
1 parent bcc9fc7 commit 67c726a
Show file tree
Hide file tree
Showing 11 changed files with 12 additions and 6 deletions.
1 change: 1 addition & 0 deletions nucliadb/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ format:
.PHONY: lint
lint:
ruff check --config=../ruff.toml .
ruff format --check --config=../ruff.toml .
MYPYPATH=../mypy_stubs mypy --config-file=../mypy.ini .

# pytest doesn't support test discovery across our multiple "top-level folders"
Expand Down
8 changes: 2 additions & 6 deletions nucliadb/tests/search/unit/test_find_merge.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,10 @@ def test_merge_paragraphs_vectors():

# Check that the paragraphs are ordered by score
bm25_scores = [
text_block.score
for text_block in paragraphs
if text_block.score_type == SCORE_TYPE.BM25
text_block.score for text_block in paragraphs if text_block.score_type == SCORE_TYPE.BM25
]
vector_scores = [
text_block.score
for text_block in paragraphs
if text_block.score_type == SCORE_TYPE.VECTOR
text_block.score for text_block in paragraphs if text_block.score_type == SCORE_TYPE.VECTOR
]
assert bm25_scores == sorted(bm25_scores, reverse=True)
assert vector_scores == sorted(vector_scores, reverse=True)
Expand Down
1 change: 1 addition & 0 deletions nucliadb_dataset/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ format:
.PHONY: lint
lint:
ruff check --config=../ruff.toml .
ruff format --check --config=../ruff.toml .
MYPYPATH=../mypy_stubs mypy --config-file=../mypy.ini .

.PHONY: test
Expand Down
1 change: 1 addition & 0 deletions nucliadb_models/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ format:
.PHONY: lint
lint:
ruff check --config=../ruff.toml .
ruff format --check --config=../ruff.toml .
MYPYPATH=../mypy_stubs mypy --config-file=../mypy.ini .

.PHONY: test
Expand Down
1 change: 1 addition & 0 deletions nucliadb_node/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ format:
.PHONY: lint
lint:
ruff check --config=../ruff.toml .
ruff format --check --config=../ruff.toml .
MYPYPATH=../mypy_stubs mypy --config-file=../mypy.ini .

.PHONY: test
Expand Down
1 change: 1 addition & 0 deletions nucliadb_node_binding/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ format:
.PHONY: lint
lint:
ruff check --config=../ruff.toml tests
ruff format --check --config=../ruff.toml .
MYPYPATH=../mypy_stubs mypy --config-file=../mypy.ini .

.PHONY: test
Expand Down
1 change: 1 addition & 0 deletions nucliadb_performance/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ format: # Format the code
.PHONY: lint
lint: # Run lint checks
ruff check --config=../ruff.toml .
ruff format --check --config=../ruff.toml .
MYPYPATH=../mypy_stubs mypy --config-file=../mypy.ini . --show-traceback


Expand Down
1 change: 1 addition & 0 deletions nucliadb_sdk/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ format:
.PHONY: lint
lint:
ruff check --config=../ruff.toml .
ruff format --check --config=../ruff.toml .
MYPYPATH=../mypy_stubs mypy --config-file=../mypy.ini .

.PHONY: test
Expand Down
1 change: 1 addition & 0 deletions nucliadb_sidecar/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ format:
.PHONY: lint
lint:
ruff check --config=../ruff.toml .
ruff format --check --config=../ruff.toml .
MYPYPATH=../mypy_stubs mypy --config-file=../mypy.ini .

.PHONY: test
Expand Down
1 change: 1 addition & 0 deletions nucliadb_telemetry/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ format:
.PHONY: lint
lint:
ruff check --config=../ruff.toml .
ruff format --check --config=../ruff.toml .
MYPYPATH=../mypy_stubs mypy --config-file=../mypy.ini . --show-traceback

.PHONY: test
Expand Down
1 change: 1 addition & 0 deletions nucliadb_utils/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ format:
.PHONY: lint
lint:
ruff check --config=../ruff.toml .
ruff format --check --config=../ruff.toml .
MYPYPATH=../mypy_stubs mypy --config-file=../mypy.ini src

.PHONY: test
Expand Down

0 comments on commit 67c726a

Please sign in to comment.