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

Make -s|--schema take path or add new --schema-file option to point to schema.json file #1930

Closed
yarikoptic opened this issue Apr 13, 2024 · 10 comments

Comments

@yarikoptic
Copy link
Contributor

ATM the option seems to take only some hardcoded set of versions

  -s, --schema                    BIDS specification schema version to use for
                                  validation, e.g. "v1.6.0" (beta)
         [choices: "disable", "v1.6.0", "v1.7.0", "master"] [default: "disable"]

(note: current release is 1.9.0!).

That precludes to point to a specific schema.org e.g. produced while working on a BEP. Ref:

Quick resolution would be appreciated to proceed with

@effigies
Copy link
Collaborator

The schema validator shows:

❯ deno run --allow-read --allow-env https://deno.land/x/bids_validator/bids-validator.ts --help

  Usage:   bids-validator <dataset_directory>
  Version: alpha                             

[...]

    -s, --schema          <type>  - Specify a schema version to use for validation                          (Default: "latest")   

This appears to be an experimental addition to the legacy validator. Probably best just to remove it.

@yarikoptic
Copy link
Contributor Author

But how to specify not by "version" but by the path to the schema???

@effigies
Copy link
Collaborator

deno run --allow-read --allow-env --allow-net https://deno.land/x/bids_validator/bids-validator.ts -s https://bids-specification.readthedocs.io/en/v1.9.0/schema.json /path/to/dataset

@yarikoptic
Copy link
Contributor Author

oh, will it work with file:// URLs? (happen you could check quickly... if not -- I will try later). Just need to wrap it all up into
https://github.com/bids-standard/bids-specification/pull/1775/files#diff-340dd8fa4a5cba6b30520d676d1831fd82628971874ea46396e3ace6c6ef0f03R111 but also then also into bep032 etc ... I feel like we need a github action to reuse here... Filed

WDYT @effigies ?

@nellh
Copy link
Member

nellh commented Apr 16, 2024

oh, will it work with file:// URLs? (happen you could check quickly... if not -- I will try later).

File URLs or a path to a local file should work.

@yarikoptic
Copy link
Contributor Author

just for clarity -- https://github.com/bids-standard/bids-examples/blob/master/.github/workflows/validate_datasets.yml aren't using new validator yet?

@effigies
Copy link
Collaborator

Correct.

@effigies
Copy link
Collaborator

Resolved in #1932.

@rwblair
Copy link
Member

rwblair commented Oct 17, 2024

I wasn't able to get -s to work with file:// Is this a me problem/has anyone else had luck with it?

@effigies
Copy link
Collaborator

I have BIDS_SCHEMA=file://$HOME/Projects/bids/specification/src/schema.json bids-validator micr_SPIM in my history. I'm not sure if I've tried with -s or if things have stopped working since I last did that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants