用Rust编写的Python代码检查工具Ruff发布了v0.16.0版本[1]。新版本将默认启用的规则数从59条大幅增加到413条[1],而工具的总规则数已扩展至968条[1]。
本次更新新增了多项功能。Markdown代码块格式化功能现已支持python、py、python3、py3、pyi、pycon等标记[1]。同时引入了新的抑制注释格式,用户可使用ruff: ignore、ruff: disable、ruff: enable、ruff: file-ignore等命令[1]。新增的--add-ignore CLI标志可自动添加忽略注释[1],格式化和检查输出中现在会展示修复的差异[1]。此外,JSON输出格式进行了调整,filename、location、end_location等字段现在可能返回null而非空字符串[1]。
Ruff, a Python code checker written in Rust, has released version 0.16.0 with significant expansions to its rule enforcement capabilities [1]. The update increases the number of default rules enabled from 59 to 413, while the total rule count across the tool has grown to 968, up from 708 [1].
The new version introduces several feature enhancements [1]. Support for Markdown code block formatting has been added, with compatibility for Python code blocks marked with python, py, python3, py3, pyi, and pycon tags [1]. Additionally, Ruff now supports new suppression comment formats including ruff: ignore, ruff: disable, ruff: enable, and ruff: file-ignore directives [1]. A new --add-ignore command-line flag has been implemented to automatically insert ignore annotations into code [1].
The update also modifies how formatting and checking operations display results [1]. Fix differentials are now shown directly in both formatting and check output [1]. JSON output formatting has been adjusted, with fields such as filename, location, and end_location now capable of returning null values rather than empty strings [1].