← 返回命令列表

Linux command

reek 命令

文件

复制后可按需替换文件名、目录或参数。

常用示例

Check Ruby code for smells

reek [file.rb]

Check entire project

reek

Check with specific format

reek --format [yaml] [file.rb]

Show available smell types

reek --smell-types

Exclude specific smells

reek --except [TooManyStatements] [file.rb]

说明

Reek is a static analysis tool that detects code smells in Ruby source files, reporting potential design problems such as long methods, feature envy, data clumps, and excessive parameter lists. It examines code structure and naming patterns to identify areas that may benefit from refactoring, based on principles from Martin Fowler's refactoring catalog. Output can be formatted as text, YAML, JSON, or HTML for integration with CI pipelines and code review workflows. Individual smell types can be included or excluded with --only and --except, and project-wide configuration in .reek.yml allows tuning thresholds and excluding paths.

参数

-f, --format _format_
Output format (text, yaml, json, html).
--smell-types
List available smells.
--except _smells_
Exclude smells.
--only _smells_
Check only specified smells.
-c, --config _file_
Configuration file.

FAQ

What is the reek command used for?

Reek is a static analysis tool that detects code smells in Ruby source files, reporting potential design problems such as long methods, feature envy, data clumps, and excessive parameter lists. It examines code structure and naming patterns to identify areas that may benefit from refactoring, based on principles from Martin Fowler's refactoring catalog. Output can be formatted as text, YAML, JSON, or HTML for integration with CI pipelines and code review workflows. Individual smell types can be included or excluded with --only and --except, and project-wide configuration in .reek.yml allows tuning thresholds and excluding paths.

How do I run a basic reek example?

Run `reek [file.rb]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -f, --format _format_ do in reek?

Output format (text, yaml, json, html).