← 返回命令列表

Linux command

hlint 命令

文件

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

常用示例

Example

hlint [path/to/file.hs]

Example

hlint [path/to/directory] -r

Automatically apply

hlint [path/to/file.hs] --refactor

Example

hlint [path/to/file.hs] --refactor-options

Example

hlint [path/to/file.hs] --default > .hlint.yaml

说明

hlint is a tool for suggesting improvements to Haskell source code. It analyzes code and provides suggestions for simplification, redundancy removal, and style improvements based on common Haskell idioms. Suggestions include simplifying expressions, removing unnecessary extensions, applying standard library functions, and following best practices. The tool can automatically apply many of its suggestions through the refactor mode. Configuration files (.hlint.yaml) allow customizing which hints to apply or ignore on a per-project basis.

参数

-r, --report
Generate an HTML report of suggestions
--refactor
Automatically apply suggestions using refactor tool
--refactor-options
Display available refactoring options
--default
Generate default configuration ignoring current hints
-h, --hint _FILE_
Use hints from specified file
--ignore _HINT_
Ignore a specific hint

FAQ

What is the hlint command used for?

hlint is a tool for suggesting improvements to Haskell source code. It analyzes code and provides suggestions for simplification, redundancy removal, and style improvements based on common Haskell idioms. Suggestions include simplifying expressions, removing unnecessary extensions, applying standard library functions, and following best practices. The tool can automatically apply many of its suggestions through the refactor mode. Configuration files (.hlint.yaml) allow customizing which hints to apply or ignore on a per-project basis.

How do I run a basic hlint example?

Run `hlint [path/to/file.hs]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -r, --report do in hlint?

Generate an HTML report of suggestions