Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BIDS Schema: There should be a rule that encodes that multiple README files (with different extensions) are NOT allowed #1951

Closed
sappelhoff opened this issue Oct 11, 2024 · 2 comments · Fixed by #1952
Labels
bug Something isn't working schema Issues related to the YAML schema representation of the specification. Patch version release.

Comments

@sappelhoff
Copy link
Member

See title. Currently, the schema based BIDS-validator does not throw an error when this happens.

Steps to reproduce:

  1. take a valid BIDS dataset with a README file
  2. copy the README and add a different, valid, extension
  3. validate
  4. --> no error for duplicate README is thrown

source: https://bids-specification.readthedocs.io/en/stable/glossary.html#readme-files

A BIDS dataset MUST NOT contain more than one README file (with or without extension) at its root directory.

NOTE that the legacy validator does throw an error:

Error 2: [Code 228] MULTIPLE_README_FILES

@sappelhoff sappelhoff added schema Issues related to the YAML schema representation of the specification. Patch version release. bug Something isn't working labels Oct 11, 2024
@effigies
Copy link
Collaborator

I think we were waiting on #1492 to settle how the schema represents it, but we could rewrite the existing one-offs for now. e.g.,

DuplicateReadmes:
  issues:
    code: MULTIPLE_README_FILES
    message: ...
    level: error
  selectors:
    - match(path, '^/README.*')
  checks:
    - exists(["README", "README.md", "README.rst", "README.txt"], "dataset") == 1

@effigies
Copy link
Collaborator

@sappelhoff If you agree, would you mind making a PR to patch src/schema/rules/checks/general.yaml?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working schema Issues related to the YAML schema representation of the specification. Patch version release.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants