Stop makefile from calling linkml validate with nonexistent config files #91

Merged
adina merged 2 commits from make-invalid-wildcard into main 2025-08-15 10:24:52 +00:00
Owner

The checkvalidation (checkvalid / checkinvalid) target in the makefile globs for *(in)valid.cfg.yaml files. While #90 excluded checkinvalid from checkvalidation, this stops the (checkvalid / checkinvalid) targets from calling linkml validate when no files match the pattern instead.

Previously, if there were no *.invalid.cfg.yaml files, we still made it into the @for ex in $</*invalid.cfg.yaml loop (same for *valid) -- but with the glob expression verbatim, producing errors like this:

"Invalid value for '--config': File 'src/flat-data/unreleased/validation/*.invalid.cfg.yaml' does not exist."

It seems that make's wildcard function avoids the pitfall, while correctly expanding the globs when files are present.

The checkvalidation (checkvalid / checkinvalid) target in the makefile globs for `*(in)valid.cfg.yaml` files. While #90 excluded checkinvalid from checkvalidation, this stops the (checkvalid / checkinvalid) targets from calling `linkml validate` when no files match the pattern instead. Previously, if there were no *.invalid.cfg.yaml files, we still made it into the `@for ex in $</*invalid.cfg.yaml` loop (same for `*valid`) -- but with the glob expression verbatim, producing errors like this: "Invalid value for '--config': File 'src/flat-data/unreleased/validation/*.invalid.cfg.yaml' does not exist." It seems that make's [wildcard](https://www.gnu.org/software/make/manual/html_node/Wildcard-Function.html) function avoids the pitfall, while correctly expanding the globs when files are present.
Removes three trailing spaces, which made my editor complain on save.
Stop makefile from calling linkml validate with config absent
All checks were successful
Codespell / Check for spelling errors (pull_request) Successful in 25s
Model checks / lint (pull_request) Successful in 1m42s
Validate examples and verify unmodified conversion / lint (pull_request) Successful in 2m48s
4abd9b940b
This stops the checkvalidation (checkvalid / checkinvalid) target in
the makefile, which globs for `*(in)valid.cfg.yaml` files, from
calling `linkml validate` when no files match the pattern.

Previously, if there were no *.invalid.cfg.yaml files, we still made
it into the `@for ex in $</*invalid.cfg.yaml` loop (same for `*valid`)
-- but with the glob expression verbatim, producing errors like this:

"Invalid value for '--config': File
'src/flat-data/unreleased/validation/*.invalid.cfg.yaml' does not
exist."

It seems that make's wildcard function avoids the pitfall, while
correctly expanding the globs when files are present.

This is an alternative to a solution presented in #90, which excluded
checkinvalid from checkvalidation.

https://www.gnu.org/software/make/manual/html_node/Wildcard-Function.html
msz changed title from make-invalid-wildcard to Stop makefile from calling linkml validate with nonexistent config files 2025-08-13 13:48:38 +00:00
Owner

It would make sense to direct this PR to the datalad-concepts repo. This is the model source for all downstream efforts, whereas this is just one of the downstream usages.

It would make sense to direct this PR to the datalad-concepts repo. This is the model source for all downstream efforts, whereas this is just one of the downstream usages.
Author
Owner

@mih wrote in #91 (comment):

It would make sense to direct this PR to the datalad-concepts repo. This is the model source for all downstream efforts, whereas this is just one of the downstream usages.

Thanks, opened https://github.com/psychoinformatics-de/datalad-concepts/pull/318 now.

@mih wrote in https://hub.psychoinformatics.de/inm7/inm7-concepts/pulls/91#issuecomment-4500: > It would make sense to direct this PR to the datalad-concepts repo. This is the model source for all downstream efforts, whereas this is just one of the downstream usages. Thanks, opened https://github.com/psychoinformatics-de/datalad-concepts/pull/318 now.
Owner

I'll merge this PR, too. Thanks for the companion PR!

I'll merge this PR, too. Thanks for the companion PR!
adina merged commit 88f9078a97 into main 2025-08-15 10:24:52 +00:00
Sign in to join this conversation.
No description provided.