Loading...
Loading...
Compare original and translation side by side
uv run pytestuv run pytestuv run pytestuv run pytestuv run pytestuv run ruff check src/uv run mypy src/uv run pytestuv run ruff check src/uv run mypy src/undefinedundefined
This runs:
1. Lint checks (`ruff`)
2. Static type checks (`mypy`)
3. Tests with coverage (`pytest`)
**Repeat** until all checks pass with no errors.
该命令会执行:
1. 代码规范检查(`ruff`)
2. 静态类型检查(`mypy`)
3. 带覆盖率统计的测试(`pytest`)
**重复执行**直到所有检查无错误通过。def generate_report(users, threshold):
result = []
for user in users:
score = user.login_count * 0.3 + user.posts * 0.7
if score >= threshold:
result.append({"name": user.name, "score": score})
return resultdef calculate_engagement_score(user) -> float:
return user.login_count * 0.3 + user.posts * 0.7
def generate_report(users, threshold):
result = []
for user in users:
score = calculate_engagement_score(user)
if score >= threshold:
result.append({"name": user.name, "score": score})
return resultbin/ci-localdef generate_report(users, threshold):
result = []
for user in users:
score = user.login_count * 0.3 + user.posts * 0.7
if score >= threshold:
result.append({"name": user.name, "score": score})
return resultdef calculate_engagement_score(user) -> float:
return user.login_count * 0.3 + user.posts * 0.7
def generate_report(users, threshold):
result = []
for user in users:
score = calculate_engagement_score(user)
if score >= threshold:
result.append({"name": user.name, "score": score})
return resultbin/ci-local