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

add multiline single quotes for dump a string #236

Closed
wants to merge 3 commits into from

Conversation

1letter
Copy link

@1letter 1letter commented Jul 2, 2024

this fix issues with custom regex in meta.toml see #229
@gforcada ca you review this PR please?

@gforcada
Copy link
Member

gforcada commented Jul 7, 2024

🤔 according to the TOML specification a triple quoted single strings is a literal string, i.e. a string that is not parsed at all, which fixes your regex problem.

Testing it on some repositories, I see that it changes ALL triple double quoted strings to triple single quoted strings, which I'm not sure is what we really want...

Looking at https://github.com/zopefoundation/meta I see that since some time ago (see this PR) they switched to tomlkit and that allowed them to remove the custom parser that you are now trying to fix.

As a test I did:

  • clone zopefoundation/meta
  • create a virutalenv and install config/requirements.txt on it
  • clone a random pure python package (in my case zope.authentication)
    • update its .meta.toml configuration with
[tox]
use-flake8 = true
coverage-additional = [
    "coverage: /TOTAL.\\* \\*\\*(\\d+)\\%\\*\\*/",
]
  • finally run python config-package.py zope.authentication

The configuration line lands on tox.ini like this:

coverage: /TOTAL.\* \*\*(\d+)\%\*\*/

I would say that this is what you are missing, right? 🍀

I can try to port the PR zopefoundation/meta#215 if you are not faster than me 👍🏾

Merge plone/meta into main
@1letter
Copy link
Author

1letter commented Sep 6, 2024

i will make a new PR with the tomlkit port

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

Successfully merging this pull request may close these issues.

2 participants