Content-detected formats (XML Schema, OpenAPI) are attributed to the root unit, not the unit that holds the files, so schema-declared says "no file to judge"
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
研究方向
Start with the content-detection origin at project_validator/facts/structure.py:224, which attributes ContentLanguages to the root path, and with _schemas() in project_validator/questions/declaration.py:52-58, which filters schemas by owner unit. Reproduce with a sub/ unit containing a.xsd lacking targetNamespace and check that schema-declared reports it instead of 'no XML Schema file to judge'. Done when probe-found formats map to the owning unit and that repro fails as expected.
由索引模型根據 Issue 內容生成。
描述
docbook/docbook: schema-declared PASS "no XML Schema file to judge" although 14 XSDs (6 without targetNamespace) and 364 documents were read: the facts are assigned to the root unit, whose formats do not include XML Schema, while the files live in the MovedToCodeberg unit; the root (holding only a README) is also reported as a Shell/XML Schema/XSLT product. hledger-web's config/openapi.yaml is read as a product SchemaDeclaration but OpenAPI is attributed to the root unit, so schema-declared reports "no OpenAPI file to judge" and static-analysis/schema-validation judge unit .. Formats found by content probes should belong to the unit that owns the files (the #51 design put probe-found formats on the root unit).
Evidence from the corpus audit
docbook/docbook / schema-declared
- kind: FALSE_POSITIVE
- actual: PASS: no XML Schema file to judge
- expected: FAIL: 6 XSDs declare no targetNamespace (and 364 documents are asked for a schema location); the facts
were all produced but assigned to a unit whose formats do not include "XML Schema". - evidence:
MovedToCodeberg/src/docbook/schemas/4.5/xsd/docbook.xsd:64:
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">(no targetNamespace; same
for calstblx, dbhierx, dbnotnx, dbpoolx, htmltblx.xsd).--facts --only schema-declaredemits 378
SchemaDeclarationfacts (14targetNamespace, 6 with"missing": ["targetNamespace"]; 364schema location).
.map.jsonunits:"directory": "."hasformats: ["XML Schema","XSLT"],languages: ["Shell"]but owns no
file;"directory": "MovedToCodeberg"hasformats: ["XML"]only. Validator:
project_validator/facts/structure.py:224ContentLanguages(origin=Origin(path="."), ...)(content detection is
always attributed to the root);questions/declaration.py:_schemasfilters byowner(schema.path, units) == unit,
so the root unit gets zero schemas andjudge_schema_declaredsays "no XML Schema file to judge";per_unitonly
asks units whoseformatscontain the language. - repro:
sub/build.gradle(any build file makingsub/a unit) +sub/a.xsdwith<xs:schema xmlns:xs="...">and
no targetNamespace; nothing at the root. Expected FAIL, actual PASS. - confidence: high
docbook/docbook / detection
- kind: DETECTION
- actual: units:
.product (Shell; XML Schema, XSLT) andMovedToCodebergproduct (Gradle; Java, JavaScript; XML) - expected: one unit
MovedToCodebergcarrying Shell (gradlew), XML Schema and XSLT; the root holds only README.md.
Consequence: "XML schemas: no tests found (XSpec suites)", "Shell: CI never runs shfmt", "Shell: no static analyzer"
are all reported against the empty root unit. - evidence:
find . -maxdepth 1 -type f->./README.mdonly;README.md:1:# Moved to Codeberg;
MovedToCodeberg/gradlew,MovedToCodeberg/src/docbook/schemas/5.0/rng/docbook.rng. Validator: same
structure.py:224as above (origin "."). - repro: as the previous finding; look at
--mapunits. - confidence: high
simonmichael/hledger / schema-declared
- kind: FALSE_NEGATIVE
- actual: PASS:
no OpenAPI file to judge(andstatic-analysis: OpenAPI/AsyncAPI: no static analyzer runs,schema-validationFAIL, both judged for unit.) - expected: PASS:
1 OpenAPI file declares its version and info.version(hledger-web/config/openapi.yaml), judged in unithledger-web. The--factsoutput shows the file was read as a productSchemaDeclarationwith nothing missing, but the OpenAPI format is attributed to the root unit while the file is owned by thehledger-webunit, so_schemas()filters it out. - evidence:
hledger-web/config/openapi.yaml:13:openapi: 3.1.0;:21:version: 1.0.0;--facts --only schema-declared:"kind": "SchemaDeclaration", "origin": "hledger-web/config/openapi.yaml", "format": "OpenAPI", "role": "product", "declared": {"openapi": "3.1.0", "info.version": "1.0.0"}, "missing": [];.map.jsonunits: rootformats: ["Dockerfile", "OpenAPI", "TOML", "YAML"],hledger-webformats: ["YAML"];project_validator/questions/declaration.py:52-58:if schema.format == format_ and owner(schema.path, units) == unit - repro:
cabal.projectwithpackages: web,web/web.cabal,web/config/openapi.yaml(openapi: 3.1.0,info: {title: x, version: 1.0.0}); expect the file judged - confidence: high
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
- 主要語言
- Python
- 星號
- 4
- 分支
- 1
- 平均合併
- 10 小時 41 分鐘
- 30 天內合併 PR
- 79
環境準備
這個專案沒有提供開發容器、Dockerfile 或貢獻指南,環境需要你自己搭建:先看它的 README,通用步驟見我們的新手貢獻指南。
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
cpp-best-practices/project_validator 的其他 Issue
-
難度 2/5 1-3 小時 新手友好度 62/100
cpp-best-practices/project_validator#267 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 68/100
cpp-best-practices/project_validator#263 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 62/100
cpp-best-practices/project_validator#260 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 74/100
cpp-best-practices/project_validator#259 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 65/100
cpp-best-practices/project_validator#255 ·
維護者通常 1 天內回覆
查看 cpp-best-practices/project_validator 的全部 Issue
相似的 Issue
-
難度 1/5 1 小時以內 新手友好度 65/100
StevenBlack/hosts#3299 ·
-
`garak --report` overwrites the input report when its name has no ".report"可能已有人在做 @0z5a 今天認領。 未關閉needs-triage
難度 2/5 半天 新手友好度 72/100
維護者通常 2 天內回覆
-
plot_graph crashes when a mesh node has no m2m edge可能已有人在做 @tygvi 今天認領。 未關閉
難度 2/5 1-3 小時 新手友好度 78/100
mllam/neural-lam#883 · 1 則留言 ·
維護者通常 2 天內回覆
-
難度 2/5 1-3 小時 新手友好度 62/100
future-agi/future-agi#4092 · 1 則留言 ·
維護者通常 1 天內回覆
-
transcript analytics: a text whose only protected spans the prose pass redacts is withheld whole未關閉
難度 1/5 1 小時以內 新手友好度 82/100
WingedGuardian/GENesis-AGI#4641 ·
維護者通常 1 天內回覆