imbajin commented on code in PR #313:
URL: 
https://github.com/apache/incubator-hugegraph-ai/pull/313#discussion_r2566998513


##########
pyproject.toml:
##########
@@ -140,3 +143,34 @@ constraint-dependencies = [
     # Other dependencies
     "python-dateutil~=2.9.0",
 ]
+
+# for code format
+[tool.ruff]
+line-length = 120
+target-version = "py310"
+
+[tool.ruff.lint]
+# Select a broad set of rules for comprehensive checks.
+# E: pycodestyle Errors, F: Pyflakes, W: pycodestyle Warnings, I: isort
+# C: flake8-comprehensions, N: pep8-naming

Review Comment:
   ⚠️ **Ruff 规则配置建议**
   
   当前配置选择了多个规则集,整体配置合理。有几点建议:
   
   1. **`T20` (flake8-print)**: 这个规则在生产代码中很有用,但注意当前只在测试文件和 examples 
中忽略了它。如果项目其他地方有合法的 print 使用(如 CLI 工具输出),可能需要更多的豁免配置。
   
   2. **`C901` (complexity)**: 虽然暂时忽略了复杂度检查,建议后续通过重构逐步启用,这是代码质量的重要指标。
   
   3. **缺少 `D` (pydocstyle)**: 如果项目对文档字符串有要求,可以考虑启用。
   
   4. **缺少 `S` (flake8-bandit)**: 建议启用安全相关的检查,特别是对于处理用户输入的 LLM 项目。
   
   ```python
   # 可考虑添加的安全规则
   select = [..., "S"]  # flake8-bandit for security
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to