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

Escaped Backslash in zpretty_extra_lines throws toml.decoder.TomlDecodeError: Reserved escape sequence used #223

Open
1letter opened this issue May 3, 2024 · 2 comments

Comments

@1letter
Copy link

1letter commented May 3, 2024

That's what i want:

-   repo: https://github.com/collective/zpretty
    rev: 3.1.0
    hooks:
    -   id: zpretty
        name: zpretty xml with excludes
        files: ".*.(zcml|xml)$"
        args: ["--extend-exclude=^.*sample-data\/.*.(zcml|xml)$"]

in the .meta.toml that's what i configured:

[pre_commit]
zpretty_extra_lines = """
        name: zpretty xml with excludes
        files : ".*.(zcml|xml)$"
        args : ["--extend-exclude=^.*sample-data\/.*.(zcml|xml)$"]
"""

it fails with: toml.decoder.TomlDecodeError: Reserved escape sequence used

The problem is the escaped backslash: \/, any hints what can i do?

@gforcada
Copy link
Member

Does \\/ not work? 🤔

@1letter
Copy link
Author

1letter commented May 14, 2024

Does \\/ not work? 🤔

No double quote doesn't help. i rewrite the regex to:


[pre_commit]
zpretty_extra_lines = """
    name: zpretty xml with excludes
    files : ".*.(zcml|xml)$"        
    args: ["--extend-exclude=^.*sample-data.*.(zcml|xml)$"]
"""

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants