-
Notifications
You must be signed in to change notification settings - Fork 88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Format with Ruff 0.9.0 #425
Conversation
WalkthroughThis pull request encompasses a series of minor formatting changes across multiple files in the CodeRabbit project. The modifications primarily focus on improving code readability by reformatting assertion statements in test files and making minor adjustments to string formatting in some source code files. The changes do not introduce new functionality or alter the underlying logic of the existing code, but instead aim to enhance code clarity and consistency. Changes
Suggested Labels
Possibly Related PRs
Poem
Finishing Touches
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
cognee/tests/integration/documents/PdfDocument_test.py (1)
30-38
: Simplify assertion formattingThe multi-line assertions with parentheses make the code more verbose without adding clarity. Since these are simple assertions with f-string error messages, they can be written more concisely on single lines.
- assert ground_truth["word_count"] == paragraph_data.word_count, ( - f'{ground_truth["word_count"] = } != {paragraph_data.word_count = }' - ) + assert ground_truth["word_count"] == paragraph_data.word_count, f'{ground_truth["word_count"] = } != {paragraph_data.word_count = }' - assert ground_truth["len_text"] == len(paragraph_data.text), ( - f'{ground_truth["len_text"] = } != {len(paragraph_data.text) = }' - ) + assert ground_truth["len_text"] == len(paragraph_data.text), f'{ground_truth["len_text"] = } != {len(paragraph_data.text) = }' - assert ground_truth["cut_type"] == paragraph_data.cut_type, ( - f'{ground_truth["cut_type"] = } != {paragraph_data.cut_type = }' - ) + assert ground_truth["cut_type"] == paragraph_data.cut_type, f'{ground_truth["cut_type"] = } != {paragraph_data.cut_type = }'
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (16)
cognee/infrastructure/databases/graph/neo4j_driver/adapter.py
(1 hunks)cognee/modules/retrieval/brute_force_triplet_search.py
(1 hunks)cognee/modules/retrieval/description_to_codepart_search.py
(1 hunks)cognee/tests/integration/documents/AudioDocument_test.py
(1 hunks)cognee/tests/integration/documents/ImageDocument_test.py
(1 hunks)cognee/tests/integration/documents/PdfDocument_test.py
(1 hunks)cognee/tests/integration/documents/TextDocument_test.py
(1 hunks)cognee/tests/integration/documents/UnstructuredDocument_test.py
(1 hunks)cognee/tests/test_deduplication.py
(2 hunks)cognee/tests/test_falkordb.py
(1 hunks)cognee/tests/test_library.py
(1 hunks)cognee/tests/test_pgvector.py
(2 hunks)cognee/tests/unit/processing/chunks/chunk_by_paragraph_2_test.py
(3 hunks)cognee/tests/unit/processing/chunks/chunk_by_paragraph_test.py
(1 hunks)cognee/tests/unit/processing/chunks/chunk_by_sentence_test.py
(2 hunks)cognee/tests/unit/processing/chunks/chunk_by_word_test.py
(1 hunks)
✅ Files skipped from review due to trivial changes (11)
- cognee/tests/unit/processing/chunks/chunk_by_paragraph_test.py
- cognee/tests/test_library.py
- cognee/tests/test_pgvector.py
- cognee/modules/retrieval/description_to_codepart_search.py
- cognee/modules/retrieval/brute_force_triplet_search.py
- cognee/infrastructure/databases/graph/neo4j_driver/adapter.py
- cognee/tests/integration/documents/AudioDocument_test.py
- cognee/tests/unit/processing/chunks/chunk_by_paragraph_2_test.py
- cognee/tests/integration/documents/TextDocument_test.py
- cognee/tests/test_falkordb.py
- cognee/tests/test_deduplication.py
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: docker-compose-test
🔇 Additional comments (5)
cognee/tests/integration/documents/ImageDocument_test.py (1)
28-36
: Same formatting issue as in PdfDocument_test.pyThese assertions follow the same unnecessarily verbose pattern.
cognee/tests/integration/documents/UnstructuredDocument_test.py (1)
74-102
: Review Ruff configuration for assertion formattingThe pattern of wrapping simple assertions in parentheses appears consistently across multiple test files. This suggests a possible Ruff configuration issue.
Consider checking your Ruff configuration:
#!/bin/bash # Check for Ruff configuration files find . -type f -name "ruff.toml" -o -name "pyproject.toml"The assertions can be simplified similar to the previous files.
cognee/tests/unit/processing/chunks/chunk_by_word_test.py (1)
20-22
: Same formatting pattern affecting test readabilityThe multi-line assertion pattern is consistent with other files but reduces readability.
- assert reconstructed_text == input_text, ( - f"texts are not identical: {len(input_text) = }, {len(reconstructed_text) = }" - ) + assert reconstructed_text == input_text, f"texts are not identical: {len(input_text) = }, {len(reconstructed_text) = }"cognee/tests/unit/processing/chunks/chunk_by_sentence_test.py (2)
19-21
: LGTM! Clean formatting change.The assertion formatting has been simplified while maintaining readability and the same functionality.
39-41
: LGTM! Consistent formatting applied.The assertion formatting matches the style applied throughout the PR, maintaining consistency and readability.
Summary by CodeRabbit
Bug Fixes
Tests
Refactor