chore: drop unnecessary pass statements (ruff PIE790)#150
Open
alexzhu0 wants to merge 1 commit intoFlowElement-ai:mainfrom
Open
chore: drop unnecessary pass statements (ruff PIE790)#150alexzhu0 wants to merge 1 commit intoFlowElement-ai:mainfrom
pass statements (ruff PIE790)#150alexzhu0 wants to merge 1 commit intoFlowElement-ai:mainfrom
Conversation
Ruff's PIE790 flags `pass` statements that are semantically redundant: - class bodies that already contain a docstring - function bodies that already contain a docstring, comment, or other statement - `except` blocks that already contain a logger call Python considers a docstring a statement, so these classes/functions stay syntactically valid (a module-level or method-level docstring alone is a complete suite). All 24 occurrences flagged by ruff are semantics-preserving deletions; no behavior change. Verification: - `ruff check . --exclude 'm_flow/baml_client' --select PIE790` is now clean - `py_compile` on every touched file: clean - `pytest m_flow/tests/unit/auth/test_permission_concurrency.py`: 8 passed
5c5c71e to
179c0c0
Compare
Contributor
Author
|
I've opened #167 with a two-line fix (drop (The other failing checks are already green after the latest push.) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Ruff rule PIE790 flags
passstatements that are semantically redundant — the enclosing class / function /exceptblock already has a docstring, a comment, or another statement, sopassadds nothing. 24 occurrences total, all auto-fixable.What changed
Three shapes, all semantics-preserving:
Class body with only a docstring +
pass(11×) — the docstring alone is a valid class body.Async placeholder method with docstring +
pass(8×) — a docstring is a statement, so the method stays a complete no-op.exceptblock with alogger.error(...)+ danglingpass(2×) — the logger call is a statement, so the block stays valid.One additional site (
graph_db_interface.py) keeps the inline comment as the sole body — the originalpass # Default: no-op for databases that auto-checkpointis replaced by# Default: no-op for databases that auto-checkpoint, which is still a valid block inside a docstring-bearing method.Files
adapters/graph/graph_db_interface.py,adapters/graph/neo4j_driver/Neo4jAuraDevDatasetDatabaseHandler.py,adapters/graph/neptune_driver/adapter.py,adapters/hybrid/neptune_analytics/NeptuneAnalyticsAdapter.py,adapters/vector/vector_db_interface.pyauth/authentication/default/default_jwt_strategy.py,auth/models/User.pycore/models/ExtendableMemoryNode.py,data/models/{answers,metrics,questions}_base.pyeval/config.py,llm/exceptions.py,llm/extraction/knowledge_graph/extract_content_graph.pyretrieval/utils/fine_grained_triplet_search.py,retrieval/utils/procedural_memory_fragment.py,shared/files/storage/S3FileStorage.pytests/unit/auth/test_permission_concurrency.py18 files, +2 / −24.
Verification
No behavior change. Nothing user-visible. Generated code under
m_flow/baml_client/is untouched.I affirm that all code in every commit of this pull request conforms to the terms of the M-flow Developer Certificate of Origin