--map reports a language and its suffix as unrecognised at once (CUDA/.cu, Objective-C/.m) and lists files the profiles read (.freeze, .xctestplan, .resolved, .Plugin, .rda, .eex, .asciidoc, .tftpl, .zsh-theme)

未關閉
#241 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

難度
4/5
預估耗時
3-5 天
新手友好度
35/100
Issue 類型
缺陷
描述清晰度
基本清楚
活躍度
活躍
技術堆疊
erlang, java, python, r, shell, swift, terraform, xml
領域
tooling

研究方向

The suffix tables are in project_validator/ecosystems/beam.py (around line 516), terraform.py (around lines 171-172) and swift.py (the XCODE_TEST_SETTINGS and PACKAGE_RESOLVED readers); the upper-case .XSD mismatch is in facts/structure.py (around line 214) and xml_schemas.py. Start by choosing one unrecognised suffix, such as .tftpl, and claiming it in its profile, then run --map on a small fixture to see it leave unrecognised_suffixes. Several items are policy questions (whether a language and its suffix can both be reported, and whether rchk counts as static analysis), so confirm the direction with a maintainer before editing.

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

描述

glfw lists languages: ["C", "Objective-C"] and .m ×5 unrecognised; llama.cpp CUDA and .cu ×209. cabal.project.freeze (a documented Haskell lock file), *.xctestplan and Package.resolved (read by the Swift profile), META-INF/services/*.Plugin (Java ServiceLoader files), .rda/.rds/.RData/.Rraw/.Rout.save/Makevars.win (R), .eex/.heex/.app.src/.config/.spec/.asciidoc/.cheatmd (BEAM), .tftpl/.tpl (Terraform templates), .zsh-theme/.zunit, .feature (Cucumber) are reported as unknown suffixes. Either the profile claims them or the language is not claimed.

Evidence from the corpus audit

ninenines/cowboy, elixir-ecto/ecto, phoenixframework/phoenix / detection (BEAM-ecosystem suffixes)
  • kind: DETECTION
  • actual: unrecognised suffixes: cowboy .asciidoc x151, .config x15, .ezdoc x3, .app x1, .spec x1 (CT spec),
    .dtl x1; phoenix .eex x156, .cheatmd x1; ecto .cheatmd x2
  • expected: .eex/.heex/.leex (EEx templates) and .app.src/.config/.spec (Erlang terms) belong to the BEAM
    profile; .cheatmd is an ex_doc cheatsheet (documentation); .asciidoc is documentation (see the README finding).
  • evidence: the unrecognised_suffixes arrays in the three .map.json files; project_validator/ecosystems/beam.py:516:
    source_suffixes={".ex": ELIXIR, ".exs": ELIXIR, ".erl": ERLANG, ".hrl": ERLANG}
  • repro: a Mix project with lib/x.html.heex and guides/cheatsheets/x.cheatmd
  • confidence: medium (low impact; data-wellformed/committed-artifacts could use .config/.app)
glfw/glfw, ggml-org/llama.cpp / detection (languages vs suffixes)
  • kind: MESSAGE
  • actual: glfw .map.json lists languages: ["C", "Objective-C"] and unrecognised_suffixes: [{".m": 5}]; llama.cpp lists CUDA as a language and .cu (209), .cuh (96) as unrecognised.
  • expected: a language the map names should not also be reported as unrecognised files (or the language should not be claimed).
  • evidence: glfw__glfw.map.json: "languages": ["C", "Objective-C"], {"suffix": ".m", "files": 5}; ggml-org__llama.cpp.map.json: "CUDA" in languages, {"suffix": ".cu", "files": 209}.
  • repro: a CMake project with project(x C OBJC) and one .m file.
  • confidence: low
PostgREST/postgrest, koalaman/shellcheck / map (unrecognised suffix .freeze)
  • kind: MESSAGE
  • actual: .map.json unrecognised_suffixes: {"suffix": ".freeze", "files": 1} in both projects, while PostgREST's dependency-management says locked in cabal.project.freeze, stack.yaml.lock
  • expected: cabal.project.freeze is a known Haskell lock file (docs/ecosystems/haskell.md: "commits cabal.project.freeze") and should not be listed as unrecognised; shellcheck's is builders/linux.armv6hf/cabal.project.freeze.
  • evidence: PostgREST__postgrest/cabal.project.freeze (root); koalaman__shellcheck/builders/linux.armv6hf/cabal.project.freeze
  • repro: a Cabal package with cabal.project.freeze; run --map
  • confidence: medium
Rdatatable/data.table, tidyverse/dplyr, r-lib/testthat / detection (R data files and R-specific analyzers)
  • kind: UNSUPPORTED
  • actual: unrecognised_suffixes: data.table .Rraw (12), .Rdata (4), .RData (2), .save (2), .win (1 = Makevars.win); dplyr .rda (5); testthat .rds, .win. data.table's rchk.yaml (rchk, the R-API static analyser for C code), the Coccinelle lint job and .ci/lint.R custom linters are not recognised as static analysis.
  • expected: .rda/.rds/.RData/.Rdata (serialised R data under data/, inst/), .Rraw (data.table's test scripts), .Rout.save/Makevars.win are files of the R ecosystem and should not be reported as unrecognised; rchk is the standard analyser for R packages with C code and would be a natural static-analysis tool for R's native code.
  • evidence: data/starwars.rda (dplyr); inst/tests/tests.Rraw, src/Makevars.win (data.table); .github/workflows/rchk.yaml:46-56: - name: Run rchk ... - name: Confirm that rchk has no errors; .github/workflows/code-quality.yaml:74-78: Install Coccinelle / run: /usr/bin/sudo apt-get -y install coccinelle / - name: Lint.
  • repro: an R package with data/x.rda; expect no unrecognised suffix.
  • confidence: medium
ohmyzsh/ohmyzsh / detection, tests-run
  • kind: UNSUPPORTED
  • actual: .map.json unrecognised_suffixes: .zsh-theme x144, .zunit x3; Shell: no tests found
  • expected: .zsh-theme files are zsh scripts (Shell); plugins/dotenv/tests/*.zunit are zunit tests (CI does not run them, so the FAIL stands, but the message "no tests found" is wrong).
  • evidence: themes/*.zsh-theme (144 files); plugins/dotenv/tests/basic-parsing.zunit, security.zunit, compatibility.zunit; .github/workflows/main.yml:36: zsh -n "$file" || return 1 (syntax check only).
  • repro: a tests/a.zunit file.
  • confidence: low
flyway/flyway / detection (META-INF/services)
  • kind: DETECTION
  • actual: map unrecognised_suffixes: .Plugin 40 files
  • expected: Java ServiceLoader provider files under META-INF/services/ are JVM resources, not unknown suffixes
  • evidence: flyway-commandline/src/main/resources/META-INF/services/org.flywaydb.core.extensibility.Plugin;
    validator: grep -rn META-INF project_validator/ecosystems/jvm/ returns nothing
  • repro: src/main/resources/META-INF/services/com.example.Spi
  • confidence: medium
Alamofire/Alamofire, pointfreeco/swift-composable-architecture, realm/SwiftLint / detection (unrecognised suffixes the profile reads)
  • kind: MESSAGE
  • actual: --map unrecognised_suffixes lists .xctestplan (Alamofire 5 files, TCA 1) and .resolved (TCA 2,
    SwiftLint 1), yet the Swift profile reads *.xctestplan for coverage settings and Package.resolved as the
    lockfile (dependency-management PASS cites Package.resolved).
  • expected: files a settings/lockfile reader consumes are recognised, not reported as unknown suffixes.
  • evidence: project_validator/ecosystems/swift.py:179: XCODE_TEST_SETTINGS = SettingsReader(name="Xcode", files=("*.xcscheme", "*.xctestplan"), ...);
    swift.py:390: PACKAGE_RESOLVED = lockfile_reader(manager="SwiftPM", files=("Package.resolved",));
    Alamofire Tests/Test Plans/iOS.xctestplan; SwiftLint ./Package.resolved.
  • repro: a Swift package with Package.resolved committed; run --map.
  • confidence: low
terraform-google-modules/terraform-google-kubernetes-engine, terraform-aws-modules/terraform-aws-eks / detection (suffixes)
  • kind: UNSUPPORTED
  • actual: map unrecognised_suffixes: [{".tmpl": 16}, {".tftpl": 1}] (GKE), [{".tpl": 8}] (eks)
  • expected: .tftpl is Terraform's documented template-file suffix (for templatefile()), and .tpl is its older convention; a Terraform profile should claim them (as templates, role template).
  • evidence: examples/safer_cluster_iap_bastion/templates/startup-script.tftpl; eks templates/al2023_user_data.tpl. Validator: ecosystems/terraform.py:171-172: source_suffixes={".tf": ..., ".tofu": ..., ".tfvars": ...}, ambiguous_suffixes={".hcl": TERRAFORM}.
  • repro: templates/x.tftpl in a Terraform project; expect it recognised, not listed as unrecognised.
  • confidence: medium
ISO-TC211/XML / detection (.XSD suffix case)
  • kind: DETECTION
  • actual: unrecognised_suffixes lists .XSD (4 files); data-wellformed does not parse them; yet schema-declared
    judges them ("schemas.isotc211.org/19160/-4/aip/2.8.0/cov.XSD: no targetNamespace")
  • expected: one consistent treatment: either an upper-case suffix is the format (then it is parsed by data-wellformed
    and not "unrecognised") or it is not (then schema-declared does not judge it).
  • evidence: schemas.isotc211.org/19160/-4/aip/2.8.0/cov.XSD, schemas.isotc211.org/19156/-/onm/2.0.0.1/modelConsistency,xsd.XSD
    (+ their schemas.isotc211.orgWork copies). Validator: ecosystems/xml_schemas.py:xsd_files uses
    PurePosixPath(path).suffix.lower() == ".xsd"; facts/structure.py:214 known.get(PurePosixPath(path).suffix)
    does not lower.
  • repro: a single A.XSD.
  • confidence: medium

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 摘要。