bids-validator icon indicating copy to clipboard operation
bids-validator copied to clipboard

deno: lost --config option?

Open yarikoptic opened this issue 1 year ago • 3 comments
trafficstars

Trying to run bids-examples tests but they use https://github.com/bids-standard/bids-examples/blob/master/bidsconfig.json file via -c option to ignore 99 error.

Is -c coming to deno version of validator?

yarikoptic avatar Apr 18 '24 17:04 yarikoptic

It's not implemented but partly because the format here is different (issues no longer have a number assigned) and partly because it can be done by passing in alternative schemas. Maybe we should allow a way to exclude a path in the schema as a simpler way to disable a check?

nellh avatar Apr 18 '24 19:04 nellh

Maybe we should allow a way to exclude a path in the schema as a simpler way to disable a check?

  • is such a path reported in the validator output and "specific-enough" to identify the issue to skip (or to change level e.g. from WARNING to ERROR etc)
  • I do not think all errors would have path in the schema since some checks might still be "code driven" right?

yarikoptic avatar Jun 09 '24 14:06 yarikoptic

Every issue should have a code, such as REQUIRED_FIELD_MISSING (I don't think that's real). There's a many-to-one mapping from schema rules (e.g., rules.files.raw.func.BOLD) to issue codes. So it seems like a reasonable config would be something like:

ignore:
  - CODE1  # Any rule that triggers this issue
  - CODE2
  - CODE3:  # Just some rules
    - rule1
    - rule2
warn:
  - CODE4
error:
  - CODE5:
    - rule3
    - rule4

I would also be inclined to command-line arguments:

--ignore CODE1 CODE2 CODE3:rule1 CODE3:rule2 \
--warn CODE4 \
--error CODE5:rule3 CODE5:rule4

effigies avatar Jun 09 '24 14:06 effigies