Add a structured issues model and emit findings from the filename validator
Avaliação
Esta issue ainda não foi avaliada.
Descrição
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.
- Linguagem predominante
- Python
- Estrelas
- 10
- Forks
- 7
- Métricas de merge de PRs
- Nenhum PR com merge em 30d
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Sem modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de bids-standard/python-validator
-
Populate associations contextTalvez livre de novo @ubdbra001 assumiu há 115 dias e não há nenhum pull request aberto. Aberta
bids-standard/python-validator#82 · 1 comentário · 1 responsável ·
-
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 45/100
-
performance
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 35/100
-
Validate DerivativesTalvez já em andamento @bendhouseart assumiu há 298 dias. Abertaenhancement
bids-standard/python-validator#62 · 1 responsável ·
-
Populate tiff contextAberta
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 45/100
Todas as issues de bids-standard/python-validator
Issues semelhantes
-
getchaintips leaves out the active tip once a header is staged on it, where Core always lists itAberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 88/100
btclib-org/btclib-node#2158 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 85/100
dbt-msft/dbt-sqlserver#897 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 65/100
Gathin23/cleanyourtv#2770 · 2 comentários ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
vllm-project/vllm#64845 ·
Mantenedores costumam responder em até 1 dia
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 84/100
dekobon/big-code-analysis#1729 ·
Mantenedores costumam responder em até 1 dia