Repository navigation
Warn when 'format' is used on a non-File parameter (#1616, #607) - #2291
Merged
mr-c merged 3 commits intoJul 20, 2026
Merged
Conversation
mr-c
marked this pull request as draft
June 25, 2026 13:34
arimu1
force-pushed
the
fix/537-no-container-cachedir
branch
from
June 28, 2026 06:40
0781d11 to
d28dc0c
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2291 +/- ##
==========================================
+ Coverage 85.16% 85.18% +0.02%
==========================================
Files 46 46
Lines 8595 8608 +13
Branches 2012 2017 +5
==========================================
+ Hits 7320 7333 +13
+ Misses 810 808 -2
- Partials 465 467 +2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
arimu1
force-pushed
the
fix/537-no-container-cachedir
branch
from
June 28, 2026 10:02
d28dc0c to
bdac046
Compare
arimu1
force-pushed
the
fix/537-no-container-cachedir
branch
2 times, most recently
from
July 15, 2026 13:21
5cd87c9 to
dbb5d78
Compare
arimu1
force-pushed
the
fix/537-no-container-cachedir
branch
from
July 18, 2026 15:01
dbb5d78 to
12c576a
Compare
…anguage#1616, common-workflow-language#607) `format` is only meaningful for File parameters, but cwltool silently accepted it on Directory (and other) inputs/outputs, so validation passed with no indication that the field would be ignored. Emit a validation warning (pointing at the offending `format` line) when a parameter declares `format` but its type does not contain a File. File and File[] parameters are unaffected. A warning, rather than a hard error, avoids breaking documents that currently carry a harmless stray `format`. Co-Authored-By: Claude Opus 4.8 <[email protected]>
arimu1
force-pushed
the
fix/537-no-container-cachedir
branch
from
July 20, 2026 00:23
12c576a to
adc0244
Compare
mr-c
marked this pull request as ready for review
July 20, 2026 06:23
Add fixtures and tests for File[], Directory[], and record types so _type_contains_file's array and record branches are exercised. Also accept string array items (e.g. items: File), which is the common loaded form — matching only list items incorrectly warned on File[]. Co-authored-by: Cursor <[email protected]>
Contributor
Author
|
Thanks @mr-c — added coverage for the array and record arms:
Also adjusted the array match to accept string
|
mr-c
approved these changes
Jul 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #1616 and #607.
formatis only meaningful forFileparameters. cwltool silently accepted it onDirectory(and other) inputs/outputs, so--validatepassed with no indication that the field would be ignored — exactly the "validation passes with no warnings/errors" behavior reported in #1616, and the "complains far too late" symptom in #607.Change
In
Process.__init__(cwltool/process.py), while iterating the tool'sinputs/outputs, emit a warning when a parameter declaresformatbut its type does not contain aFile. A small recursive helper_type_contains_filehandles plain (File), namespaced, array (File[]), nullable (File?) and record forms.A warning (not a hard error as #607 literally suggested) was chosen so existing documents carrying a harmless stray
formatkeep validating; this also matches the direction in the newer #1616. The warning respects--no-warnings/--quietlike other validation warnings.Tests
Added
tests/wf/format-on-directory.cwlandtests/wf/format-on-file.cwlfixtures, plus two tests intests/test_validate.py:test_validate_warns_on_format_for_non_file— asserts the warning is emitted (captured via a custom log handler, astest_validate_custom_loggerdoes).test_validate_no_format_warning_for_file— assertsformaton aFiledoes not warn.I verified the warn-test fails against the pre-fix code and passes after, and that the File case never warns. Full
test_validate.pypasses (8);black/flake8/isortclean.This change was produced with the assistance of Claude Code (model: Claude Opus). The diff, analysis, and tests were reviewed by a human before submission.