mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-07-25 01:04:03 +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:
@ -9,9 +9,11 @@ def n31(a: int) -> tuple[list[int], int]:
|
||||
"""
|
||||
|
||||
if not isinstance(a, int):
|
||||
raise TypeError(f"Must be int, not {type(a).__name__}")
|
||||
msg = f"Must be int, not {type(a).__name__}"
|
||||
raise TypeError(msg)
|
||||
if a < 1:
|
||||
raise ValueError(f"Given integer must be positive, not {a}")
|
||||
msg = f"Given integer must be positive, not {a}"
|
||||
raise ValueError(msg)
|
||||
|
||||
path = [a]
|
||||
while a != 1:
|
||||
|
Reference in New Issue
Block a user