Skip to content
cl-mallet-linter logo

Mallet Linter Guide

cl-mallet-linter

malletリンターのルールと設定を適用。コードレビュー・品質チェック時に使用

SKILL.md

Full skill instructions

Mallet Linter Guide

Malletは、スタイルの強制ではなく実際の間違いを捉えることに特化したCommon Lispリンターです。

基本コマンド

# ファイル/ディレクトリをリント
mallet src/

# 全ルール有効化
mallet -a src/
mallet --all src/

# 自動修正(ドライラン)
mallet --fix-dry-run src/

# 自動修正実行
mallet --fix src/

# 出力形式指定
mallet --format json src/
mallet --format line src/   # GCC形式

重大度レベル

レベル説明例
error確実に間違いwrong-otherwise
warningバグの可能性unused-variables, missing-otherwise
conventionイディオム推奨if-without-else, special-variable-naming
formatフォーマットtrailing-whitespace, no-tabs
infoスタイル選択line-length, constant-naming
metrics品質測定cyclomatic-complexity, function-length

主要ルール

Error(エラー)

ルール説明
wrong-otherwiseecase/​etypecaseでotherwise/​tを使用

Warning(警告)

ルール説明
unused-variables未使用変数
unused-local-functions未使用ローカル関数
missing-otherwisecase/​typecaseにotherwise句がない
mixed-optional-and-key&optionalと&keyの混在

Convention(慣例)

ルール説明
if-without-elseelse節なしのif → when/​unless推奨
bare-progn-in-ififでprogn → cond推奨
interned-package-symbolパッケージで#:形式推奨
special-variable-naming特殊変数はname形式
asdf-component-stringsASDFコンポーネントに文字列使用

Format(フォーマット)

ルール説明
no-tabsタブ禁止
trailing-whitespace行末空白
final-newlineファイル末尾改行

Info(情報)

ルール説明デフォルト
line-length最大行長100
consecutive-blank-lines連続空行2
unused-local-nicknames未使用ニックネーム-
unused-imported-symbols未使用インポート-
constant-naming定数は+name+形式-
needless-let*不要なlet*-

Metrics(メトリクス)

ルール説明デフォルト
cyclomatic-complexity循環複雑度20
function-length関数行数50

設定ファイル (.mallet.lisp)

(:mallet-config
 ;; ベース設定
 (:extends :default)  ; :default, :all, :none

 ;; 無視パス
 (:ignore "vendor/​**/​*.lisp"
          "**/​generated/​*.lisp"
          "examples/​**/​*.lisp")

 ;; ルール有効化(オプション付き)
 (:enable :line-length :max 100)
 (:enable :cyclomatic-complexity :max 15)
 (:enable :function-length :max 40)
 (:enable :consecutive-blank-lines :max 2)
 (:enable :constant-naming)

 ;; ルール無効化
 (:disable :if-without-else)

 ;; パス固有設定
 (:for-paths ("tests")
   (:enable :line-length :max 120)
   (:disable :unused-variables))

 (:for-paths ("scripts" "examples")
   (:disable :line-length)
   (:disable :trailing-whitespace)))

CLIオプション

# プリセット
--preset default    # 推奨ルールのみ
--preset all        # 全ルール
--preset none       # ルールなし

# ルール制御
--enable rule-name
--enable rule-name:opt=value
--disable rule-name
--enable-group metrics
--disable-group info

# 出力
--format text       # デフォルト
--format line       # GCC形式(エディタ統合用)
--format json       # プログラム処理用

# 修正
--fix               # 自動修正
--fix-dry-run       # 修正プレビュー

# その他
--config path       # 設定ファイル指定
--debug             # デバッグモード

自動修正可能なルール

以下のルールは --fix で自動修正可能:

  • trailing-whitespace - 行末空白を削除
  • final-newline - ファイル末尾に改行追加
  • consecutive-blank-lines - 過度な空行を削除
  • unused-local-nicknames - 未使用ニックネームを削除
  • unused-imported-symbols - 未使用インポートを削除

ソースコード内での抑制

;; 次のフォームを抑制
#+mallet
(declaim (mallet:suppress-next :if-without-else))
(defun foo () (if x (print "yes")))

;; 領域を抑制
#+mallet
(declaim (mallet:disable :line-length))
;; ... 長い行のコード ...
#+mallet
(declaim (mallet:enable :line-length))

;; スコープ内で抑制
(defun foo ()
  #+mallet
  (declare (mallet:suppress :unused-variables))
  (let ((unused 1))
    (do-something)))

;; 全ルール抑制
#+mallet
(declaim (mallet:suppress-next :all))
(defun generated-code () ...)

終了コード

コード意味
0問題なし
1警告あり
2エラーあり
3実行エラー

推奨ワークフロー

開発中

# デフォルトルールでチェック
mallet src/

# 問題を確認して修正
mallet --fix-dry-run src/
mallet --fix src/

PR前

# 全ルールでチェック
mallet -a src/

# メトリクス確認
mallet --enable-group metrics src/

CI/​CD

# 厳格チェック(エラーで失敗)
mallet --format line src/ && echo "Lint passed"

More skills from majiayu000

xiaohongshu logo
majiayu000/claude-arsenal

xiaohongshu

xiaohongshu

286 148
View
agent-task-conductor logo
majiayu000/claude-skill-registry

agent-task-conductor

Conduct multi-agent task orchestration and workflow coordination.

663 1
View
conductor-setup logo
majiayu000/claude-skill-registry

conductor-setup

Initialize project with Conductor artifacts (product definition,

663 1
View
animation-designer logo
majiayu000/claude-skill-registry

animation-designer

Expert in web animations, transitions, and motion design using Framer Motion and CSS

663 1
View
diagramming logo
majiayu000/claude-skill-registry

diagramming

Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...

663 1
View
h3-pg logo
majiayu000/claude-skill-registry-data

h3-pg

PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.

23 1
View
conductor-development logo
majiayu000/claude-skill-registry

conductor-development

Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...

663 1
View
conductor-status logo
majiayu000/claude-skill-registry

conductor-status

Display project status, active tracks, and next actions

663 1
View
dockerization logo
majiayu000/claude-skill-registry

dockerization

Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.

663 1
View

Popular AI tools

Kaiber logo
Video

Kaiber

Generate, edit, and beat-sync AI video with leading models in one workspace.

Paid
View
Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View

Transform Your Design with AI Designer by ImgCreator.ai

Freemium
View
Akool AI logo
Content & writing

Akool AI

Revolutionizing Video Production with AI-Powered Creativity

Paid
View

Extend an image past the frame and let AI fill the new aspect ratio.

Freemium
View
StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View