clojure-review by metabase/metabase
npx skills add https://github.com/metabase/metabase --skill clojure-review@./../_shared/clojure-style-guide.md @./../_shared/clojure-commands.md
需要标记的内容:
CLOJURE_STYLE_GUIDE.adoc 文件,还需检查是否符合社区 Clojure 风格指南不应发布的内容:
应避免的不良代码审查评论示例:
这个 TODO 注释格式正确,包含了作者和日期 - 干得好!
在查询中添加 limit 1 很好 - 这在不改变测试行为的情况下使其更高效。
kondo 忽略注释放在这里很合适
测试名称按照风格指南的要求正确以 -test 结尾。
特殊情况:
使用此清单高效扫描变更:
tbl、)广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
zs'kebab-case! 结尾src 或 enterprise/backend/src 中的公共变量具有有用的文档字符串[[other-var]] 而非反引号TODO 注释包含作者和日期:;; TODO (Name 2025-01-01) -- description^:privatedeclare(公共函数放在末尾附近)let/cond 中的成对结构除外)deftest 形式^:parallel-test 或 -test-<number> 结尾metabase.<module>.*,EE:metabase-enterprise.<module>.*)<module>.api 命名空间中<module>.core 中,使用 Potemkin:clj-kondo/ignore [:metabase/modules] 来规避模块 linter:- <schema>)snake_case/api/dashboard/:id)GET 请求没有副作用(分析除外)lib、lib-be 或 query-processor 模块之外进行原始的 MBQL 操作t2/select-one-fn 而不是为单列选择整行docs/developers-guide/driver-changelog.md 中记录driver 参数传递给其他驱动程序方法(不硬编码驱动程序名称)read-column-thunk 中的逻辑最少#_:clj-kondo/ignore 关键字形式)快速扫描常见问题:
| 模式 | 问题 |
|---|---|
calculate-age、get-user | 纯函数应为名词:age、user |
update-db、save-model | 有副作用的函数缺少 !:update-db!、save-model! |
snake_case_var | 应使用 kebab-case |
| 公共变量没有文档字符串 | 添加解释其目的、输入和输出的文档字符串 |
;; TODO fix this | 缺少作者/日期:;; TODO (Name 2025-01-01) -- description |
(defn foo ...) 在命名空间中被其他地方使用 | 应标记为 (defn ^:private foo ...) |
| 函数 > 20 行 | 考虑拆分为更小的函数 |
/api/dashboards/:id | 使用单数形式:/api/dashboard/:id |
查询参数使用 snake_case | 查询参数应使用 kebab-case |
| 新的 API 端点没有测试 | 为该端点添加测试 |
对于风格违规:
这个纯函数应命名为描述其返回值的名词。考虑使用
user而非get-user。
对于缺少文档:
这个公共变量需要一个解释其目的、输入和输出的文档字符串。
对于组织问题:
这个函数仅在此命名空间中使用,因此应标记为
^:private。
对于 API 约定:
查询参数应使用 kebab-case。将
user_id改为user-id。
每周安装次数
165
代码仓库
GitHub 星标数
46.5K
首次出现时间
2026年1月20日
安全审计
安装于
claude-code156
opencode155
gemini-cli147
codex147
github-copilot145
cursor145
@./../_shared/clojure-style-guide.md @./../_shared/clojure-commands.md
What to flag:
CLOJURE_STYLE_GUIDE.adoc exists in the working directory, also check compliance with the community Clojure style guideWhat NOT to post:
Example bad code review comments to avoid:
This TODO comment is properly formatted with author and date - nice work!
Good addition of limit 1 to the query - this makes the test more efficient without changing its behavior.
The kondo ignore comment is appropriately placed here
Test name properly ends with -test as required by the style guide.
Special cases:
Use this to scan through changes efficiently:
tbl, zs')kebab-case for all variables and functions!src or enterprise/backend/src have useful docstrings[[other-var]] not backticksTODO comments include author and date: ;; TODO (Name 2025-01-01) -- description^:private unless used elsewheredeclare when avoidable (public functions near end)let/cond)deftest forms for distinct test cases^:parallel-test or -test-<number>metabase.<module>.*, EE: metabase-enterprise.<module>.*)<module>.api namespaces<module>.core with Potemkin:clj-kondo/ignore [:metabase/modules]:- <schema>)snake_case/api/dashboard/:id)GET has no side effects (except analytics)lib, lib-be, or query-processor modulest2/select-one-fn instead of selecting full rows for one columndocs/developers-guide/driver-changelog.mddriver argument to other driver methods (no hardcoded driver names)read-column-thunk#_:clj-kondo/ignore keyword form)Quick scan for common issues:
| Pattern | Issue |
|---|---|
calculate-age, get-user | Pure functions should be nouns: age, user |
update-db, save-model | Missing ! for side effects: update-db!, save-model! |
For style violations:
This pure function should be named as a noun describing its return value. Consider
userinstead ofget-user.
For missing documentation:
This public var needs a docstring explaining its purpose, inputs, and outputs.
For organization issues:
This function is only used in this namespace, so it should be marked
^:private.
For API conventions:
Query parameters should use kebab-case. Change
user_idtouser-id.
Weekly Installs
165
Repository
GitHub Stars
46.5K
First Seen
Jan 20, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
claude-code156
opencode155
gemini-cli147
codex147
github-copilot145
cursor145
Next.js 15+ 最佳实践指南:文件约定、RSC边界、异步模式与性能优化
1,200 周安装
Elastic Cloud 访问管理技能:用户邀请、角色分配与API密钥管理
201 周安装
LLM结构化输出提取器:从AI响应中提取类型化数据的完整指南
70 周安装
SwiftUI动画完全指南:从Animatable协议到iOS 26的@Animatable宏
195 周安装
Feishu Image Sender - 向飞书/Lark发送图片的CLI工具和Node.js库
193 周安装
如何向AI工作流添加新技能?GitHub技能下载与文档更新完整指南
194 周安装
FPGA开发专家指南:Vivado、SystemVerilog硬件设计优化与高级技术实践
196 周安装
snake_case_var | Should use kebab-case |
| Public var without docstring | Add docstring explaining purpose |
;; TODO fix this | Missing author/date: ;; TODO (Name 2025-01-01) -- description |
(defn foo ...) in namespace used elsewhere | Should be (defn ^:private foo ...) |
| Function > 20 lines | Consider breaking up into smaller functions |
/api/dashboards/:id | Use singular: /api/dashboard/:id |
Query params with snake_case | Use kebab-case for query params |
| New API endpoint without tests | Add tests for the endpoint |