Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1fcac9877c | ||
|
|
668f30252d |
@@ -50,7 +50,7 @@ ai:
|
|||||||
# 支持: "ollama" (本地) 或 "api" (在线API)
|
# 支持: "ollama" (本地) 或 "api" (在线API)
|
||||||
provider: "api"
|
provider: "api"
|
||||||
# 模型名称(阿里云通义千问)
|
# 模型名称(阿里云通义千问)
|
||||||
model: "qwen3.5-plus"
|
model: "qwen3-max"
|
||||||
# API 地址
|
# API 地址
|
||||||
api_url: "https://dashscope.aliyuncs.com/compatible-mode/v1"
|
api_url: "https://dashscope.aliyuncs.com/compatible-mode/v1"
|
||||||
# API 密钥
|
# API 密钥
|
||||||
|
|||||||
@@ -19,10 +19,10 @@ import collections as col # 使用了 col 但 flake8 可能检测
|
|||||||
|
|
||||||
|
|
||||||
# 缺陷2: 未使用的变量
|
# 缺陷2: 未使用的变量
|
||||||
# def unused_variable_demo():
|
def unused_variable_demo():
|
||||||
# """演示未使用的变量"""
|
"""演示未使用的变量"""
|
||||||
# result = calculate() # result 未被使用
|
result = calculate() # result 未被使用
|
||||||
# print("Function executed")
|
print("Function executed")
|
||||||
|
|
||||||
|
|
||||||
# 缺陷8: 行太长(风格问题)
|
# 缺陷8: 行太长(风格问题)
|
||||||
@@ -34,7 +34,7 @@ def long_line():
|
|||||||
def missing_spaces():
|
def missing_spaces():
|
||||||
"""缺少必要空格"""
|
"""缺少必要空格"""
|
||||||
x=1+2
|
x=1+2
|
||||||
y=3*99
|
y=3*4
|
||||||
if x==1:
|
if x==1:
|
||||||
print(x)
|
print(x)
|
||||||
|
|
||||||
@@ -45,10 +45,10 @@ import collections as col # 使用了 col 但 flake8 可能检测
|
|||||||
|
|
||||||
|
|
||||||
# 缺陷2: 未使用的变量
|
# 缺陷2: 未使用的变量
|
||||||
# def unused_variable_demo():
|
def unused_variable_demo():
|
||||||
# """演示未使用的变量"""
|
"""演示未使用的变量"""
|
||||||
# result = calculate() # result 未被使用
|
result = calculate() # result 未被使用
|
||||||
# print("Function executed")
|
print("Function executed")
|
||||||
|
|
||||||
|
|
||||||
def calculate():
|
def calculate():
|
||||||
@@ -67,3 +67,15 @@ def use_before_define():
|
|||||||
"""在定义前使用变量"""
|
"""在定义前使用变量"""
|
||||||
print(before_var) # before_var 在下面才定义
|
print(before_var) # before_var 在下面才定义
|
||||||
before_var = 100
|
before_var = 100
|
||||||
|
|
||||||
|
|
||||||
|
# 缺陷2: 未使用的变量
|
||||||
|
def unused_variable_demo():
|
||||||
|
"""演示未使用的变量"""
|
||||||
|
result = calculate() # result 未被使用
|
||||||
|
print("Function executed")
|
||||||
|
|
||||||
|
|
||||||
|
# 缺陷8: 行太长(风格问题)
|
||||||
|
def long_line():
|
||||||
|
"""这是一行非常非常非常非常非常非常非常非常非常非常非常非常长的代码超过了 120 个字符的限制"""
|
||||||
Reference in New Issue
Block a user