mirror of
https://github.com/TheAlgorithms/Python.git
synced 2026-03-13 09:50:19 +08:00
Add more ruff rules (#8767)
* Add more ruff rules * Add more ruff rules * pre-commit: Update ruff v0.0.269 -> v0.0.270 * Apply suggestions from code review * Fix doctest * Fix doctest (ignore whitespace) * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: Dhruv Manilawala <dhruvmanila@gmail.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
@@ -73,9 +73,10 @@ class Graph:
|
||||
|
||||
target_vertex_parent = self.parent.get(target_vertex)
|
||||
if target_vertex_parent is None:
|
||||
raise ValueError(
|
||||
msg = (
|
||||
f"No path from vertex: {self.source_vertex} to vertex: {target_vertex}"
|
||||
)
|
||||
raise ValueError(msg)
|
||||
|
||||
return self.shortest_path(target_vertex_parent) + f"->{target_vertex}"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user