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

cylc lint is catching things in multi-line strings #6507

Open
blaylockbk opened this issue Nov 29, 2024 · 2 comments
Open

cylc lint is catching things in multi-line strings #6507

blaylockbk opened this issue Nov 29, 2024 · 2 comments
Assignees
Labels
bug Something is wrong :(
Milestone

Comments

@blaylockbk
Copy link

Description

cylc lint is flagging items in multi-line strings. I expected these lines to be skipped by the linter.

Reproducible Example

For this flow.cylc file

[meta]
    title = This is my workflow
    description = """
        This workflow demonstrates how linting flags things in multi-long comments

        Just wanted to say this is how you set UTC mode...

        [scheduler]
            UTC mode = True
    """

[scheduler]
    UTC mode = True

[scheduling]
    initial cycle point = 2024-01-01T00:00Z
    final cycle point = 2024-01-02T00:00Z

When I run cylc lint I get this...

[S003] flow.cylc:8: Top level sections should not be indented.

Checked <myWorkflowDirectory> against ['728', 'style'] rules and found 1 issue.

Expected Behaviour

Line 8 is part of the multiline description and is not "cylc". I expected the linter to ignore these lines.

@blaylockbk blaylockbk added the bug Something is wrong :( label Nov 29, 2024
@hjoliver
Copy link
Member

hjoliver commented Dec 1, 2024

Ha, good spotting - I guess we didn't expect to see valid Cylc config inside string values!

Workaround, for the moment - put this sort of thing in a comment.

@hjoliver hjoliver added this to the 8.x milestone Dec 1, 2024
@wxtim wxtim self-assigned this Dec 2, 2024
@oliver-sanders
Copy link
Member

Similar problem to #6348. The linter would need to be stateful to handle situations like this which would require a rethink in the approach.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is wrong :(
Projects
None yet
Development

No branches or pull requests

4 participants