# 使用 Homebrew, apk, apt, dnf, MacPorts, Nix, pacman, zypper 安装 hlint

查看 hlint 的安装路径、可执行文件、元数据以及面向 AI 代理工作流的安全说明。

## 安装

```sh
sudo av install brew:hlint
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install hlint
```

  证据: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install hlint
```

  证据: MacPorts ports tree: devel/hlint/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1

### Linux

- apk (92%):

```sh
sudo apk add hlint
```

  证据: Alpine Linux edge package indexes: hlint from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz

- Debian apt (92%):

```sh
sudo apt install hlint
```

  证据: Debian stable package indexes: hlint from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz

- dnf (92%):

```sh
sudo dnf install hlint
```

  证据: Fedora Rawhide package metadata: hlint from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst

- Nix (92%):

```sh
nix profile install nixpkgs#hlint
```

  证据: nixpkgs package indexes: hlint from https://raw.githubusercontent.com/NixOS/nixpkgs/master/pkgs/top-level/all-packages.nix

- pacman (92%):

```sh
sudo pacman -S hlint
```

  证据: Arch Linux sync databases: hlint from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz

- zypper (92%):

```sh
sudo zypper install hlint
```

  证据: openSUSE Tumbleweed package metadata: hlint from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst

## 软件包事实

- **软件包键:** brew:hlint
- **软件包管理器:** Homebrew
- **版本:** 3.10
- **来源摘要:** Haskell source code suggestions
- **主页:** <https://github.com/ndmitchell/hlint>
- **仓库:** <https://github.com/ndmitchell/hlint>
- **最后更新:** 2026-07-22T14:14:26Z
- **已生成:** 2026-08-03T19:37:03+00:00

## 可执行文件

- hlint (别名)

## 安装行为

- Bottle: 不可用

## 版本和新鲜度

- 页面生成时间: 2026-08-03
- 管理器版本: 3.10
## 项目历史与用法

HLint is Neil Mitchell's Haskell source-code suggestion tool. It parses Haskell modules and reports style, simplification, redundancy, and maintainability hints, with configuration through .hlint.yaml and integrations across editors, CI systems, and Haskell IDE tooling.

### 项目历史

The hlint.cabal file gives Neil Mitchell as author and maintainer and carries a copyright line beginning in 2006. Neil Mitchell's publication page ties HLint to a longer research and tooling thread around transformation and analysis of Haskell source code, including a 2007 thesis seminar and a 2008 PhD thesis on functional-program transformation and analysis.

HLint's README describes its core purpose as suggesting possible improvements such as alternative functions, code simplification, and spotting redundancies. It deliberately operates on modules in isolation rather than typechecking whole projects, a tradeoff that lets it parallelize, run incrementally, and analyze code that may not compile yet.

In 2017, HLint 2.0 moved configuration toward YAML. Neil Mitchell's release post says earlier configuration used specially crafted Haskell files, while HLint 2.0 added .hlint.yaml search from the working directory upward and encouraged YAML because the Haskell-based format had become overloaded.

By 2020, HLint had undergone a major parser migration. Mitchell's MuniHac talk abstract describes HLint as over 14 years old, notes changes in license, project name, source control, and configuration, and explains the move from haskell-src-exts toward the GHC API via ghc-lib as GHC compatibility became more important.

### 采用历史

HLint became a standard Haskell development utility because it can be run cheaply during local development, code review, and CI. The README documents installation through the ordinary Haskell toolchain, direct binary use in CI, and workflows that generate an initial report before committing a project-specific .hlint.yaml baseline.

The README also documents broad integration: editor plugins, Haskell Language Server, ghc-mod, Intero, GHC source plugins, Code Climate, Danger, Restyled, HLint test helpers, GitHub Actions, and code-scanning workflows. That integration footprint made HLint visible both to individual Haskell developers and to larger codebases enforcing house style.

### 使用方式

A normal run is hlint source, where source is a file or directory. HLint recursively scans .hs and .lhs files, reports file/line locations, severity, the code it found, and a possible replacement. For larger projects, hlint . --report creates an HTML report, and hlint . --default can create a .hlint.yaml file that records outstanding hints.

HLint suggestions are intentionally advisory. The README warns that most hints are good ideas in many circumstances but should not be applied blindly, especially when contributing to another project or when language extensions and laziness semantics matter.

### 为什么软件包爱好者会关心

HLint is one of the canonical Haskell developer-tool packages: small enough to run locally, opinionated enough to teach idioms, and integrated enough to show up in editors, CI, code review bots, and language-server diagnostics.

For package maintainers, HLint matters because it externalizes style and simplification rules into a configurable tool. Projects can ship .hlint.yaml to encode local decisions, silence accepted warnings, and add custom hints without requiring every contributor to internalize the entire style guide.

Its long parser and configuration evolution also mirrors the Haskell ecosystem's own tooling history: from custom parsers and Haskell-flavored config toward YAML project files, ghc-lib, and tighter integration with the compiler and language-server stack.

### 时间线

- 2006: HLint authorship/copyright line begins in hlint.cabal.
- 2007: Neil Mitchell presented work on transformation and analysis of Haskell source code.
- 2008: Neil Mitchell's PhD thesis on transformation and analysis of functional programs was published.
- 2013: The ndmitchell/hlint GitHub repository was created.
- 2017-04-06: HLint 2.0 introduced YAML configuration and .hlint.yaml search.
- 2020-09-11: The MuniHac talk described HLint's migration to the GHC API parser via ghc-lib.

### Related projects

- GHC and ghc-lib: parser/compiler infrastructure used by HLint's later parser architecture.
- haskell-src-exts: the parser library HLint used before the GHC API migration.
- Haskell Language Server, ghc-mod, Intero: Haskell tooling integrations named by the README.
- apply-refact: the refactoring helper used when HLint applies suggestions with --refactor.

### 来源

- <https://api.github.com/repos/ndmitchell/hlint>
- <https://ndmitchell.com/>
- <https://neilmitchell.blogspot.com/2017/04/hlint-20-with-yaml-configuration.html>
- <https://raw.githubusercontent.com/ndmitchell/hlint/master/README.md>
- <https://raw.githubusercontent.com/ndmitchell/hlint/master/hlint.cabal>
- input: source_facts.package-manager


## 安全说明

narrow executable package without higher-risk signals.

- **Geiger 风险:** 绿色 / 低
- narrow executable package without higher-risk signals


## Configuration and credential file locations

These source-backed paths show where this package keeps local settings or durable credentials. Automic Vault can use them as review targets for secret scanning, migration, and command approval.


## Configuration files

- Unix: .hlint.yaml
## 其他软件包管理器记录

- Debian apt - hlint - 3.6.1-1+b1: normalized package name match | Debian stable package indexes: hlint from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | Haskell source code suggestions | https://github.com/ndmitchell/hlint#readme
- Debian apt - libghc-hlint-dev - 3.6.1-1+b1: normalized package name match | Debian stable package indexes: libghc-hlint-dev from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | Haskell source code suggestions | https://github.com/ndmitchell/hlint#readme
- Debian apt - libghc-hlint-doc - 3.6.1-1: normalized package name match | Debian stable package indexes: libghc-hlint-doc from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | Haskell source code suggestions; documentation | https://github.com/ndmitchell/hlint#readme
- Debian apt - libghc-hlint-prof - 3.6.1-1+b1: normalized package name match | Debian stable package indexes: libghc-hlint-prof from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | Haskell source code suggestions; profiling libraries | https://github.com/ndmitchell/hlint#readme
- Nix - hlint: normalized package name match | nixpkgs package indexes: hlint from https://raw.githubusercontent.com/NixOS/nixpkgs/master/pkgs/top-level/all-packages.nix
- Ubuntu apt - hlint - 3.5-1build1: normalized package name match | Ubuntu 24.04 LTS package indexes: hlint from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | Haskell source code suggestions | https://github.com/ndmitchell/hlint#readme
- Ubuntu apt - libghc-hlint-dev - 3.5-1build1: normalized package name match | Ubuntu 24.04 LTS package indexes: libghc-hlint-dev from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | Haskell source code suggestions | https://github.com/ndmitchell/hlint#readme
- Ubuntu apt - libghc-hlint-doc - 3.5-1build1: normalized package name match | Ubuntu 24.04 LTS package indexes: libghc-hlint-doc from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | Haskell source code suggestions; documentation | https://github.com/ndmitchell/hlint#readme
- Ubuntu apt - libghc-hlint-prof - 3.5-1build1: normalized package name match | Ubuntu 24.04 LTS package indexes: libghc-hlint-prof from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | Haskell source code suggestions; profiling libraries | https://github.com/ndmitchell/hlint#readme
- apk - hlint - 3.10-r0: normalized package name match | Alpine Linux edge package indexes: hlint from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Linter for Haskell source code | https://github.com/ndmitchell/hlint
- dnf - ghc-deriving-aeson - 0.2.10-13.fc45: normalized package name match | Fedora Rawhide package metadata: ghc-deriving-aeson from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst | Haskell deriving-aeson library | https://hackage.haskell.org/package/deriving-aeson
- dnf - ghc-deriving-aeson-devel - 0.2.10-13.fc45: normalized package name match | Fedora Rawhide package metadata: ghc-deriving-aeson-devel from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst | Haskell deriving-aeson library development files | https://hackage.haskell.org/package/hlint
- dnf - ghc-deriving-aeson-doc - 0.2.10-13.fc45: normalized package name match | Fedora Rawhide package metadata: ghc-deriving-aeson-doc from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst | Haskell deriving-aeson library documentation | https://hackage.haskell.org/package/hlint
- dnf - ghc-deriving-aeson-prof - 0.2.10-13.fc45: normalized package name match | Fedora Rawhide package metadata: ghc-deriving-aeson-prof from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst | Haskell deriving-aeson profiling library | https://hackage.haskell.org/package/hlint
- dnf - ghc-ghc-lib-parser-ex - 9.12.0.0-13.fc45: normalized package name match | Fedora Rawhide package metadata: ghc-ghc-lib-parser-ex from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst | Haskell ghc-lib-parser-ex library | https://hackage.haskell.org/package/ghc-lib-parser-ex
- dnf - ghc-ghc-lib-parser-ex-devel - 9.12.0.0-13.fc45: normalized package name match | Fedora Rawhide package metadata: ghc-ghc-lib-parser-ex-devel from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst | Haskell ghc-lib-parser-ex library development files | https://hackage.haskell.org/package/hlint


## Combined YAML source

View the package source record on GitHub. [combined/hlint.yml](https://github.com/mxcl/pkgdb/blob/main/combined/hlint.yml)


## 来源

- pkg.so package database
- Geiger risk classifier
- curated configuration and credential file locations
- curated package history
- pkgdb category and tag curation
- external package-manager database matches
- cross-ecosystem install command graph
