Add a structured issues model and emit findings from the filename validator
評価
この issue はまだ評価されていません。
説明
Summary
Validation currently answers a yes/no question. BIDSValidator.is_bids() returns a
boolean, and the CLI prints one line per non-compliant file:
/sub-01/anat/oops.nii.gz is not a valid bids filename
That output carries no severity, no stable code, and no structure a program can consume.
It cannot be counted, filtered, serialised, or shown in a UI, and it cannot say why a
name is wrong.
context.py already anticipates this: ValidationError is a stub whose entire body is
"""TODO: Add issue structure.""".
Proposal
Two small pieces.
1. An issue model (bids_validator/issues.py). Pure data, no I/O, attrs to match
the convention already used by context.py, bidsignore.py and types/files.py:
Severity(error,warning)Issuewithcode,severity,location,message,sub_code,ruleDatasetIssues, an ordered collection withadd,extend,by_severity,
has_errors,__len__,__iter__
Field names mirror the reference validator so output stays interchangeable.
2. Emit findings from filename validation. Rather than one blanket answer, report the
specific reason using the reference validator's codes: NOT_INCLUDED,
MISSING_REQUIRED_ENTITY, ENTITY_NOT_IN_RULE, ENTITY_WITH_NO_LABEL,
INVALID_ENTITY_LABEL, EXTENSION_MISMATCH, DATATYPE_MISMATCH, INVALID_LOCATION,
FILENAME_MISMATCH, ALL_FILENAME_RULES_HAVE_ISSUES.
Scope is names and paths only. No file contents are read.
BIDSValidator.is_bids() stays untouched, since pybids and mne-bids depend on it.
Why this first
Every later check needs somewhere to report to. Content validation (sidecar fields, NIfTI
headers, tabular columns) produces the same Issue type into the same DatasetIssues,
so the output contract is defined once and does not change as coverage grows.
Questions for maintainers
- Is the minimal field set above right, or do you want the reference validator's richer
fields (rule provenance, machine-actionable fixes, anignoreseverity, line spans)
from the start? I kept them out to keep the first PR small. - The CLI currently prints
<path> is not a valid bids filenamefor each bad file.
When these findings are wired into it, should that output change to show the
specific code and reason, or should the current text stay the default with the
structured output behind a flag? Changing it would be more useful but would break
anyone parsing the current output. - Any preference on module naming (
issues.py/filename_checks.py)?
I have a working implementation with tests and am happy to open a PR, or to adjust the
shape first if you would prefer a different design.
- 主要言語
- Python
- スター
- 10
- フォーク
- 7
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
bids-standard/python-validator のほかの issue
-
Populate associations context再び着手できるかも @ubdbra001 が 115 日前に担当しましたが、オープン中のプルリクエストはありません。 オープン
bids-standard/python-validator#82 · コメント 1 件 · 担当者 1 名 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
-
performance
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
-
Validate Derivatives対応中かも @bendhouseart が 298 日前に担当しました。 オープンenhancement
bids-standard/python-validator#62 · 担当者 1 名 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
bids-standard/python-validator の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
pydantic/pydantic-ai#12091 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信
-
CSS enhancement good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
pychess/pychess-variants#2448 ·
メンテナーはふだん 1 日以内に返信
-
Bump locked PyTensor so Apple clang 21 does not pass -ld64対応中かも @drbenvincent が今日担当しました。 オープンbug dev ops
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
メンテナーはふだん 2 日以内に返信
-
ai_p2 bug comp-datalake
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
ClickHouse/ClickHouse#128306 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信