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

An option for to_pattern to support "to lowercase"? #274

Open
fabiscafe opened this issue Jul 8, 2024 · 1 comment
Open

An option for to_pattern to support "to lowercase"? #274

fabiscafe opened this issue Jul 8, 2024 · 1 comment

Comments

@fabiscafe
Copy link

I'm currently trying to compare the git of orca, that comes with tag names like ORCA_47_ALPHA, with the Arch package, where this would be "47alpha".

In general this is my nvchecker.toml

[orca]
source = "git"
git = "https://gitlab.gnome.org/GNOME/orca.git"
from_pattern = 'ORCA_(\d+)_([A-Z]+)'
to_pattern = '\1\2'

and it works to have "47ALPHA". That is however not the same as 47alpha and I couldn't find a way to change that to lower case. It looks like pythons re doesn't have an own feature for this, because in python there is str.lower().

So this is probably a cry for help, or a feature request 😆

@lilydjwg
Copy link
Owner

lilydjwg commented Jul 8, 2024

I suggest to change form outside nvchecker. If a method call should be supported, there soon would be requests to support other, more complex cases, e.g. make a substring to lowercase, or to turn Jul 08, 2024 into 2024-07-08. Maybe the solution would be to allow writing Python code in the config, but wouldn't it gone too far?

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