cylc-flow icon indicating copy to clipboard operation
cylc-flow copied to clipboard

Graph Section Comments Break Validation

Open wxtim opened this issue 9 months ago • 3 comments

A multiline graph containing a comment containing a set of quotes like the termination of the graph section causes a validation failure: True for both ''' and """

Reproducible Example

#!jinja2
[scheduler]
    allow implicit tasks = True

[scheduling]
    [[graph]]
        R1 = '''
            # ''' Surely Cylc Shouldn't see this as the end of the graph?
            foo
        '''

Expected Behaviour

Quotation marks in comments ought to be ignored.

wxtim avatar Mar 04 '25 16:03 wxtim

After discussion with @oliver-sanders I'm not as sure that this is wrong as I was.

wxtim avatar Mar 05 '25 09:03 wxtim

Posted to Element https://matrix.to/#/!gMuCeOJBhYqgWDGwnR:matrix.org/$174704625133144FCWJk:matrix.org?via=matrix.org

wxtim avatar May 12 '25 10:05 wxtim

I'm not entirely sure there's a right answer to that question. We just have to pick one way or the other and stick with it.

We support comments inside multi-line strings, so this clearly OK:

"""
   # one
   # two
"""

So, in support of the status quo, shouldn't the following be considered equivalent? (The only difference is a newline that has no meaning in that position, and we're talking stuff that is inside the graph string):

"""
   # one
   # two"""

hjoliver avatar May 13 '25 00:05 hjoliver