An open API service indexing awesome lists of open source software.

https://github.com/shinagawa-web/gomarklint

A fast and configurable Markdown linter written in Go
https://github.com/shinagawa-web/gomarklint

cli go link-checker linter linting markdown markdown-lint static-analysis

Last synced: about 1 month ago
JSON representation

A fast and configurable Markdown linter written in Go

Awesome Lists containing this project

README

          

# gomarklint

![Test](https://github.com/shinagawa-web/gomarklint/actions/workflows/test.yml/badge.svg)
[![codecov](https://codecov.io/gh/shinagawa-web/gomarklint/graph/badge.svg?token=5MGCYZZY7S)](https://codecov.io/gh/shinagawa-web/gomarklint)
[![Go Report Card](https://goreportcard.com/badge/github.com/shinagawa-web/gomarklint)](https://goreportcard.com/report/github.com/shinagawa-web/gomarklint)
[![Go Reference](https://pkg.go.dev/badge/github.com/shinagawa-web/gomarklint.svg)](https://pkg.go.dev/github.com/shinagawa-web/gomarklint)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/shinagawa-web/gomarklint/badge)](https://securityscorecards.dev/viewer/?uri=github.com/shinagawa-web/gomarklint)
[![OpenSSF Best Practices](https://www.bestpractices.dev/projects/12970/badge)](https://www.bestpractices.dev/projects/12970)

[English](README.md) | 日本語

Demo

> リンク切れをユーザーより先に発見。内部アンカーはデフォルトで検証、外部 URL は `external-link` を有効化して検証。**100,000 行以上を約 170ms** で処理。シングルバイナリで Node.js 不要。

**かんたんインストール**(macOS / Linux):

```sh
curl -fsSL https://raw.githubusercontent.com/shinagawa-web/gomarklint/main/install.sh | sh
```

**バイナリをダウンロード**(Go 環境不要):

[GitHub Releases](https://github.com/shinagawa-web/gomarklint/releases/latest) からお使いのプラットフォーム向けバイナリをダウンロードできます。

```sh
# macOS / Linux
tar -xzf gomarklint_Darwin_x86_64.tar.gz
sudo mv gomarklint /usr/local/bin/
# sudo が使えない場合はユーザーローカルへ
mkdir -p ~/.local/bin && mv gomarklint ~/.local/bin/
```

```powershell
# Windows (PowerShell)
Expand-Archive -Path gomarklint_Windows_x86_64.zip -DestinationPath "$env:LOCALAPPDATA\Programs\gomarklint"
# PATH に追加(初回のみ)
[Environment]::SetEnvironmentVariable("PATH", $env:PATH + ";$env:LOCALAPPDATA\Programs\gomarklint", "User")
```

**Homebrew を使う場合:**

```sh
brew install shinagawa-web/tap/gomarklint
```

**npm を使う場合:**

```sh
npm install -g @shinagawa-web/gomarklint
```

**`go install` を使う場合:**

```sh
go install github.com/shinagawa-web/gomarklint/v3@latest
```

- リンク切れをユーザーより先に発見 — 内部アンカーはデフォルトで検証。`external-link` を有効化すると外部 URL も検証。
- **100,000 行以上を約 170ms** で処理 — JIT ウォームアップなし、ランタイムオーバーヘッドなし。
- 予測可能な構造を強制(「なぜ H2 の下に H4 があるの?」をなくす)。
- 人間にも機械にも優しい出力(JSON 対応)。

## CI 連携

### GitHub Actions

```yaml
name: gomarklint

on:
push:
pull_request:

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: shinagawa-web/gomarklint-action@v1
with:
args: '.'
```

オプションの詳細: [gomarklint-action](https://github.com/shinagawa-web/gomarklint-action)

### pre-commit

`.pre-commit-config.yaml` に追加:

```yaml
repos:
- repo: https://github.com/shinagawa-web/gomarklint
rev: v3.0.0
hooks:
- id: gomarklint
```

## ドキュメント

完全なドキュメントは **[shinagawa-web.github.io/gomarklint](https://shinagawa-web.github.io/gomarklint/)** で参照できます。

- [クイックスタート](https://shinagawa-web.github.io/gomarklint/docs/quick-start/)
- [ルール一覧](https://shinagawa-web.github.io/gomarklint/docs/rules/)
- [CLI リファレンス](https://shinagawa-web.github.io/gomarklint/docs/cli/)
- [設定](https://shinagawa-web.github.io/gomarklint/docs/configuration/)
- [GitHub Actions 連携](https://shinagawa-web.github.io/gomarklint/docs/github-actions/)
- [FAQ & トラブルシューティング](https://shinagawa-web.github.io/gomarklint/docs/faq/)

## コントリビュート

Issue・提案・PR 歓迎です!

必要環境: Go `1.22+`(最新の安定版を推奨)

```sh
make test # ユニットテスト
make test-e2e # エンドツーエンドテスト
make build # バイナリビルド
```

### Git フック

プッシュ前に自動でlintとユニットテストを実行するpre-pushフックをインストールできます:

```sh
make install-hooks
```

緊急時にフックをスキップする場合:

```sh
git push --no-verify
```

## ライセンス

MIT License