Skip to content

Multi-line regex support for search pattern #83

@achary

Description

@achary

First, thanks for this nice tool. I exactly understand your motivation for switching from bumpversion and I admit that solving various workflow and integration issues (like incorporating change log generation in the same transaction) became nice and easy with tbump.

Now to the issue.
I'm using the tool to support version tracking for project, where a single line match is not ambiguity-free. Eg. the version is stored as:

[[package]]
name = "my-project"
version = "1.1.0"

along with references to other thirdparty packages, let's say:

[[package]]
name = "rustc-hash"
version = "1.1.0"

[[package]]
name = "scopeguard"
version = "1.1.0"

Making a search formula in tbump.toml to bump only the my-project version string to 1.2.0 is currently not possible IMO.

I suggest supporting multi-line regex, so things like \n line ending could be added to make unique matches possible in situations like this:

search = '^name = "my-project"\nversion = "{current_version}"'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions