You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Code formatters may sometimes insert whitespace, e.g., to align columns in a configuration file.
Would it be possible to allow, e.g., \s+ in the bumpver configuration files, to match variable amounts of whitespace, similar to the addition of ^ and $?
The text was updated successfully, but these errors were encountered:
It might be possible, I'm not sure. The thing about the pattern syntax is, that it is used both for search and also for the replacement string. For ^ and $ this worked well, as we can generate the replacement string by just stripping them off.
The current logic works completely independently of the content to which the replacement is applied.
So, in order to implement this, the logic would need to change so that
every replacement is generated specifically for the line which it is replacing.
the pattern syntax must be implemented in a way that allows us to capture dynamic parts of the content, for example by wrapping the \s+ in a capture group syntax (\s+) and then extracting it from a regex match object.
It would be a good idea to also validate every generated replacement, by making sure the search pattern matches it. Otherwise I'd be worried that we replace a version string with something that won't be matched in a later update.
Overall this does not seem to be worth it for me to put in the effort, but I'll be happy to give feedback on and accept a PR.
Code formatters may sometimes insert whitespace, e.g., to align columns in a configuration file.
Would it be possible to allow, e.g.,
\s+
in the bumpver configuration files, to match variable amounts of whitespace, similar to the addition of^
and$
?The text was updated successfully, but these errors were encountered: