Julia: `format(".")` + `git diff` + `exit(1)` is a formatting gate; biome via biome_jll in a julia -e one-liner

未關閉 適合新手
#267 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

難度
2/5
預估耗時
1-3 小時
新手友好度
62/100
Issue 類型
缺陷
描述清晰度
基本清楚
活躍度
活躍
技術堆疊
julia, python
領域
ci-cd, tooling

研究方向

偽陰性來自 project_validator/ecosystems/julia.py(約第 169 行)中的正規表示式 _FAILS,它只接受 || exit(1) 或 @assert format。從 corpus/ .github/workflows/format_check.yml 第 18-31 行的 JuMP.jl 工作流程開始,檢查 julia 設定檔如何讀取其中的程式碼格式檢查。完成標準是:該工作流程在 code-formatting 項目上被判定為 PASS,現有的 julia 語料庫預期仍然成立,且測試套件通過。Documenter.jl 的 biome 項目信心較低,可以不納入這次修復。

由索引模型根據 Issue 內容生成。

描述

JuMP.jl's format-check job runs format(".") and exits 1 when git diff is non-empty — exactly the "fails on a changed file" criterion the Julia profile documents — but the recogniser accepts only the literal || exit(1) or @assert format: FAIL "CI runs JuliaFormatter but only to rewrite files". Documenter.jl's make check-js runs biome check through the biome_jll wrapper inside a julia -e one-liner → code-formatting/static-analysis WARN.

Evidence from the corpus audit

jump-dev/JuMP.jl / code-formatting
  • kind: FALSE_NEGATIVE
  • actual: FAIL: CI runs JuliaFormatter but only to rewrite files; nothing fails when they are not formatted
  • expected: PASS: the format-check job runs format(".") and then exits 1 when git diff is non-empty, which is exactly the "fails on a file it changed" criterion the Julia profile documents; the recogniser only accepts the literal || exit(1) or @assert format.
  • evidence: .github/workflows/format_check.yml:18-31: shell: julia --color=yes {0} / run: | / ... / format("."; verbose = true) / out = String(read(Cmd(\git diff`)))/ if isempty(out)/ exit(0)/ end/ @error "Some files have not been formatted !!!"/ write(stdout, out)/ exit(1); project_validator/ecosystems/julia.py:169: _FAILS = re.compile(r"||\sexit\s(\s1\s)|@assert\s+format")`
  • repro: the 12-line julia step above in a workflow with shell: julia --color=yes {0}
  • confidence: high
JuliaDocs/Documenter.jl / code-formatting, static-analysis (Biome via biome_jll)
  • kind: UNSUPPORTED
  • actual: code-formatting WARN .prettierrc, biome.jsonc is defined but CI does not run prettier, deno fmt, oxfmt, dprint or biome; static-analysis WARN biome is configured (biome.jsonc) but does not run
  • expected: CI's "Biome (JS code formatting)" job runs make check-js, whose recipe runs biome check through the Julia biome_jll wrapper and exits with biome's status. The Makefile target is followed (no unread reason) but the biome invocation inside a julia one-liner is not recognised.
  • evidence: .github/workflows/CI.yml:315-324: biome: / name: Biome (JS code formatting) ... - run: make install-biome / - run: make check-js; Makefile:37-38: check-js: / julia --project=$(BIOME) -e 'using biome_jll; exit(run(ignorestatus(\$$(biome_jll.biome()) check`)).exitcode)'`
  • repro: Makefile target with the recipe above + run: make check-js
  • confidence: low (exotic; listed for completeness)

Found by the regression-corpus audit (235 real repositories, one or more per ecosystem profile; corpus and expected results in corpus/). Evidence is quoted from the audited checkouts at the commits pinned in corpus/projects.toml; <checkouts>/<owner>__<repo> is such a checkout.

🤖 Generated with Claude Code

https://claude.ai/code/session_01ByTXNqDWdM7HzezrFtEvQt

主要語言
Python
星號
4
分支
1
平均合併
10 小時 41 分鐘
30 天內合併 PR
79

環境準備

這個專案沒有提供開發容器、Dockerfile 或貢獻指南,環境需要你自己搭建:先看它的 README,通用步驟見我們的新手貢獻指南。

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

cpp-best-practices/project_validator 的其他 Issue

查看 cpp-best-practices/project_validator 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。