hindent
581
Stars
116
Forks
9
Watchers
28
Open Issues
NOASSERTION
许可证
Haskell
语言
2014-08-24
创建时间
2026-11-09
最近更新
项目能做什么
hindent 是一款 Haskell 代码格式化工具。它解决 Haskell 代码排版不统一的问题,核心功能包括:按管道流或文件重新排版代码、自定义缩进与行宽、自动排序 import、配置特定换行符,以及支持指定 GHC 语言扩展语法。
来源:AI 基于仓库事实生成
· 内容以仓库实际 README 为准
使用说明 查看原始 README 原仓库文档
中文使用说明暂未生成。下面保留原仓库 README 摘录,命令与配置均以原文为准。
原始 README 摘录(英文原文,节选前 3000 字符)
# hindent [](https://hackage.haskell.org/package/hindent) [](https://github.com/mihaimaruseac/hindent/actions/workflows/presubmit-cabal.yaml) [](https://github.com/mihaimaruseac/hindent/actions/workflows/presubmit-stack.yaml) [](https://api.securityscorecards.dev/projects/github.com/mihaimaruseac/hindent)
Haskell pretty printer
[Examples](https://github.com/mihaimaruseac/hindent/blob/master/TESTS.md)
## Install
$ stack install hindent
## Usage
$ hindent --help
hindent - Reformat Haskell source code
Usage: hindent [--version | [--line-length ARG]
[--indent-size ARG | --tab-size ARG] [--no-force-newline]
[--sort-imports | --no-sort-imports] [--style STYLE]
[-X GHCEXT] [--validate] [FILENAMES]]
Available options:
--version Print the version
--line-length ARG Desired length of lines (default: 80)
--indent-size ARG Indentation size in spaces (default: 2)
--tab-size ARG Same as --indent-size, for compatibility
--no-force-newline Don't force a trailing newline
--sort-imports Sort imports in groups
--no-sort-imports Don't sort imports
--style STYLE Style to print with (historical, now ignored)
-X GHCEXT Language extension
--validate Check if files are formatted without changing them
-h,--help Show this help text
hindent is used in a pipeline style
$ cat path/to/sourcefile.hs | hindent
The default indentation size is `2` spaces. Configure indentation size with `--indent-size`:
$ echo 'example = case x of Just p -> foo bar' | hindent --indent-size 2; echo
example =
case x of
Just p -> foo bar
$ echo 'example = case x of Just p -> foo bar' | hindent --indent-size 4; echo
example =
case x of
Just p -> foo bar
## Customization
Create a `.hindent.yaml` file in your project directory or in your
`~/` home directory. The following fields are accepted and are the
default:
``` yaml
indent-size: 2
line-length: 80
force-trailing-newline: true
sort-imports: true
line-breaks: []
extensions: [
"GHC2021",
"ListTuplePuns",
]
```
By default, hindent preserves the newline or lack of newline in your input. With `force-trailing-newline`, it will make sure there is always a trailing newline.
hindent can be forced to insert a newline before specific operators and tokens with `line-breaks`. This is especially useful when utilizing libraries like [`servant`](https
阅读完整原文
项目深度分析 AI 生成
企业级 Haskell 代码规范与合规检查 CI 插件服务
| 产品构想 | 基于 hindent 的 AST 解析能力与格式化规则,封装为云端 CI/CD 代码门禁与自动修复服务,提供报告与格式一致性审计。 |
| 核心功能 | GitHub Actions/GitLab CI 集成、团队统一风格配置下发、PR 自动格式化修复并提交流程、格式合规审计日志。 |
| 目标用户 | 使用 Haskell 的中大型金融科技公司、Web3/区块链项目方(推测)。 |
| 难度/周期 | 中等 · 2-3 个月 · 成本:低(基础服务器及集成环境成本) |
| 收费模式 | SaaS 订阅制(按团队席位或代码仓库数收费)。 |
| 竞争风险 | Haskell 生态小众;Ormolu、Fourmolu 等替代品竞争激烈且社区完全开源免费;开发者偏好本地免费 CLI。 |
| 依据 | AI推测 |
IDE / 编辑器增强生态插件及增值功能
| 产品构想 | 为 VSCode/JetBrains 开发针对复杂 Haskell 语法的高性能格式化与重构插件(内嵌 hindent 核心)。 |
| 核心功能 | 局部代码块即时排版、与 HLS (Haskell Language Server) 深度联动、复杂 AST 语法扩展自定义排版。 |
| 目标用户 | 在日常开发中使用 VSCode 或 IntelliJ 的 Haskell 工程师。 |
| 难度/周期 | 中等 · 1-2 个月 · 成本:极低 |
| 收费模式 | 免费开源基础版 + 高级重构功能付费/赞助模式。 |
| 竞争风险 | 主流编辑器已存在成熟开源扩展(如 HLS 内置格式化),用户无付费意愿。 |
| 依据 | 尚需验证的假设 |
面向高可靠性金融系统的 Haskell 代码规范治理咨询
| 产品构想 | 针对使用 Haskell 的金融或区块链企业,提供专属的代码规范制定、工程工具链迁移与统一排版工具链定制维护。 |
| 核心功能 | 定制化 AST 规则开发、旧代码库全量安全重排版、CI/CD 自动化集成方案。 |
| 目标用户 | 银行、量化交易机构、区块链底层开发团队(推测)。 |
| 难度/周期 | 高 · 按项目交付(1-3 个月/单) · 成本:极低(主要是人力成本) |
| 收费模式 | 项目制技术咨询与维保服务费。 |
| 竞争风险 | 客群基数极小,获客渠道受限;企业内通常有资深 Haskell 工程师自行解决。 |
| 依据 | 已验证事实 |
AI 基于仓库公开数据分析生成,含推测成分,不构成收益承诺。
报告会保存到 个人中心
竞品与相似项目 GitHub Search 真实检索
相似项目数据正在完善中,暂不展示(避免误导)
项目优势与风险
| 技术成熟度 | 创建于 2014-08-24,近 30 天仍在推送,发布过 11 个 Release |
| 社区活跃 | Star 581 / Fork 116 / Issue 28(数据支持,可自行核实) |
| 许可证 | NOASSERTION |
| 主要风险 | 上游项目方向可能变化;同赛道竞争者较多(见竞品表);热度与需求不完全等价 |
安装与使用
此项目未提供 Docker 镜像,安装步骤以原仓库 README 为准(涉及依赖安装与环境配置,对新手门槛较高)。