Refactor: reformat all code for lefthook using ruff and gofmt (#16585)

This commit is contained in:
Wang Qi
2026-07-03 12:53:39 +08:00
committed by GitHub
parent 19fcb4a981
commit 6a4b9be426
588 changed files with 11123 additions and 15412 deletions

View File

@@ -17,8 +17,8 @@
import math
from common.float_utils import get_float
class TestGetFloat:
class TestGetFloat:
def test_valid_float_string(self):
"""Test conversion of valid float strings"""
assert get_float("3.14") == 3.14
@@ -66,8 +66,8 @@ class TestGetFloat:
def test_special_float_strings(self):
"""Test handling of special float strings"""
assert get_float("inf") == float('inf')
assert get_float("-inf") == float('-inf')
assert get_float("inf") == float("inf")
assert get_float("-inf") == float("-inf")
# NaN should return -inf according to our function's design
result = get_float("nan")
@@ -85,4 +85,4 @@ class TestGetFloat:
assert get_float(" 3.14 ") == 3.14
result = get_float(" invalid ")
assert math.isinf(result)
assert result < 0
assert result < 0